private void SetupTabSticker(JewelControl jewel, StoreTab tab) { if (this.parentStoreScreen.IsTabLocked(tab)) { this.HideStickerVisuals(tab); return; } StickerType stickerTypeFromStoreTab = this.GetStickerTypeFromStoreTab(tab); StickerController stickerController = Service.StickerController; StickerVO storeStickerToDisplay = stickerController.GetStoreStickerToDisplay(stickerTypeFromStoreTab); jewel.EndTime = 0; if (storeStickerToDisplay == null) { jewel.Cleanup(); this.HideStickerVisuals(tab); return; } jewel.EndTime = storeStickerToDisplay.EndTime; this.SetupStickerVisuals(tab, storeStickerToDisplay); }
private void SetupCrystalsSticker(JewelControl jewel) { StickerController stickerController = Service.StickerController; StickerVO storeStickerToDisplay = stickerController.GetStoreStickerToDisplay(StickerType.CrystalShop); Lang lang = Service.Lang; bool flag = storeStickerToDisplay != null && this.parentStoreScreen.HasInAppPurchaseItems(); this.parentStoreScreen.GetElement <UXElement>("PanelCrystalsSpecial").Visible = false; this.parentStoreScreen.GetElement <UXElement>("WidgetCrystalsNormal").Visible = true; jewel.EndTime = 0; if (!flag) { jewel.Cleanup(); return; } jewel.EndTime = storeStickerToDisplay.EndTime; string assetName = "storeicon_lg_crystals_special"; string factionBasedTextureAsset = stickerController.GetFactionBasedTextureAsset(storeStickerToDisplay); if (!string.IsNullOrEmpty(factionBasedTextureAsset)) { assetName = factionBasedTextureAsset; } this.parentStoreScreen.GetElement <UXTexture>("TextureCrystalsIconSpecial").LoadTexture(assetName, new Action(this.OnCrystalsSpecialTextureLoaded)); jewel.Text = lang.Get(storeStickerToDisplay.LabelText, new object[0]); string iconAsset = storeStickerToDisplay.IconAsset; bool flag2 = !string.IsNullOrEmpty(iconAsset); if (flag2) { jewel.Icon = iconAsset; } this.parentStoreScreen.GetElement <UXElement>("particlesJewelCrystals").Visible = flag2; if (jewel.TimerLabel != null) { jewel.TimerLabel.TextColor = UXUtils.COLOR_CRYSTALS_EXPIRE_LABEL_NORMAL; CountdownControl countdownControl = new CountdownControl(jewel.TimerLabel, lang.Get("crystal_sale_sticker_expiration_timer", new object[0]), storeStickerToDisplay.EndTime); countdownControl.SetThreshold(GameConstants.CRYSTAL_STORE_SALE_EXPIRATION_TIMER_WARNING, UXUtils.COLOR_CRYSTALS_EXPIRE_LABEL_WARNING); } }