コード例 #1
0
        protected override void onRefresh()
        {
            Player player = GameLogic.Binder.GameState.Player;

            base.m_contentMenu.refreshTitle(StringExtensions.ToUpperLoca(_.L(ConfigLoca.DHUD_BUTTON_MISSIONS, null, false)), string.Empty, string.Empty);
            bool flag = player.Missions.hasMissionOnCooldown();

            this.m_sortedMissionInstanceList.Clear();
            for (int i = 0; i < player.Missions.Instances.Count; i++)
            {
                this.m_sortedMissionInstanceList.Add(player.Missions.Instances[i]);
            }
            this.m_sortedMissionInstanceList.Sort(new Comparison <MissionInstance>(MissionInstance.CompareByCooldown));
            for (int j = 0; j < this.m_missionCells.Count; j++)
            {
                MissionCell cell = this.m_missionCells[j];
                if (j < this.m_sortedMissionInstanceList.Count)
                {
                    MissionInstance mission = this.m_sortedMissionInstanceList[j];
                    bool            flag2   = mission.getRemainingCooldownSeconds() > 0L;
                    cell.gameObject.SetActive(!flag2);
                    if (!flag2)
                    {
                        if (App.Binder.ConfigMeta.NOTIFY_NEW_MISSIONS_DURING_WELCOME_BACK)
                        {
                            CmdInspectMission.ExecuteStatic(player, mission);
                        }
                        cell.refresh(player, mission, (j < player.Missions.Instances.Count) || flag, null, null);
                        if (!App.Binder.ConfigMeta.NOTIFY_NEW_MISSIONS_DURING_WELCOME_BACK)
                        {
                            CmdInspectMission.ExecuteStatic(player, mission);
                        }
                    }
                }
                else
                {
                    cell.gameObject.SetActive(false);
                }
            }
            if (flag)
            {
                this.MasterCooldownRootTm.gameObject.SetActive(true);
                this.MasterCooldownText.text = MenuHelpers.SecondsToStringHoursMinutes(player.Missions.getMinRemainingCooldownSeconds());
                this.MasterCooldownRootTm.SetAsLastSibling();
            }
            else
            {
                this.MasterCooldownRootTm.gameObject.SetActive(false);
            }
            int amount = player.Missions.getNumCompletedMissionsRequiredForBigPrize();
            int num4   = amount - Mathf.Max(amount - player.Missions.NumUnclaimedMissionCompletions, 0);

            this.MasterDescription.text = _.L(ConfigLoca.MISSIONS_BIG_PRIZE, new < > __AnonType9 <int>(amount), false);
            this.MasterProgressBar.setNormalizedValue(Mathf.Clamp01(((float)num4) / ((float)amount)));
            this.MasterProgressBarText.text = num4 + " / " + amount;
        }
コード例 #2
0
        protected override void onRefresh()
        {
            base.m_contentMenu.refreshTitle(StringExtensions.ToUpperLoca(_.L(ConfigLoca.VENDOR_TITLE_SHOP, null, false)), string.Empty, string.Empty);
            Player player = GameLogic.Binder.GameState.Player;

            player.Notifiers.ShopInspected = true;
            this.RefreshValue.text         = MenuHelpers.SecondsToStringHoursMinutes(player.Vendor.getSecondsToNextVendorInventoryRefresh());
            for (int i = 0; i < this.m_augCards.Count; i++)
            {
                Card card = this.m_augCards[i];
                PlayerAugmentation augmentation = (PlayerAugmentation)card.ActiveContent.Obj;
                bool interactable = !player.Tournaments.hasTournamentSelected() && player.Augmentations.canBuy(augmentation.Id);
                this.m_augCards[i].refresh(card.ActiveContent.Text, card.ActiveContent.PriceText, card.ActiveContent.PriceIcon, interactable, !interactable);
            }
            for (int j = 0; j < this.m_vendorCards.Count; j++)
            {
                ShopPurchaseController controller = (ShopPurchaseController)this.m_vendorCards[j].ActiveContent.Obj;
                controller.updateDetails();
                this.m_vendorCards[j].refresh(StringExtensions.ToUpperLoca(controller.getTitle()), controller.getPriceText(1), controller.getPriceIcon(), controller.isPurchaseable(), !controller.isPurchaseable());
            }
            bool flag2 = false;

            foreach (string str in ShopManager.ValidPromoSlots)
            {
                RemotePromotion promotionForPromoSlot = Service.Binder.PromotionManager.GetPromotionForPromoSlot(str);
                if (((promotionForPromoSlot != null) && promotionForPromoSlot.ParsedLoca.ValidateShopBannerLoca()) && Service.Binder.PromotionManager.ShouldShowTimer(promotionForPromoSlot))
                {
                    flag2 = true;
                    this.PromoRunsOutValue.text = Service.Binder.PromotionManager.GetTimeLeftFormatted(promotionForPromoSlot);
                    break;
                }
            }
            this.PromoRunsOutTitle.gameObject.SetActive(flag2);
            this.PromoRunsOutValue.gameObject.SetActive(flag2);
            flag2 = false;
            foreach (string str2 in ShopManager.ValidSecondaryPromoSlots)
            {
                RemotePromotion promotion = Service.Binder.PromotionManager.GetPromotionForPromoSlot(str2);
                if (((promotion != null) && promotion.ParsedLoca.ValidateShopBannerLoca()) && Service.Binder.PromotionManager.ShouldShowTimer(promotion))
                {
                    flag2 = true;
                    this.SecondaryPromoRunsOutValue.text = Service.Binder.PromotionManager.GetTimeLeftFormatted(promotion);
                    break;
                }
            }
            this.SecondaryPromoRunsOutTitle.gameObject.SetActive(flag2);
            this.SecondaryPromoRunsOutValue.gameObject.SetActive(flag2);
        }