protected override void onRefresh() { double num; double num2; double num3; Player player = GameLogic.Binder.GameState.Player; this.TokensFromBosses.text = _.L(ConfigLoca.ASCEND_FROM_BOSSES, new < > __AnonType9 <int>(player.ActiveCharacter.HeroStats.BossesBeat), false); this.TokensFromEliteBosses.text = _.L(ConfigLoca.ASCEND_FROM_ELITE_BOSSES, new < > __AnonType9 <int>(player.ActiveCharacter.HeroStats.EliteBossesBeat), false); this.TokensFromItems.text = _.L(ConfigLoca.ASCEND_FROM_ITEMS, new < > __AnonType9 <int>(LangUtil.TryGetIntValueFromDictionary <int>(player.ActiveCharacter.HeroStats.ItemsGainedByRarity, ConfigMeta.ITEM_HIGHEST_RARITY)), false); double v = player.getTotalTokensFromRetirement(out num, out num2, out num3); this.TokensMultiplier.text = _.L(ConfigLoca.ASCEND_MULTIPLIER, new < > __AnonType9 <string>(num3.ToString("0.0") + "X"), false); this.TokensTotal.text = "\x00d7" + MenuHelpers.BigValueToString(v); int num5 = 0; for (int i = 0; i < player.UnclaimedRewards.Count; i++) { if (player.UnclaimedRewards[i].ChestType == ChestType.RewardBoxCommon) { num5++; } } this.RewardBoxesText.text = "\x00d7" + num5.ToString(); Reward reward = player.getFirstUnclaimedRetirementTriggerChest(); if (reward != null) { this.FrenzyPotionsText.text = "\x00d7" + reward.FrenzyPotions; } else { this.FrenzyPotionsText.text = "0"; } }
public void initialize(string upgradeId, RunestoneMilestone upgradeMilestone, int levelRequirement, bool stripedRow, bool isUnlocked) { this.UpgradeMilestone = upgradeMilestone; this.LevelReq.text = "Rank " + levelRequirement; this.Icon.enabled = true; if (this.UpgradeMilestone.Perk != null) { PerkInstance perk = this.UpgradeMilestone.Perk; PerkType perkType = perk.Type; ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[perkType]; this.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", data.SmallSprite); this.Description.text = MenuHelpers.GetFormattedPerkDescription(perkType, perk.Modifier, data.DurationSeconds, data.Threshold, 0f, true); } else { this.Icon.sprite = null; this.Description.text = "CHANGE ME"; } this.Background.color = !stripedRow ? ConfigUi.LIST_CELL_REGULAR_COLOR : ConfigUi.LIST_CELL_STRIPED_COLOR; if (isUnlocked) { this.CanvasGroup.alpha = 1f; this.Icon.material = null; } else { this.CanvasGroup.alpha = 0.5f; this.Icon.material = PlayerView.Binder.DisabledUiMaterial; } }
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; }
public void initialize(GameLogic.LeagueData leagueData, bool stripedRow) { this.LeagueData = leagueData; this.CrownRequirement.text = this.LeagueData.Title; this.RewardIcon.sprite = PlayerView.Binder.SpriteResources.getSprite(ConfigUi.CHEST_BLUEPRINTS[leagueData.RewardChestType].Icon); this.CrownRequirement.text = MenuHelpers.BigValueToString(this.LeagueData.CrownRequirement); bool flag = ConfigLeagues.HasPlayerReachedLeague(GameLogic.Binder.GameState.Player.getResourceAmount(ResourceType.Crown), this.LeagueData); this.RewardIcon.material = !flag ? PlayerView.Binder.DisabledUiMaterial : null; }
protected override void onRefresh() { Player player = GameLogic.Binder.GameState.Player; base.m_contentMenu.refreshTabs(); for (int i = 0; i < this.m_itemCells.Count; i++) { this.m_itemCells[i].refresh(); } this.TokenCount.text = MenuHelpers.BigValueToString(player.getResourceAmount(ResourceType.Token)); }
protected override void onPreShow([Optional, DefaultParameterValue(null)] object param) { MiniPopupMenu contentMenu = (MiniPopupMenu)base.m_contentMenu; RewardGalleryCell.Content content2 = new RewardGalleryCell.Content(); content2.Sprite = new SpriteAtlasEntry("Menu", "icon_bossticket"); content2.Text = string.Empty; RewardGalleryCell.Content rewardContent = content2; int num = App.Binder.ConfigMeta.BOSS_POTION_NUM_BOSSES; string overrideDescriptionTextLocalized = MenuHelpers.GetFormattedDescription(_.L(ConfigUi.MiniPopupEntries.BOSS_POTION.DescriptionText, null, false), "$Amount$", num); contentMenu.populateLayout(ConfigUi.MiniPopupEntries.BOSS_POTION, true, rewardContent, null, null, overrideDescriptionTextLocalized); }
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); }
public void refresh(Player player, MissionInstance mission, bool doShowDivider, [Optional, DefaultParameterValue(null)] string titleOverride, [Optional, DefaultParameterValue(null)] string descriptionOverride) { double num; float v = mission.getMissionProgress(player, out num); num = (num <= mission.Requirement) ? num : mission.Requirement; ConfigMissions.Mission missionData = ConfigMissions.GetMissionData(mission.MissionId); long totalSeconds = mission.getRemainingCooldownSeconds(); bool flag = ((mission.MissionType == MissionType.PromotionEvent) && (v == 1.0)) && !mission.OnCooldown; bool flag2 = (mission.MissionType == MissionType.PromotionEvent) && mission.OnCooldown; Image image = (mission.MissionType != MissionType.PromotionEvent) ? this.RewardIconBig : this.RewardIconSmall; this.IconBgGolden.gameObject.SetActive(flag); this.ProgressBarFgGolden.gameObject.SetActive(flag); this.ProgressBarText.gameObject.SetActive(!flag); this.CooldownRoot.SetActive(flag2); this.Title.gameObject.SetActive(!flag2); this.Description.gameObject.SetActive(!flag2); this.ProgressBar.gameObject.SetActive(!flag2); this.RewardText.gameObject.SetActive(!(flag2 || flag)); this.RewardIconSmall.gameObject.SetActive(false); this.RewardIconBig.gameObject.SetActive(false); image.gameObject.SetActive(!(flag2 || flag)); this.Divider.SetActive(doShowDivider); if (mission.MissionType == MissionType.PromotionEvent) { this.CooldownSubtitle.text = _.L(ConfigLoca.PROMOTION_EVENT_MISSION_AVAILABLE_IN, null, false); } this.CooldownTime.text = MenuHelpers.SecondsToStringDaysHoursMinutes(totalSeconds, true); this.Icon.sprite = (mission.MissionType != MissionType.PromotionEvent) ? PlayerView.Binder.SpriteResources.getSprite(missionData.Icon) : PlayerView.Binder.SpriteResources.getSprite(ConfigMissions.PROMOTION_EVENT_MISSION_ICON); this.Icon.material = !flag2 ? null : PlayerView.Binder.DisabledUiMaterial; this.IconBg.material = !flag2 ? null : PlayerView.Binder.DisabledUiMaterial; this.Notifier.SetActive(!mission.Inspected); this.Title.text = StringExtensions.ToUpperLoca((titleOverride == null) ? _.L(missionData.Title, null, false) : titleOverride); this.Description.text = !flag?missionData.getFormattedMissionDescription(mission.Requirement, true, descriptionOverride) : _.L(ConfigLoca.MISSION_COMPLETED, null, false); this.ProgressBarText.text = num + " / " + mission.Requirement; this.ProgressBar.setNormalizedValue(v); image.sprite = ConfigMissions.GetMissionRewardIcon(mission); this.RewardText.text = ConfigMissions.GetMissionRewardTitle(mission); }
protected override void onRefresh() { Player player = GameLogic.Binder.GameState.Player; CharacterInstance activeCharacter = player.ActiveCharacter; base.m_contentMenu.refreshTitle(StringExtensions.ToUpperLoca(_.L(ConfigLoca.HEROVIEW_TITLE, null, false)), string.Empty, string.Empty); if (!string.IsNullOrEmpty(player.SocialData.Name)) { this.HeaderTitle.text = StringExtensions.ToUpperLoca(player.SocialData.Name); } else { this.HeaderTitle.text = StringExtensions.ToUpperLoca(player.ActiveCharacter.Name); } this.HeroAvatarImage.texture = PlayerView.Binder.MenuSystem.CharacterMenuCamera.RenderTexture; this.HeroAvatarImage.enabled = true; this.AtkText.text = MenuHelpers.BigValueToString(activeCharacter.DamagePerHit(false)); this.DefText.text = MenuHelpers.BigValueToString(activeCharacter.MaxLife(false)); this.SklText.text = MenuHelpers.BigValueToString(activeCharacter.SkillDamage(false)); this.refreshHeroStats(); }
public void onSellButtonClicked() { if (!PlayerView.Binder.MenuSystem.InTransition) { bool flag; TooltipMenu.InputParameters parameters5; Player player = GameLogic.Binder.GameState.Player; CharacterInstance activeCharacter = player.ActiveCharacter; int num = activeCharacter.getHighestItemLevelPlusRankEquippedOrInInventory(this.ItemInstance.Item.Type, out flag); if (activeCharacter.isItemInstanceEquipped(this.ItemInstance)) { parameters5 = new TooltipMenu.InputParameters(); parameters5.CenterOnTm = this.SellButton.RectTm; parameters5.MenuContentParams = _.L(ConfigLoca.TOOLTIP_CANNOT_SELL_EQUIPPED, null, false); TooltipMenu.InputParameters parameter = parameters5; PlayerView.Binder.MenuSystem.transitionToMenu(MenuType.TooltipMenu, MenuContentType.InfoTooltip, parameter, 0f, false, true); } else if ((!ConfigMeta.CAN_SELL_HIGHEST_LEVEL_ITEM && (this.ItemInstance.LevelPlusRank == num)) && !flag) { parameters5 = new TooltipMenu.InputParameters(); parameters5.CenterOnTm = this.SellButton.RectTm; parameters5.MenuContentParams = _.L(ConfigLoca.TOOLTIP_CANNOT_SELL_HIGHEST, null, false); TooltipMenu.InputParameters parameters2 = parameters5; PlayerView.Binder.MenuSystem.transitionToMenu(MenuType.TooltipMenu, MenuContentType.InfoTooltip, parameters2, 0f, false, true); } else if (!ConfigMeta.CAN_SELL_HIGHEST_RARITY_ITEM && (this.ItemInstance.Rarity == ConfigMeta.ITEM_HIGHEST_RARITY)) { double num2; double num3; App.Binder.ConfigMeta.ItemSellCurve(activeCharacter, this.ItemInstance.Item.Type, this.ItemInstance.Rarity, this.ItemInstance.Level, this.ItemInstance.Rank, out num2, out num3); parameters5 = new TooltipMenu.InputParameters(); parameters5.CenterOnTm = this.SellButton.RectTm; parameters5.MenuContentParams = _.L(ConfigLoca.TOOLTIP_CANNOT_SELL_LEGENDARY, new < > __AnonType4 <string>(MenuHelpers.ColoredText(MenuHelpers.BigValueToString(num3))), false); TooltipMenu.InputParameters parameters3 = parameters5; PlayerView.Binder.MenuSystem.transitionToMenu(MenuType.TooltipMenu, MenuContentType.InfoTooltip, parameters3, 0f, false, true); } else if (false) { parameters5 = new TooltipMenu.InputParameters(); parameters5.CenterOnTm = this.SellButton.RectTm; parameters5.MenuContentParams = this.ItemInstance; TooltipMenu.InputParameters parameters4 = parameters5; PlayerView.Binder.MenuSystem.transitionToMenu(MenuType.TooltipMenu, MenuContentType.SellConfirmationTooltip, parameters4, 0f, false, true); } else { CmdSellItem.ExecuteStatic(player.ActiveCharacter, this.ItemInstance, this.SellButton.RectTm); PlayerView.Binder.AudioSystem.playSfx(AudioSourceType.SfxUi_ItemSell, (float)0f); PlayerView.Binder.MenuSystem.returnToPreviousMenu(true); } } }
protected override void onRefresh() { Player player = GameLogic.Binder.GameState.Player; CharacterInstance activeCharacter = player.ActiveCharacter; GameLogic.Item item = this.getReferenceItem(); if (this.ItemInstance != null) { int num; this.PowerText.text = MenuHelpers.BigValueToString(App.Binder.ConfigMeta.ItemPowerCurve(this.ItemInstance.Item.Type, player.getRiggedItemLevel(this.ItemInstance), this.ItemInstance.Rank)); int num2 = activeCharacter.getItemInstantUpgradeCount(this.ItemInstance, out num); if (num2 > ConfigMeta.ITEM_INSTANT_UPGRADE_LEVEL_THRESHOLD) { this.SpecialOfferPanel.SetActive(true); this.InstantUpgradeText.text = _.L(ConfigLoca.ITEMINFO_INSTANT_UPGRADE_DESCIPTION, new < > __AnonType8 <int>(num), false); this.InstantUpgradeButton.ButtonScript.interactable = num2 > 0; this.InstantUpgradeButton.ButtonImage.material = !this.InstantUpgradeButton.ButtonScript.interactable ? PlayerView.Binder.DisabledUiMaterial : null; this.InstantUpgradeButton.ButtonIcon.material = this.InstantUpgradeButton.ButtonImage.material; } else { this.SpecialOfferPanel.SetActive(false); } if (player.canEvolveItem(this.ItemInstance)) { this.EquipButton.enabled = true; this.EquipButtonImage.material = null; this.EquipButtonText.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_UPGRADE, null, false)); this.EquipButtonPulse.enabled = true; } else if (activeCharacter.isItemInstanceEquipped(this.ItemInstance)) { this.EquipButton.enabled = false; this.EquipButtonImage.material = PlayerView.Binder.DisabledUiMaterial; this.EquipButtonText.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_EQUIPPED, null, false)); this.EquipButtonPulse.enabled = false; this.IconSelectedBorder.enabled = true; } else if (!activeCharacter.hasReachedUnlockFloorForItem(this.ItemInstance)) { this.EquipButton.enabled = false; this.EquipButtonImage.material = PlayerView.Binder.DisabledUiMaterial; this.EquipButtonText.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_FLOOR_X, new < > __AnonType15 <int>(this.ItemInstance.UnlockFloor), false)); this.EquipButtonPulse.enabled = false; this.IconSelectedBorder.enabled = false; } else if (!this.ItemInstance.Unlocked) { this.EquipButton.enabled = false; this.EquipButtonImage.material = PlayerView.Binder.DisabledUiMaterial; this.EquipButtonText.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_LOCKED, null, false)); this.EquipButtonPulse.enabled = false; this.IconSelectedBorder.enabled = false; } else { this.EquipButton.enabled = true; this.EquipButtonImage.material = null; this.EquipButtonText.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_EQUIP, null, false)); this.EquipButtonPulse.enabled = false; this.IconSelectedBorder.enabled = false; } this.LevelText.text = (player.getRiggedItemLevel(this.ItemInstance) + this.ItemInstance.Rank).ToString(); } else { this.PowerText.text = "0"; this.LevelText.text = "1"; this.SpecialOfferPanel.SetActive(false); } if ((this.ItemInstance != null) && (this.ItemInstance.Perks.count() > 0)) { this.RerollButton.interactable = true; this.RerollCost.text = App.Binder.ConfigMeta.ItemRerollDiamondCostCurve(this.ItemInstance.Rarity, this.ItemInstance.RerollCount).ToString(); } else { this.RerollButton.interactable = false; this.RerollCost.text = "-"; } this.RerollButtonImage.material = !this.RerollButton.interactable ? PlayerView.Binder.DisabledUiMaterial : null; int num3 = item.FixedPerks.count(); if (num3 > 0) { IconWithText text = this.Perks[0]; PerkInstance instance2 = item.FixedPerks.PerkInstances[0]; ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[instance2.Type]; text.gameObject.SetActive(true); text.Text.text = MenuHelpers.GetFormattedPerkDescription(instance2.Type, instance2.Modifier, data.DurationSeconds, data.Threshold, 0f, false); } else { this.Perks[0].gameObject.SetActive(false); } int count = this.ItemInstance.Perks.PerkInstances.Count; for (int i = 1; i < this.Perks.Count; i++) { IconWithText text2 = this.Perks[i]; PerkInstance instance3 = null; if ((this.ItemInstance != null) && ((i - 1) < count)) { instance3 = this.ItemInstance.Perks.PerkInstances[i - 1]; } if (instance3 != null) { ConfigPerks.SharedData data2 = ConfigPerks.SHARED_DATA[instance3.Type]; text2.gameObject.SetActive(true); text2.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", data2.SmallSprite); if (this.ItemInstance != null) { text2.Text.text = MenuHelpers.GetFormattedPerkDescription(instance3.Type, instance3.Modifier, data2.DurationSeconds, data2.Threshold, 0f, true); } else { text2.Text.text = "CHANGE ME"; } } else { text2.gameObject.SetActive(false); } } this.PerksTitleDivier.SetActive((num3 + count) > 0); }
protected override void onPreShow([Optional, DefaultParameterValue(null)] object param) { this.m_inputParameters = (InputParameters)param; CharacterInstance activeCharacter = GameLogic.Binder.GameState.Player.ActiveCharacter; GameLogic.Item item = this.getReferenceItem(); switch (item.Type) { case ItemType.Weapon: this.Header.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.ITEMS_WEAPON, null, false)); this.PowerIcon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", "icon_mini_weapon"); this.PowerDescription.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.HEROVIEW_POWER_ATTACK, null, false)); break; case ItemType.Armor: this.Header.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.ITEMS_ARMOR, null, false)); this.PowerIcon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", "icon_mini_armor"); this.PowerDescription.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.HEROVIEW_POWER_DEFENSE, null, false)); break; case ItemType.Cloak: this.Header.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.ITEMS_CLOAK, null, false)); this.PowerIcon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", "icon_mini_spell"); this.PowerDescription.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.HEROVIEW_POWER_SKILLDMG, null, false)); break; default: this.Header.text = "CHANGE ME"; this.PowerIcon.sprite = null; break; } this.Title.text = StringExtensions.ToUpperLoca(item.Name); this.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", item.SpriteId); MenuHelpers.RefreshStarContainer(this.Stars, item.Rarity); if (this.ItemInstance != null) { double num; double num2; if (!this.ItemInstance.InspectedByPlayer) { CmdInspectItem.ExecuteStatic(this.ItemInstance); } App.Binder.ConfigMeta.ItemSellCurve(activeCharacter, this.ItemInstance.Item.Type, this.ItemInstance.Rarity, this.ItemInstance.Level, this.ItemInstance.Rank, out num, out num2); this.SellButton.gameObject.SetActive(true); if (num > 0.0) { this.SellButton.ButtonLabelIcon.sprite = PlayerView.Binder.SpriteResources.getSprite(ConfigUi.RESOURCE_TYPE_SPRITES[ResourceType.Token]); this.SellButton.ButtonLabel.text = MenuHelpers.BigValueToString(num); } else { this.SellButton.ButtonLabelIcon.sprite = PlayerView.Binder.SpriteResources.getSprite(ConfigUi.RESOURCE_TYPE_SPRITES[ResourceType.Coin]); this.SellButton.ButtonLabel.text = MenuHelpers.BigValueToString(num2); } if (!ConfigMeta.CAN_SELL_HIGHEST_RARITY_ITEM && (this.ItemInstance.Rarity == ConfigMeta.ITEM_HIGHEST_RARITY)) { this.SellButton.ButtonHeader.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_VALUE, null, false)); } else { this.SellButton.ButtonHeader.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_SELL, null, false)); } this.EquipButton.gameObject.SetActive(true); this.EquipButtonImage.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", "uix_button_selected"); } else { this.SellButton.gameObject.SetActive(false); this.EquipButton.gameObject.SetActive(false); } this.onRefresh(); }
protected override void onPreShow([Optional, DefaultParameterValue(null)] object param) { ShopEntry shopEntryBySlot = Service.Binder.ShopManager.GetShopEntryBySlot(ShopManager.ValidBundleSlots[0]); this.m_starterBundleSpc = new ShopPurchaseController(shopEntryBySlot, null, PathToShopType.Vendor, null, new Action <ShopEntry, PurchaseResult>(this.onPurchaseComplete)); this.PurchaseButtonText.text = this.m_starterBundleSpc.getPriceText(1); this.CritterName.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.IAP_STARTERBUNDLE_CRITTER_NAME, null, false)); double v = this.m_starterBundleSpc.ShopEntry.BuyResourceAmounts[ResourceType.Token]; this.TokenAmount.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.RESOURCES_TOKENS_MULTILINE, new < > __AnonType9 <string>(MenuHelpers.BigValueToString(v)), false)); double num2 = this.m_starterBundleSpc.ShopEntry.BuyResourceAmounts[ResourceType.Diamond]; this.GemAmount.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.RESOURCES_DIAMONDS_MULTILINE, new < > __AnonType9 <string>(MenuHelpers.BigValueToString(num2)), false)); }
protected override void onPreShow([Optional, DefaultParameterValue(null)] object param) { this.m_inputParameters = (InputParameters)param; if (!string.IsNullOrEmpty(this.m_inputParameters.Headline)) { this.HeaderTitle.text = StringExtensions.ToUpperLoca(this.m_inputParameters.Headline); this.HeaderTitle.enabled = true; } else { this.HeaderTitle.enabled = false; } if (!string.IsNullOrEmpty(this.m_inputParameters.Title)) { this.DividerRoot.SetActive(true); this.DividerTitle.enabled = true; this.DividerTitle.text = StringExtensions.ToUpperLoca(this.m_inputParameters.Title); } else { this.DividerRoot.SetActive(false); this.DividerTitle.enabled = false; } if (!string.IsNullOrEmpty(this.m_inputParameters.Message)) { this.MessageText.enabled = true; this.MessageText.text = this.m_inputParameters.Message; } else { this.MessageText.enabled = false; } if (this.m_inputParameters.CostAmount > 0.0) { this.Button.SetActive(true); this.ButtonIcon.gameObject.SetActive(true); this.ButtonText.text = MenuHelpers.BigValueToString(Math.Round(this.m_inputParameters.CostAmount)); this.SetIconForResource(ref this.ButtonIcon, this.m_inputParameters.CostResourceType); } else if (!string.IsNullOrEmpty(this.m_inputParameters.ButtonText)) { this.Button.SetActive(true); this.ButtonIcon.gameObject.SetActive(false); this.ButtonText.text = this.m_inputParameters.ButtonText; if (this.m_inputParameters.ButtonIcon != null) { Sprite iconForSprite = this.GetIconForSprite(this.m_inputParameters.ButtonIcon); if (iconForSprite != null) { this.ButtonIcon.gameObject.SetActive(true); this.ButtonIcon.sprite = iconForSprite; } } } else { this.Button.SetActive(false); } if (this.m_inputParameters.DisposableBackgroundTexture != null) { this.RawBg.enabled = true; this.RawBg.texture = this.m_inputParameters.DisposableBackgroundTexture; float num = ((float)this.m_inputParameters.DisposableBackgroundTexture.width) / ((float)this.m_inputParameters.DisposableBackgroundTexture.height); float newSize = Mathf.Clamp((float)(this.m_defaultWidth / num), (float)200f, (float)1880f); RectTransformExtensions.SetHeight(base.RectTm, newSize); base.RewardsGrid.gameObject.SetActive(false); } else { this.RawBg.enabled = false; RectTransformExtensions.SetHeight(base.RectTm, this.m_defaultHeight); List <Reward> rewards = Service.Binder.PromotionManager.GetRewards(this.m_inputParameters.Promotion); if ((rewards != null) && (rewards.Count > 0)) { base.RewardsGrid.gameObject.SetActive(true); base.InitRewardGrid(rewards); } else { base.RewardsGrid.gameObject.SetActive(false); } } }
protected override void onPreShow([Optional, DefaultParameterValue(null)] object param) { RewardGalleryCell.Content content4; MiniPopupEntry entry3; MiniPopupMenu contentMenu = (MiniPopupMenu)base.m_contentMenu; this.m_param = param; this.m_shopPurchaseController = null; if (param is PlayerAugmentation) { contentMenu.MainButton.gameObject.SetActive(true); this.DualButtonLeft.gameObject.SetActive(false); this.DualButtonRight.gameObject.SetActive(false); PlayerAugmentation augmentation = (PlayerAugmentation)param; SpriteAtlasEntry sprite = null; string overrideDescriptionTextLocalized = null; string str2 = null; if (augmentation.PerkInstance != null) { ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[augmentation.PerkInstance.Type]; sprite = data.Sprite; overrideDescriptionTextLocalized = _.L(ConfigLoca.MINIPOPUP_AUGMENTATIONS_DESCRIPTION, new < > __AnonType24 <string>(_.L(data.ShortDescription, null, false)), false); str2 = MenuHelpers.BigModifierToString(augmentation.PerkInstance.Modifier, true); } content4 = new RewardGalleryCell.Content(); content4.Sprite = sprite; content4.Text = str2; RewardGalleryCell.Content rewardContent = content4; string overrideButtonText = MenuHelpers.BigValueToString(App.Binder.ConfigMeta.GetAugmentationPrice(augmentation.Id)); SpriteAtlasEntry atlasEntry = ConfigUi.RESOURCE_TYPE_SPRITES[ResourceType.Token]; entry3 = new MiniPopupEntry(); entry3.TitleText = ConfigLoca.MINIPOPUP_AUGMENTATIONS_TITLE; contentMenu.populateLayout(entry3, true, rewardContent, overrideButtonText, PlayerView.Binder.SpriteResources.getSprite(atlasEntry), overrideDescriptionTextLocalized); } else if (param is ShopPurchaseController) { ShopPurchaseController controller = (ShopPurchaseController)param; this.m_shopPurchaseController = new ShopPurchaseController(controller.ShopEntry, controller.ShopEntryInstance, PathToShopType.Vendor, new System.Action(this.onShopClosed), new Action <ShopEntry, PurchaseResult>(this.onShopPurchaseCompleted)); content4 = new RewardGalleryCell.Content(); content4.Sprite = controller.getSprite(); content4.StickerText = controller.getStickerText(); RewardGalleryCell.Content content2 = content4; if (controller.payWithAd()) { contentMenu.MainButton.gameObject.SetActive(true); this.DualButtonLeft.gameObject.SetActive(false); this.DualButtonRight.gameObject.SetActive(false); double v = controller.getAmount(); content2.Text = (v <= 1.0) ? null : ("+" + MenuHelpers.BigValueToString(v)); entry3 = new MiniPopupEntry(); entry3.TitleText = ConfigLoca.MINIPOPUP_ADS_VENDOR_TITLE; contentMenu.populateLayout(entry3, true, content2, StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_WATCH, null, false)), null, _.L(ConfigLoca.MINIPOPUP_SPECIAL_OFFER_DESCRIPTION, null, false)); } else if (controller.getRefShopEntry().Type == ShopEntryType.MegaBoxBundle) { contentMenu.MainButton.gameObject.SetActive(true); this.DualButtonLeft.gameObject.SetActive(false); this.DualButtonRight.gameObject.SetActive(false); double num2 = ConfigShops.CalculateMegaBoxBundleSize(controller.getRefShopEntry().Id); string str4 = null; if (num2 > 1.0) { str4 = _.L(ConfigLoca.MINIPOPUP_MEGABOX_DESCRIPTION_MANY, new < > __AnonType9 <string>(num2.ToString("0")), false); } else { str4 = _.L(ConfigLoca.MINIPOPUP_MEGABOX_DESCRIPTION_SINGLE, null, false); } entry3 = new MiniPopupEntry(); entry3.TitleText = ConfigLoca.MINIPOPUP_MEGABOX_TITLE; contentMenu.populateLayout(entry3, true, content2, controller.getPriceText(1), PlayerView.Binder.SpriteResources.getSprite(controller.getPriceIcon()), str4); } else if (controller.getPurchasesRemaining() > 1) { contentMenu.MainButton.gameObject.SetActive(false); this.DualButtonLeft.gameObject.SetActive(true); this.DualButtonRight.gameObject.SetActive(true); this.DualButtonLeft.CornerText.text = "1x"; this.DualButtonLeft.Text.text = controller.getPriceText(1); this.DualButtonLeft.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite(controller.getPriceIcon()); int numPurchases = controller.getPurchasesRemaining(); this.DualButtonRight.CornerText.text = numPurchases + "x"; this.DualButtonRight.Text.text = controller.getPriceText(numPurchases); this.DualButtonRight.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite(controller.getPriceIcon()); double num4 = controller.getAmount(); content2.Text = (num4 <= 1.0) ? null : ("+" + MenuHelpers.BigValueToString(num4)); entry3 = new MiniPopupEntry(); entry3.TitleText = ConfigLoca.MINIPOPUP_BASIC_VENDOR_TITLE; contentMenu.populateLayout(entry3, false, content2, null, null, _.L(ConfigLoca.MINIPOPUP_BASIC_VENDOR_DESCRIPTION, null, false)); } else { contentMenu.MainButton.gameObject.SetActive(true); this.DualButtonLeft.gameObject.SetActive(false); this.DualButtonRight.gameObject.SetActive(false); double num5 = controller.getAmount(); content2.Text = (num5 <= 1.0) ? null : ("+" + MenuHelpers.BigValueToString(num5)); entry3 = new MiniPopupEntry(); entry3.TitleText = ConfigLoca.MINIPOPUP_BASIC_VENDOR_TITLE; contentMenu.populateLayout(entry3, true, content2, controller.getPriceText(1), PlayerView.Binder.SpriteResources.getSprite(controller.getPriceIcon()), _.L(ConfigLoca.MINIPOPUP_BASIC_VENDOR_DESCRIPTION, null, false)); } } else if (param is TournamentView) { this.m_tournamentView = (TournamentView)param; contentMenu.MainButton.gameObject.SetActive(false); this.DualButtonLeft.gameObject.SetActive(true); this.DualButtonRight.gameObject.SetActive(true); double num6 = this.m_tournamentView.Instance.getDonationPrice(); this.DualButtonLeft.CornerText.text = "1x"; this.DualButtonLeft.Text.text = num6.ToString("0"); this.DualButtonLeft.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite(ConfigUi.RESOURCE_TYPE_SPRITES[ResourceType.Diamond]); int num7 = this.m_tournamentView.Instance.getDonationsRemaining(); this.DualButtonRight.CornerText.text = num7 + "x"; this.DualButtonRight.Text.text = (num7 * num6).ToString("0"); this.DualButtonRight.Icon.sprite = this.DualButtonLeft.Icon.sprite; content4 = new RewardGalleryCell.Content(); content4.Sprite = new SpriteAtlasEntry("Menu", "icon_cardpack_floater"); RewardGalleryCell.Content content3 = content4; entry3 = new MiniPopupEntry(); entry3.TitleText = ConfigLoca.UI_BUTTON_INFO; contentMenu.populateLayout(entry3, false, content3, null, null, _.L(ConfigLoca.ADVPANEL_DONATE_DESCRIPTION, null, false)); } this.onRefresh(); }
public void refresh() { Player player = GameLogic.Binder.GameState.Player; for (int i = 0; i < (this.m_rewardGalleryCells.Count - 1); i++) { Item item = (Item)this.m_rewardGalleryCells[i].ActiveContent.Obj; bool interactable = player.hasEncounteredItem(item.Id); this.m_rewardGalleryCells[i].refresh(false, false, !interactable, interactable); } bool flag2 = player.hasEncounteredChest(this.ChestType); if (flag2) { this.Info.enabled = false; } else { int num2 = -1; if (App.Binder.ConfigMeta.CHEST_UNLOCK_FLOOR.ContainsKey(this.ChestType)) { num2 = App.Binder.ConfigMeta.CHEST_UNLOCK_FLOOR[this.ChestType]; } this.Info.text = _.L(ConfigLoca.CHEST_GALLERY_DROP_FLOOR, new < > __AnonType12 <string>(MenuHelpers.ColoredText(num2.ToString())), false); this.Info.enabled = true; } this.m_rewardGalleryCells[this.m_rewardGalleryCells.Count - 1].refresh(false, false, !flag2, false); }
protected override void onRefresh() { base.m_contentMenu.refreshTitle(StringExtensions.ToUpperLoca(_.L(ConfigLoca.HEROVIEW_STATS_BUTTON_TEXT, null, false)), string.Empty, string.Empty); Player player = GameLogic.Binder.GameState.Player; int num = 0; HeroStats stats = new HeroStats(player.ActiveCharacter.HeroStats); double num2 = 0.0; Reward reward = player.getFirstUnclaimedRetirementTriggerChest(); if (reward != null) { num2 += reward.getTotalTokenAmount(); } stats.TokensEarned += Math.Floor((num2 + player.ActiveCharacter.getTotalEquipmentTokenValue()) * player.getActiveTokenRewardFloorMultiplier()); HeroStats stats2 = new HeroStats(player.CumulativeRetiredHeroStats); stats2.add(player.ActiveCharacter.HeroStats); stats2.HighestFloor = player.CumulativeRetiredHeroStats.HighestFloor; List<string> list = stats.toRichTextFormattedStringList(StringExtensions.ToUpperLoca(_.L(ConfigLoca.HEROSTATS_HEADER_CURRENT, null, false)), false); List<string> list2 = stats2.toRichTextFormattedStringList(StringExtensions.ToUpperLoca(_.L(ConfigLoca.HEROSTATS_HEADER_ALL_TIME, null, false)), true); for (int i = 0; i < HeroStats.STAT_HEADERS.Count; i++) { string self = _.L(HeroStats.STAT_HEADERS[i], null, false); if (i == 0) { self = MenuHelpers.ColoredText(StringExtensions.ToUpperLoca(self)); } this.m_heroStatCells[num].setThreeColumnLayout(self, list[i], list2[i], (num % 2) != 0); num++; } this.m_heroStatCells[num].setEmpty((num % 2) != 0); num++; List<string> list3 = player.ActiveCharacter.offenseAttributesToRichTextFormattedStringList(string.Empty); for (int j = 0; j < CharacterInstance.OFFENSE_STAT_HEADERS.Count; j++) { string str2 = _.L(CharacterInstance.OFFENSE_STAT_HEADERS[j], null, false); if (j == 0) { str2 = MenuHelpers.ColoredText(StringExtensions.ToUpperLoca(str2)); } this.m_heroStatCells[num].setTwoColumnLayout(str2, list3[j], (num % 2) != 0); num++; } this.m_heroStatCells[num].setEmpty((num % 2) != 0); num++; List<string> list4 = player.ActiveCharacter.defenseAttributesToRichTextFormattedStringList(string.Empty); for (int k = 0; k < CharacterInstance.DEFENSE_STAT_HEADERS.Count; k++) { string str3 = _.L(CharacterInstance.DEFENSE_STAT_HEADERS[k], null, false); if (k == 0) { str3 = MenuHelpers.ColoredText(StringExtensions.ToUpperLoca(str3)); } this.m_heroStatCells[num].setTwoColumnLayout(str3, list4[k], (num % 2) != 0); num++; } this.m_heroStatCells[num].setEmpty((num % 2) != 0); num++; List<string> list5 = player.ActiveCharacter.utilityAttributesToRichTextFormattedStringList(string.Empty); for (int m = 0; m < CharacterInstance.UTILITY_STAT_HEADERS.Count; m++) { string str4 = _.L(CharacterInstance.UTILITY_STAT_HEADERS[m], null, false); if (m == 0) { str4 = MenuHelpers.ColoredText(StringExtensions.ToUpperLoca(str4)); } this.m_heroStatCells[num].setTwoColumnLayout(str4, list5[m], (num % 2) != 0); num++; } }
public void refresh(CharacterInstance owner, GameLogic.ItemInstance itemInstance, GameLogic.Item item) { this.ItemInstance = itemInstance; this.Item = item; if (itemInstance != null) { this.Background.gameObject.SetActive(true); if (owner.isItemEquipped(itemInstance.Item)) { this.Background.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", "sprite_ui_itemcard_equipped"); } else { this.Background.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", "sprite_ui_itemcard_active"); } this.Button.interactable = true; this.Icon.gameObject.SetActive(true); this.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", itemInstance.Item.SpriteId); this.Icon.color = Color.white; this.IconBorders.gameObject.SetActive(true); this.IconBorders.enabled = true; this.IconBorders.material = null; if (owner.hasReachedUnlockFloorForItem(itemInstance)) { this.Icon.material = null; } else { this.Icon.material = !ConfigUi.MENU_UNEQUIPPABLE_ITEM_GREYSCALE_ENABLED ? null : this.m_greyscaleMaterial; } this.LevelIcon.gameObject.SetActive(false); this.Level.gameObject.SetActive(false); MenuHelpers.RefreshStarContainer(this.Stars, this.m_originalStarLocalPositions, itemInstance.Rarity, false); this.IndicatorNew.enabled = !itemInstance.InspectedByPlayer; this.IndicatorNewIcon.enabled = !itemInstance.InspectedByPlayer; this.ProgressBar.gameObject.SetActive(true); this.ProgressText.gameObject.SetActive(true); this.ProgressBarFill.color = Color.white; this.ProgressText.text = "Lv 0"; this.ProgressBar.setNormalizedValue(0f); this.ProgressBarFill.sprite = PlayerView.Binder.SpriteResources.getSprite("DungeonHud", "sprite_ui_progressbar_front_gold"); this.UnlockButtonRoot.SetActive(false); this.Name.gameObject.SetActive(true); this.Name.text = StringExtensions.ToUpperLoca(itemInstance.Item.Name); this.Type.text = itemInstance.Item.Type.ToString(); } else if (item != null) { this.Background.gameObject.SetActive(true); this.Background.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", "sprite_ui_itemcard_inactive"); this.Button.interactable = true; this.Icon.gameObject.SetActive(true); this.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", item.SpriteId); this.Icon.material = this.m_greyscaleMaterial; this.Icon.color = Color.white; this.IconBorders.gameObject.SetActive(true); this.IconBorders.enabled = true; this.LevelIcon.gameObject.SetActive(false); this.Level.gameObject.SetActive(false); MenuHelpers.RefreshStarContainer(this.Stars, this.m_originalStarLocalPositions, item.Rarity, false); this.IconBorders.material = this.m_greyscaleMaterial; this.LevelIcon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", ConfigUi.RARITY_ITEM_LEVEL_BACKGROUND_SPRITES[0]); this.IndicatorNew.enabled = false; this.IndicatorNewIcon.enabled = false; int num = owner.getShardCountForItem(item); this.UnlockButtonRoot.SetActive(false); this.ProgressBar.gameObject.SetActive(true); this.ProgressText.gameObject.SetActive(true); this.ProgressBar.setNormalizedValue(Mathf.Clamp01(((float)num) / 1f)); this.ProgressText.text = num + "/" + 1f; this.ProgressBarFill.sprite = PlayerView.Binder.SpriteResources.getSprite("DungeonHud", "sprite_ui_progressbar_front_blue"); this.Name.gameObject.SetActive(true); this.Name.text = StringExtensions.ToUpperLoca(item.Name); this.Type.text = item.Type.ToString(); } else { this.Background.gameObject.SetActive(false); this.Button.interactable = false; this.Icon.gameObject.SetActive(false); this.IconBorders.gameObject.SetActive(false); for (int i = 0; i < 5; i++) { this.Stars[i].enabled = false; } this.LevelIcon.gameObject.SetActive(false); this.Level.gameObject.SetActive(false); this.IndicatorNew.enabled = false; this.IndicatorNewIcon.enabled = false; this.ProgressBar.gameObject.SetActive(false); this.ProgressText.gameObject.SetActive(false); this.UnlockButtonRoot.SetActive(false); this.Name.gameObject.SetActive(false); this.Type.gameObject.SetActive(false); } }