示例#1
0
        // Token: 0x0600DE51 RID: 56913 RVA: 0x003C13FC File Offset: 0x003BF5FC
        public void InitTrainingSkillEvolutionMaterial(GoodsType goodsType, int goodsId, int needCount)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitTrainingSkillEvolutionMaterialGoodsTypeInt32Int32_hotfix != null)
            {
                this.m_InitTrainingSkillEvolutionMaterialGoodsTypeInt32Int32_hotfix.call(new object[]
                {
                    this,
                    goodsType,
                    goodsId,
                    needCount
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            this.m_goodsType = goodsType;
            this.m_goodsId   = goodsId;
            this.m_needCount = needCount;
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
            int bagItemCountByType = projectLPlayerContext.GetBagItemCountByType(this.m_goodsType, this.m_goodsId);

            this.m_materialHaveCount.text = bagItemCountByType.ToString();
            this.m_materialNeedCount.text = needCount.ToString();
            if (bagItemCountByType >= needCount)
            {
                this.m_materialCountStateCtrl.SetToUIState("Normal", false, true);
            }
            else
            {
                this.m_materialCountStateCtrl.SetToUIState("Red", false, true);
            }
            this.m_materialIconImage.sprite   = AssetUtility.Instance.GetSprite(UIUtility.GetGoodsIconName(this.m_goodsType, this.m_goodsId));
            this.m_materialIconImage.material = AssetUtility.Instance.GetAsset <Material>(UIUtility.GetGoodsIconMaterialName(this.m_goodsType, this.m_goodsId));
            this.m_materialFrameImage.sprite  = AssetUtility.Instance.GetSprite(UIUtility.GetGoodsFrameName(this.m_goodsType, this.m_goodsId));
        }
示例#2
0
        // Token: 0x0601086C RID: 67692 RVA: 0x0044C744 File Offset: 0x0044A944
        public void InitJobMaterial(Goods jobMaterialGood)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitJobMaterialGoods_hotfix != null)
            {
                this.m_InitJobMaterialGoods_hotfix.call(new object[]
                {
                    this,
                    jobMaterialGood
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            IConfigDataLoader     configDataLoader      = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;

            this.JobMaterialInfo      = configDataLoader.GetConfigDataJobMaterialInfo(jobMaterialGood.Id);
            this.m_iconImg.sprite     = AssetUtility.Instance.GetSprite(this.JobMaterialInfo.Icon);
            this.m_bgImg.sprite       = AssetUtility.Instance.GetSprite(UIUtility.GetGoodsFrameName(jobMaterialGood.GoodsType, jobMaterialGood.Id));
            this.NeedCount            = jobMaterialGood.Count;
            this.HaveCount            = projectLPlayerContext.GetBagItemCountByType(jobMaterialGood.GoodsType, jobMaterialGood.Id);
            this.m_needCountText.text = this.NeedCount.ToString();
            this.m_haveCountText.text = this.HaveCount.ToString();
            CommonUIStateController component = base.gameObject.GetComponent <CommonUIStateController>();

            if (this.NeedCount > this.HaveCount)
            {
                component.SetToUIState("TextRed", false, true);
            }
            else
            {
                component.SetToUIState("TextWhite", false, true);
            }
        }
        // Token: 0x0600FF4B RID: 65355 RVA: 0x0042FDF0 File Offset: 0x0042DFF0
        public void InitEquipmentBreakNeedItem(Goods goods)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitEquipmentBreakNeedItemGoods_hotfix != null)
            {
                this.m_InitEquipmentBreakNeedItemGoods_hotfix.call(new object[]
                {
                    this,
                    goods
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            CommonUIStateController component = base.gameObject.GetComponent <CommonUIStateController>();

            if (goods == null || goods.GoodsType != GoodsType.GoodsType_Item)
            {
                component.SetToUIState("NotHave", false, true);
                this.m_iconSSREffect.SetActive(false);
                this.m_goods = null;
                return;
            }
            component.SetToUIState("Have", false, true);
            this.m_goods = goods;
            IConfigDataLoader     configDataLoader      = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
            ConfigDataItemInfo    configDataItemInfo    = configDataLoader.GetConfigDataItemInfo(goods.Id);

            this.m_icon.sprite   = AssetUtility.Instance.GetSprite(configDataItemInfo.Icon);
            this.m_iconBg.sprite = AssetUtility.Instance.GetSprite(UIUtility.GetGoodsFrameNameByRank(configDataItemInfo.Rank));
            this.m_iconSSREffect.SetActive(UIUtility.IsRankSSR(configDataItemInfo.Rank));
            int bagItemCountByType = projectLPlayerContext.GetBagItemCountByType(goods.GoodsType, goods.Id);

            this.m_haveCount.text = bagItemCountByType.ToString();
            this.m_needCount.text = goods.Count.ToString();
            if (bagItemCountByType < goods.Count)
            {
                this.m_countStateCtrl.SetToUIState("Red", false, true);
            }
            else
            {
                this.m_countStateCtrl.SetToUIState("White", false, true);
            }
        }
示例#4
0
        // Token: 0x06010D9F RID: 69023 RVA: 0x0045D860 File Offset: 0x0045BA60
        public void InitConditionItem(ConfigDataJobUnlockConditionInfo condition, HeroJob heroJob)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitConditionItemConfigDataJobUnlockConditionInfoHeroJob_hotfix != null)
            {
                this.m_InitConditionItemConfigDataJobUnlockConditionInfoHeroJob_hotfix.call(new object[]
                {
                    this,
                    condition,
                    heroJob
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            this.ConditionInfo             = condition;
            this.m_text.text = condition.Desc;
            bool active = true;
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;

            if (condition.ID != 0)
            {
                active = (heroJob != null && heroJob.Achievements.Contains(condition.ID));
            }
            else if (condition.ItemCost.Count != 0)
            {
                foreach (Goods goods in condition.ItemCost)
                {
                    int bagItemCountByType = projectLPlayerContext.GetBagItemCountByType(GoodsType.GoodsType_Item, goods.Id);
                    if (bagItemCountByType < goods.Count)
                    {
                        active = false;
                        break;
                    }
                }
            }
            this.m_finishTag.SetActive(active);
        }
示例#5
0
        // Token: 0x06014CAB RID: 85163 RVA: 0x005462B8 File Offset: 0x005444B8
        protected override void UpdateView()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_UpdateView_hotfix != null)
            {
                this.m_UpdateView_hotfix.call(new object[]
                {
                    this
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (base.IsOpeningUI())
            {
                this.m_buyEnergyUIController.Open();
            }
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
            IConfigDataLoader     configDataLoader      = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
            int num = configDataLoader.GetAllConfigDataBuyEnergyInfo().Count <KeyValuePair <int, ConfigDataBuyEnergyInfo> >();
            ConfigDataBuyEnergyInfo configDataBuyEnergyInfo;

            if (projectLPlayerContext.GetBuyEnergyNums() + 1 >= num)
            {
                configDataBuyEnergyInfo = configDataLoader.GetConfigDataBuyEnergyInfo(num);
            }
            else
            {
                configDataBuyEnergyInfo = configDataLoader.GetConfigDataBuyEnergyInfo(projectLPlayerContext.GetBuyEnergyNums() + 1);
            }
            if (configDataBuyEnergyInfo != null)
            {
                int energyCount = configDataLoader.UtilityGetConfigableConst(ConfigableConstId.ConfigableConstId_BuyEnergyCount);
                int num2        = projectLPlayerContext.CanBuyEnergy();
                this.m_buyEnergyUIController.SetEnergy(energyCount, configDataBuyEnergyInfo.Price, num2 == -414);
            }
            else
            {
                this.m_buyEnergyUIController.SetEnergy(0, 0, false);
            }
            ConfigDataItemInfo configDataItemInfo = null;

            foreach (KeyValuePair <int, ConfigDataItemInfo> keyValuePair in configDataLoader.GetAllConfigDataItemInfo())
            {
                if (keyValuePair.Value.FuncType == ItemFuncType.ItemFuncType_Energy)
                {
                    configDataItemInfo = keyValuePair.Value;
                    break;
                }
            }
            if (configDataItemInfo != null)
            {
                this.m_getEnergyByUseEnergyMedicine = configDataItemInfo.FuncTypeParam1;
                int bagItemCountByType = projectLPlayerContext.GetBagItemCountByType(GoodsType.GoodsType_Item, configDataItemInfo.ID);
                if (bagItemCountByType > 0)
                {
                    this.m_energyMedicineItemID = configDataItemInfo.ID;
                    this.m_buyEnergyUIController.SetMedicine(this.m_getEnergyByUseEnergyMedicine, 1, bagItemCountByType);
                }
                else
                {
                    this.m_buyEnergyUIController.SetMedicine(this.m_getEnergyByUseEnergyMedicine, 1, 0);
                }
            }
            else
            {
                this.m_buyEnergyUIController.SetMedicine(0, 1, 0);
            }
            UIIntentCustom uiintentCustom = this.m_currIntent as UIIntentCustom;
            object         obj;

            if (uiintentCustom != null && uiintentCustom.TryGetParam("NeedShowEnergyNotEnoughTips", out obj) && obj != null && (bool)obj)
            {
                string s = (configDataLoader as ClientConfigDataLoader).UtilityGetErrorCodeString(-402);
                this.m_buyEnergyUIController.ShowEnergyNotEnoughTip(s);
                uiintentCustom.SetParam("NeedShowEnergyNotEnoughTips", null);
            }
        }