Example #1
0
        public static void SetCrateTargetedOfferTimerLabel(uint expiresAt, UXLabel expirationLabel, Lang lang)
        {
            expirationLabel.TextColor = UXUtils.COLOR_CRATE_EXPIRE_LABEL_NORMAL;
            int thresholdSeconds = GameConstants.CRATE_INVENTORY_EXPIRATION_TIMER_WARNING * 60;
            CountdownControl countdownControl = new CountdownControl(expirationLabel, lang.Get("expires_in", new object[0]), (int)expiresAt);

            countdownControl.SetThreshold(thresholdSeconds, UXUtils.COLOR_CRATE_EXPIRE_LABEL_WARNING);
        }
Example #2
0
        public static void SetLeiExpirationTimerLabel(LimitedEditionItemVO leiVO, UXLabel expirationLabel, Lang lang)
        {
            expirationLabel.TextColor = UXUtils.COLOR_CRATE_EXPIRE_LABEL_NORMAL;
            int thresholdSeconds = GameConstants.CRATE_INVENTORY_LEI_EXPIRATION_TIMER_WARNING * 60;
            CountdownControl countdownControl = new CountdownControl(expirationLabel, lang.Get("CRATE_FLYOUT_LEI_EXPIRATION_TIMER", new object[0]), leiVO.EndTime);

            countdownControl.SetThreshold(thresholdSeconds, UXUtils.COLOR_CRATE_EXPIRE_LABEL_WARNING);
        }
Example #3
0
 public static void SetCrateExpirationTimerLabel(CrateData crate, UXLabel expirationLabel, Lang lang)
 {
     if (!crate.DoesExpire)
     {
         expirationLabel.Text      = lang.Get("CRATE_INVENTORY_CRATE_NO_EXPIRATION_TIMER", new object[0]);
         expirationLabel.TextColor = UXUtils.COLOR_CRATE_EXPIRE_LABEL_NORMAL;
     }
     else
     {
         int thresholdSeconds = GameConstants.CRATE_INVENTORY_EXPIRATION_TIMER_WARNING * 60;
         CountdownControl countdownControl = new CountdownControl(expirationLabel, lang.Get("CRATE_INVENTORY_CRATE_EXPIRATION_TIMER", new object[0]), (int)crate.ExpiresTimeStamp);
         countdownControl.SetThreshold(thresholdSeconds, UXUtils.COLOR_CRATE_EXPIRE_LABEL_WARNING);
     }
 }
Example #4
0
        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);
            }
        }