From b5cd717a8b7bf0abfb5d59f4e7d58bb19370e6a7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 4 Feb 2026 10:29:13 +0400 Subject: [PATCH] Name crafted models correctly. --- Telegram/Resources/langs/lang.strings | 2 ++ Telegram/SourceFiles/boxes/star_gift_preview_box.cpp | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 3f521b1947..40238f567b 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -4277,6 +4277,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_auction_preview_models#one" = "This collectible features **{count}** unique model."; "lng_auction_preview_models#other" = "This collectible features **{count}** unique models."; "lng_auction_preview_models_button" = "Models"; +"lng_auction_preview_crafted#one" = "This collectible features **{count}** crafted model."; +"lng_auction_preview_crafted#other" = "This collectible features **{count}** crafted models."; "lng_auction_preview_backdrop" = "backdrop"; "lng_auction_preview_backdrops#one" = "This collectible features **{count}** unique backdrop."; "lng_auction_preview_backdrops#other" = "This collectible features **{count}** unique backdrops."; diff --git a/Telegram/SourceFiles/boxes/star_gift_preview_box.cpp b/Telegram/SourceFiles/boxes/star_gift_preview_box.cpp index 926f1ac9f3..d096700a47 100644 --- a/Telegram/SourceFiles/boxes/star_gift_preview_box.cpp +++ b/Telegram/SourceFiles/boxes/star_gift_preview_box.cpp @@ -256,6 +256,8 @@ private: int _visibleFrom = 0; int _visibleTill = 0; + bool _craftedModels = false; + }; [[nodiscard]] QColor MakeOpaque(QColor color, QColor bg) { @@ -979,6 +981,10 @@ AttributesList::AttributesList( , _list(&_entries->list) { _singleMin = _delegate->buttonSize(); + _craftedModels = !attributes->models.empty() + && (attributes->models.front().rarityType() + != Data::UniqueGiftRarity::Default); + fill(); _tab.value( @@ -1206,7 +1212,9 @@ void AttributesList::clicked(int index) { void AttributesList::refreshAbout() { auto text = [&] { switch (_tab.current()) { - case Tab::Model: return tr::lng_auction_preview_models; + case Tab::Model: return _craftedModels + ? tr::lng_auction_preview_crafted + : tr::lng_auction_preview_models; case Tab::Pattern: return tr::lng_auction_preview_symbols; case Tab::Backdrop: return tr::lng_auction_preview_backdrops; }