Ejemplo n.º 1
0
        // Token: 0x0600F9FF RID: 63999 RVA: 0x0041CB28 File Offset: 0x0041AD28
        public void OnBuyItemClick()
        {
            int num = this.m_playerContext.CanBuyFixedStoreGoods((int)this.m_storeId, this.m_fixedStoreItemId, this.m_selfChooseIndex);

            if (num == 0)
            {
                FixedStoreBuyStoreItemNetTask fixedStoreBuyStoreItemNetTask = new FixedStoreBuyStoreItemNetTask((int)this.m_storeId, this.m_fixedStoreItemId, this.m_selfChooseIndex);
                fixedStoreBuyStoreItemNetTask.EventOnStop += delegate(Task task)
                {
                    FixedStoreBuyStoreItemNetTask fixedStoreBuyStoreItemNetTask2 = task as FixedStoreBuyStoreItemNetTask;
                    if (fixedStoreBuyStoreItemNetTask2.Result == 0)
                    {
                        ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(this.m_fixedStoreItemId);
                        ConfigDataItemInfo           configDataItemInfo           = this.m_configDataLoader.GetConfigDataItemInfo(configDataFixedStoreItemInfo.ItemId);
                        if (configDataItemInfo != null && (configDataItemInfo.FuncType == ItemFuncType.ItemFuncType_StaticBox || configDataItemInfo.FuncType == ItemFuncType.ItemFuncType_RandomBox))
                        {
                            this.HandleBoxOpenNetTask(GoodsType.GoodsType_Item, configDataFixedStoreItemInfo.ItemId, 1, delegate(List <Goods> goods)
                            {
                                GetRewardGoodsUITask.StartUITask(goods);
                                if (this.EventOnBuySuccess != null)
                                {
                                    this.EventOnBuySuccess();
                                }
                            }, delegate
                            {
                            });
                        }
                        else
                        {
                            List <Goods> storeGoods = this.GetStoreGoods(this.m_fixedStoreItemId, this.m_selfChooseIndex);
                            GetRewardGoodsUITask.StartUITask(storeGoods);
                            if (this.EventOnBuySuccess != null)
                            {
                                this.EventOnBuySuccess();
                            }
                        }
                    }
                    else
                    {
                        CommonUIController.Instance.ShowErrorMessage(fixedStoreBuyStoreItemNetTask2.Result, 2f, null, true);
                    }
                };
                fixedStoreBuyStoreItemNetTask.Start(null);
            }
            else if (num == -500)
            {
                BagFullUITask.StartUITask(this.m_normalItemBuyUITask.CurrentIntent);
            }
            else if (num == -401)
            {
                this.StoreUIController_CrystalNotEnough();
            }
            else
            {
                CommonUIController.Instance.ShowErrorMessage(num, 2f, null, true);
            }
        }
Ejemplo n.º 2
0
        // Token: 0x06013229 RID: 78377 RVA: 0x004E117C File Offset: 0x004DF37C
        private void OnTodaySignBoxClick(GoodsType type, int id, int count)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnTodaySignBoxClickGoodsTypeInt32Int32_hotfix != null)
            {
                this.m_OnTodaySignBoxClickGoodsTypeInt32Int32_hotfix.call(new object[]
                {
                    this,
                    type2,
                    id2,
                    count2
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            GoodsType  type  = type2;
            int        id    = id2;
            int        count = count2;
            SignUITask $this = this;
            int        num   = this.m_playerContext.CanSignToday();

            if (num == 0)
            {
                EverydaySignNetTask everydaySignNetTask = new EverydaySignNetTask();
                everydaySignNetTask.EventOnStop += delegate(Task task)
                {
                    EverydaySignNetTask everydaySignNetTask2 = task as EverydaySignNetTask;
                    if (everydaySignNetTask2.Result == 0)
                    {
                        $this.m_signRewardListUIController.PlaySignAnimation(delegate
                        {
                            $this.m_signRewardListUIController.EnableCloseButton(true);
                            $this.UpdateView();
                            $this.HandleBoxOpenNetTask(type, id, count);
                        });
                    }
                    else
                    {
                        CommonUIController.Instance.ShowErrorMessage(everydaySignNetTask2.Result, 2f, null, true);
                    }
                };
                everydaySignNetTask.Start(null);
            }
            else
            {
                this.m_signRewardListUIController.EnableCloseButton(true);
                if (num == -500)
                {
                    BagFullUITask.StartUITask(this.m_currIntent);
                    this.m_isAutoSign = false;
                }
                else
                {
                    CommonUIController.Instance.ShowErrorMessage(num, 2f, null, true);
                }
            }
        }
Ejemplo n.º 3
0
        // Token: 0x06013228 RID: 78376 RVA: 0x004E10A4 File Offset: 0x004DF2A4
        private void OnTodaySignItemClick()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnTodaySignItemClick_hotfix != null)
            {
                this.m_OnTodaySignItemClick_hotfix.call(new object[]
                {
                    this
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int num = this.m_playerContext.CanSignToday();

            if (num == 0)
            {
                EverydaySignNetTask everydaySignNetTask = new EverydaySignNetTask();
                everydaySignNetTask.EventOnStop += delegate(Task task)
                {
                    EverydaySignNetTask returnTask = task as EverydaySignNetTask;
                    if (returnTask.Result == 0)
                    {
                        if (returnTask.Rewards != null && returnTask.Rewards.Count != 0)
                        {
                            this.m_signRewardListUIController.PlaySignAnimation(delegate
                            {
                                this.m_signRewardListUIController.EnableCloseButton(true);
                                GetRewardGoodsUITask.StartUITask(returnTask.Rewards);
                                this.UpdateView();
                            });
                        }
                    }
                    else
                    {
                        CommonUIController.Instance.ShowErrorMessage(returnTask.Result, 2f, null, true);
                    }
                };
                everydaySignNetTask.Start(null);
            }
            else
            {
                this.m_signRewardListUIController.EnableCloseButton(true);
                if (num == -500)
                {
                    BagFullUITask.StartUITask(this.m_currIntent);
                    this.m_isAutoSign = false;
                }
                else
                {
                    CommonUIController.Instance.ShowErrorMessage(num, 2f, null, true);
                }
            }
        }
Ejemplo n.º 4
0
        // Token: 0x060120CE RID: 73934 RVA: 0x004A7DAC File Offset: 0x004A5FAC
        private void MissionUIController_OnGetReward(int missionId, Action OnSucceed)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_MissionUIController_OnGetRewardInt32Action_hotfix != null)
            {
                this.m_MissionUIController_OnGetRewardInt32Action_hotfix.call(new object[]
                {
                    this,
                    missionId,
                    OnSucceed2
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            Action                OnSucceed             = OnSucceed2;
            MissionUITask         $this                 = this;
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
            int num = projectLPlayerContext.CanGainMissionReward(missionId);

            if (num == 0)
            {
                MissionRewardGetNetTask missionRewardGetNetTask = new MissionRewardGetNetTask(missionId);
                missionRewardGetNetTask.EventOnStop += delegate(Task task)
                {
                    $this.UpdateView();
                    MissionRewardGetNetTask missionRewardGetNetTask2 = task as MissionRewardGetNetTask;
                    if (missionRewardGetNetTask2.Result == 0)
                    {
                        OnSucceed();
                    }
                    else if (missionRewardGetNetTask2.Result == -500)
                    {
                        BagFullUITask.StartUITask($this.m_currIntent);
                    }
                    else
                    {
                        CommonUIController.Instance.ShowErrorMessage(missionRewardGetNetTask2.Result, 2f, null, true);
                    }
                };
                missionRewardGetNetTask.Start(null);
            }
            else if (num == -500)
            {
                BagFullUITask.StartUITask(this.m_currIntent);
            }
            else
            {
                this.UpdateView();
                CommonUIController.Instance.ShowErrorMessage(num, 2f, null, true);
            }
        }
Ejemplo n.º 5
0
 // Token: 0x0600A2C3 RID: 41667 RVA: 0x002DE1E0 File Offset: 0x002DC3E0
 public LuaExportHelper(BagFullUITask owner)
 {
     this.m_owner = owner;
 }
        // Token: 0x060136DF RID: 79583 RVA: 0x004F3E4C File Offset: 0x004F204C
        public void OnBuyButtonClick()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnBuyButtonClick_hotfix != null)
            {
                this.m_OnBuyButtonClick_hotfix.call(new object[]
                {
                    this
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (this.m_startFormType == StoreSoldierSkinDetailUITask.StartTaskFromType.StartTaskFromGift)
            {
                return;
            }
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
            IConfigDataLoader     configDataLoader      = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;

            if (projectLPlayerContext.HasOwn(GoodsType.GoodsType_SoldierSkin, this.m_soldierSkinConfigId))
            {
                return;
            }
            ConfigDataSoldierSkinInfo configDataSoldierSkinInfo = configDataLoader.GetConfigDataSoldierSkinInfo(this.m_soldierSkinConfigId);
            int num = projectLPlayerContext.CanBuyFixedStoreGoods(6, configDataSoldierSkinInfo.FixedStoreItemId, -1);

            if (num == 0)
            {
                FixedStoreBuyStoreItemNetTask fixedStoreBuyStoreItemNetTask = new FixedStoreBuyStoreItemNetTask(6, configDataSoldierSkinInfo.FixedStoreItemId, -1);
                fixedStoreBuyStoreItemNetTask.EventOnStop += delegate(Task task)
                {
                    FixedStoreBuyStoreItemNetTask fixedStoreBuyStoreItemNetTask2 = task as FixedStoreBuyStoreItemNetTask;
                    if (fixedStoreBuyStoreItemNetTask2.Result == 0)
                    {
                        this.m_soldierSkinDetailPanelCtrl.SetBuyButtonToHasBuyMode();
                        List <Goods> list = new List <Goods>();
                        Goods        item = new Goods
                        {
                            GoodsType = GoodsType.GoodsType_SoldierSkin,
                            Id        = this.m_soldierSkinConfigId,
                            Count     = 1
                        };
                        list.Add(item);
                        GetRewardGoodsUITask.StartUITask(list);
                        if (this.EventOnBuySuccessEnd != null)
                        {
                            this.EventOnBuySuccessEnd();
                        }
                    }
                    else
                    {
                        CommonUIController.Instance.ShowErrorMessage(fixedStoreBuyStoreItemNetTask2.Result, 2f, null, true);
                    }
                };
                fixedStoreBuyStoreItemNetTask.Start(null);
            }
            else if (num == -500)
            {
                BagFullUITask.StartUITask(this.m_currIntent);
            }
            else if (num == -416)
            {
                CommonUIController.Instance.ShowDialogBox(StringTableId.StringTableId_Msg_SkinTicketNotEnough, delegate(DialogBoxResult dialogResult)
                {
                    if (dialogResult == DialogBoxResult.Ok)
                    {
                        base.Pause();
                        UIIntentReturnable uiintentReturnable = this.m_currIntent as UIIntentReturnable;
                        if (uiintentReturnable != null && SystemUtility.IsLowSystemMemory())
                        {
                            while (uiintentReturnable.TargetTaskName != typeof(HeroListUITask).Name)
                            {
                                uiintentReturnable = (uiintentReturnable.PrevTaskIntent as UIIntentReturnable);
                                if (uiintentReturnable == null)
                                {
                                    uiintentReturnable = (this.m_currIntent as UIIntentReturnable);
                                    break;
                                }
                            }
                        }
                        StoreUITask.SpecialStartStoreUITask(uiintentReturnable, StoreId.StoreId_Gift);
                    }
                }, (StringTableId)0, (StringTableId)0);
            }
            else
            {
                CommonUIController.Instance.ShowErrorMessage(num, 2f, null, true);
            }
        }