示例#1
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;
            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);
        }