Ejemplo n.º 1
0
        // Token: 0x0600FF8B RID: 65419 RVA: 0x00430B3C File Offset: 0x0042ED3C
        private void InitDataFromUIIntent(UIIntent intent)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitDataFromUIIntentUIIntent_hotfix != null)
            {
                this.m_InitDataFromUIIntentUIIntent_hotfix.call(new object[]
                {
                    this,
                    intent
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            UIIntentCustom uiintentCustom = intent as UIIntentCustom;

            if (uiintentCustom != null && this.m_hero == null)
            {
                object obj  = 0;
                object obj2 = 0;
                uiintentCustom.TryGetParam("slot", out obj);
                uiintentCustom.TryGetParam("id", out obj2);
                object obj3;
                uiintentCustom.TryGetParam("state", out obj3);
                this.m_forgeState = (EquipmentForgeUIController.ForgeState)obj3;
                this.m_slot       = (int)obj;
                this.m_instanceId = (ulong)obj2;
            }
        }
Ejemplo n.º 2
0
        // Token: 0x0600FBB4 RID: 64436 RVA: 0x00422D74 File Offset: 0x00420F74
        private void InitDataFromUIIntent(UIIntent intent)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitDataFromUIIntentUIIntent_hotfix != null)
            {
                this.m_InitDataFromUIIntentUIIntent_hotfix.call(new object[]
                {
                    this,
                    intent
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            UIIntentCustom uiintentCustom = intent as UIIntentCustom;

            if (uiintentCustom != null && this.m_hero == null)
            {
                object obj  = 0;
                object obj2 = 0;
                object obj3 = 0;
                uiintentCustom.TryGetParam("slot", out obj2);
                uiintentCustom.TryGetParam("id", out obj3);
                Hero classParam = uiintentCustom.GetClassParam <Hero>("hero");
                if (this.m_hero != classParam)
                {
                    this.m_hero = classParam;
                }
                this.m_state      = (int)obj;
                this.m_slot       = (int)obj2;
                this.m_instanceId = (ulong)obj3;
            }
        }
    public static int TryGetParam(IntPtr l)
    {
        int result;

        try
        {
            UIIntentCustom uiintentCustom = (UIIntentCustom)LuaObject.checkSelf(l);
            string         key;
            LuaObject.checkType(l, 2, out key);
            object o;
            bool   b = uiintentCustom.TryGetParam(key, out o);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, b);
            LuaObject.pushValue(l, o);
            result = 3;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Ejemplo n.º 4
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);
            }
        }