Beispiel #1
0
        private void InitExpirationLabel()
        {
            TargetedBundleController targetedBundleController = Service.Get <TargetedBundleController>();

            this.expirationLabel = base.GetElement <UXLabel>("LabelCrateExpireTimer");
            if (this.ModalReason == CrateInfoReason.Reason_Store_Buy && this.targetLEIVO != null)
            {
                UXUtils.SetLeiExpirationTimerLabel(this.targetLEIVO, this.expirationLabel, this.lang);
                Service.Get <ViewTimeEngine>().RegisterClockTimeObserver(this, 1f);
                return;
            }
            if (this.ModalReason == CrateInfoReason.Reason_Inventory_Open && this.crateData != null)
            {
                UXUtils.SetCrateExpirationTimerLabel(this.crateData, this.expirationLabel, this.lang);
                if (this.crateData.DoesExpire)
                {
                    Service.Get <ViewTimeEngine>().RegisterClockTimeObserver(this, 1f);
                    return;
                }
            }
            else
            {
                if (this.ModalReason == CrateInfoReason.Reason_Targeted_Offer)
                {
                    UXUtils.SetCrateTargetedOfferTimerLabel(targetedBundleController.OfferExpiresAt, this.expirationLabel, this.lang);
                    Service.Get <ViewTimeEngine>().RegisterClockTimeObserver(this, 1f);
                    return;
                }
                this.expirationLabel.Visible = false;
            }
        }