private void OnCloseConfirmShop(int selectButtonIndex)
 {
     if (selectButtonIndex == 0)
     {
         this.shopBeforeStoneNum = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo.point;
         CMD_Shop cmd = GUIMain.ShowCommonDialog(null, "CMD_Shop", null) as CMD_Shop;
         cmd.PartsTitle.SetReturnAct(delegate(int _i_)
         {
             cmd.SetCloseAction(delegate(int x)
             {
                 this.EndShop(0);
             });
             cmd.ClosePanel(true);
         });
         cmd.PartsTitle.DisableReturnBtn(false);
         cmd.PartsTitle.SetCloseAct(delegate(int _i_)
         {
             GameObject dialog = GUIManager.GetDialog("CMD_BattleNextChoice");
             if (dialog != null)
             {
                 CMD_BattleNextChoice component = dialog.GetComponent <CMD_BattleNextChoice>();
                 component.ClosePanel(false);
             }
             cmd.SetCloseAction(delegate(int x)
             {
                 CMD_BattleNextChoice.GoToFarm();
             });
             cmd.ClosePanel(true);
         });
     }
 }
    private void OnPushedAgainCallBack()
    {
        ClassSingleton <PlayLimit> .Instance.ClearTicketNumCont();

        ClassSingleton <PlayLimit> .Instance.ClearPlayLimitNumCont();

        GameWebAPI.WD_Req_DngStart last_dng_req = DataMng.Instance().GetResultUtilData().last_dng_req;
        GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM[] worldDungeonM = MasterDataMng.Instance().RespDataMA_WorldDungeonM.worldDungeonM;
        int dungeonID = int.Parse(last_dng_req.dungeonId);

        GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM masterDungeon = worldDungeonM.SingleOrDefault((GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM x) => x.worldDungeonId == dungeonID.ToString());
        GameWebAPI.RespDataMA_GetWorldStageM.WorldStageM[]   worldStageM   = MasterDataMng.Instance().RespDataMA_WorldStageM.worldStageM;
        GameWebAPI.RespDataMA_GetWorldStageM.WorldStageM     worldStageM2  = worldStageM.SingleOrDefault((GameWebAPI.RespDataMA_GetWorldStageM.WorldStageM x) => x.worldStageId == masterDungeon.worldStageId);
        if (QuestData.IsTicketQuest(worldStageM2.worldAreaId))
        {
            if (this.isMulti && "-1" == last_dng_req.userDungeonTicketId)
            {
                CMD_ModalMessage cmd_ModalMessage = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage;
                cmd_ModalMessage.Title = StringMaster.GetString("TicketQuestTitle");
                cmd_ModalMessage.Info  = StringMaster.GetString("MultiParticipateAgainAlert");
                return;
            }
            GameWebAPI.RespDataWD_GetDungeonInfo.Dungeons dng = ClassSingleton <QuestData> .Instance.GetTicketQuestDungeonByTicketID(last_dng_req.userDungeonTicketId);

            int num = int.Parse(dng.dungeonTicketNum);
            if (0 >= num)
            {
                CMD_ModalMessage cmd_ModalMessage2 = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage;
                cmd_ModalMessage2.Title = StringMaster.GetString("TicketQuestTitle");
                cmd_ModalMessage2.Info  = StringMaster.GetString("QuestPlayLimitZeroInfo");
            }
            else
            {
                CMD_Confirm cmd_Confirm = GUIMain.ShowCommonDialog(delegate(int idx)
                {
                    if (idx == 0)
                    {
                        ClassSingleton <PlayLimit> .Instance.SetTicketNumCont(dng, ConstValue.PLAYLIMIT_USE_COUNT);
                        if (this.isMulti)
                        {
                            this.RequestDungeonStart();
                        }
                        else
                        {
                            NextChoiceReplay nextChoiceReplay2 = new NextChoiceReplay(new Action(this.RequestDungeonStart));
                            nextChoiceReplay2.Start();
                        }
                    }
                }, "CMD_Confirm", null) as CMD_Confirm;
                cmd_Confirm.Title      = StringMaster.GetString("TicketQuestTitle");
                cmd_Confirm.Info       = string.Format(StringMaster.GetString("TicketQuestConfirmInfo"), worldStageM2.name, num, num - 1);
                cmd_Confirm.BtnTextYes = StringMaster.GetString("SystemButtonYes");
                cmd_Confirm.BtnTextNo  = StringMaster.GetString("SystemButtonClose");
            }
        }
        else
        {
            GameWebAPI.RespDataWD_GetDungeonInfo dngeonInfoByWorldAreaId = ClassSingleton <QuestData> .Instance.GetDngeonInfoByWorldAreaId(worldStageM2.worldAreaId);

            List <QuestData.WorldDungeonData> wdd = ClassSingleton <QuestData> .Instance.GetWorldDungeonData_ByAreaIdStageId(worldStageM2.worldAreaId, masterDungeon.worldStageId, dngeonInfoByWorldAreaId, 0, false, true);

            if (wdd == null)
            {
                CMD_ModalMessage cmd_ModalMessage3 = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage;
                cmd_ModalMessage3.Title = StringMaster.GetString("MultiAgainAlertYetClearTitle");
                cmd_ModalMessage3.Info  = StringMaster.GetString("MultiAgainAlertYetClearInfo");
                return;
            }
            int worldDungeonDataIndex = 0;
            for (int i = 0; i < wdd.Count; i++)
            {
                if (wdd[i].dungeon.worldDungeonId.ToString() == masterDungeon.worldDungeonId)
                {
                    worldDungeonDataIndex = i;
                    break;
                }
            }
            if (worldDungeonDataIndex < wdd.Count)
            {
                int usedCT = ConstValue.PLAYLIMIT_USE_COUNT;
                if (this.isMulti && "-1" == last_dng_req.userDungeonTicketId)
                {
                    usedCT = 0;
                }
                bool flag = ClassSingleton <QuestData> .Instance.IsEmptyDng(wdd[worldDungeonDataIndex].dungeon, worldStageM2.worldAreaId);

                if (flag)
                {
                    CMD_ModalMessage cmd_ModalMessage4 = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage;
                    cmd_ModalMessage4.Title = StringMaster.GetString("QuestPlayLimitTitle");
                    cmd_ModalMessage4.Info  = StringMaster.GetString("QuestPlayLimitZeroInfo");
                    return;
                }
                if (!ClassSingleton <PlayLimit> .Instance.PlayLimitCheck(wdd[worldDungeonDataIndex].dungeon, delegate(int idx)
                {
                    if (idx == 0)
                    {
                        if (wdd[worldDungeonDataIndex].dungeon.playLimit.recoveryAssetCategoryId == 2)
                        {
                            CMD_Shop cmd = GUIMain.ShowCommonDialog(delegate(int _idx)
                            {
                            }, "CMD_Shop", null) as CMD_Shop;
                            cmd.PartsTitle.SetReturnAct(delegate(int _i_)
                            {
                                cmd.ClosePanel(true);
                            });
                            cmd.PartsTitle.DisableReturnBtn(false);
                            cmd.PartsTitle.SetCloseAct(delegate(int _i_)
                            {
                                this.< ClosePanel > __BaseCallProxy0(false);
                                cmd.SetCloseAction(delegate(int x)
                                {
                                    CMD_BattleNextChoice.GoToFarm();
                                });
                                cmd.ClosePanel(true);
                            });
                        }
                        else if (wdd[worldDungeonDataIndex].dungeon.playLimit.recoveryAssetCategoryId == 6)
                        {
                            GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(wdd[worldDungeonDataIndex].dungeon.playLimit.recoveryAssetValue.ToString());
                            CMD_ModalMessage cmd_ModalMessage6 = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage;
                            cmd_ModalMessage6.Title = string.Format(StringMaster.GetString("SystemShortage"), itemM.name);
                            cmd_ModalMessage6.Info = string.Format(StringMaster.GetString("QuestPlayLimitItemShortInfo"), itemM.name);
                        }
                    }
                }, delegate(int _idx)
                {
                    ClassSingleton <PlayLimit> .Instance.RecoverPlayLimit(wdd[worldDungeonDataIndex].dungeon, new Action <GameWebAPI.RespDataWD_GetDungeonInfo.Dungeons>(this.OnSuccessedRecoverPlayLimit));
                }, usedCT))
                {
                    return;
                }
                if (this.isMulti)
                {
                    this.RequestDungeonStart();
                }
                else
                {
                    NextChoiceReplay nextChoiceReplay = new NextChoiceReplay(new Action(this.RequestDungeonStart));
                    nextChoiceReplay.Start();
                }
            }
            else
            {
                CMD_ModalMessage cmd_ModalMessage5 = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage;
                cmd_ModalMessage5.Title = StringMaster.GetString("MultiAgainAlertYetClearTitle");
                cmd_ModalMessage5.Info  = StringMaster.GetString("MultiAgainAlertYetClearInfo");
            }
        }
    }