Пример #1
0
        public void Refresh(bool is_quest, FlowNode_HealApWindow heal_ap_window)
        {
            this.mHealItemList = MonoSingleton <GameManager> .Instance.Player.Items.Where <ItemData>((Func <ItemData, bool>)(x => x.ItemType == EItemType.ApHeal)).ToList <ItemData>();

            for (int index = 0; index < this.mHealItemList.Count; ++index)
            {
                if (this.mHealItemList[index].Num > 0)
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.mItemBase);
                    ((ListItemEvents)gameObject.GetComponent <ListItemEvents>()).OnSelect = new ListItemEvents.ListItemEvent(this.OnSelect);
                    DataSource.Bind <ItemData>(gameObject, this.mHealItemList[index]);
                    gameObject.get_transform().SetParent(this.mItemParent.get_transform(), false);
                }
            }
            this.mItemBase.SetActive(false);
            if (is_quest && !string.IsNullOrEmpty(GlobalVars.SelectedQuestID))
            {
                this.mQuestParam = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);
            }
            this.QuestInfo.SetActive(this.mQuestParam != null);
            this.silder.set_maxValue((float)MonoSingleton <GameManager> .Instance.Player.StaminaStockCap);
            this.silder.set_minValue(0.0f);
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            this.silder.set_value((float)player.Stamina);
            this.now_ap.set_text(player.Stamina.ToString());
            this.max_ap.set_text(player.StaminaStockCap.ToString());
            if (this.mQuestParam != null)
            {
                PartyWindow2 componentInChildren = (PartyWindow2)((Component)heal_ap_window).get_gameObject().GetComponentInChildren <PartyWindow2>();
                int          num = this.mQuestParam.RequiredApWithPlayerLv(player.Lv, true);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren.RaidSettings, (UnityEngine.Object)null) && componentInChildren.MultiRaidNum > 0)
                {
                    num *= componentInChildren.MultiRaidNum;
                }
                this.LackAp.set_text(LocalizedText.Get("sys.TEXT_APHEAL_LACK_POINT", new object[1]
                {
                    (object)(num - player.Stamina)
                }));
            }
            this.heal_coin_text.set_text(LocalizedText.Get("sys.SKIPBATTLE_HEAL_NUM", new object[1]
            {
                (object)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.StaminaAdd.ToString()
            }));
            this.heal_coin_num.set_text(player.GetStaminaRecoveryCost(false).ToString());
            if (player.StaminaStockCap <= player.Stamina)
            {
                UIUtility.SystemMessage((string)null, LocalizedText.Get("sys.STAMINAFULL"), (UIUtility.DialogResultEvent)(go => FlowNode_GameObject.ActivateOutputLinks((Component)this, 2)), (GameObject)null, false, -1);
            }
            this.pre_ap.set_text(player.Stamina.ToString());
        }
Пример #2
0
        public void Refresh(bool is_quest, FlowNode_HealApWindow heal_ap_window)
        {
            PartyWindow2 componentInChildren = (PartyWindow2)((Component)heal_ap_window).get_gameObject().GetComponentInChildren <PartyWindow2>();

            this.Refresh(is_quest, componentInChildren);
        }