using System; using System.Collections.Generic; using KKSG; using UILib; using UnityEngine; using XMainClient.UI.UICommon; using XUtliPoolLib; namespace XMainClient.UI { internal class DungeonSelect : DlgBase { private bool _bLevelIsMoving { get { return this.m_bLevelIsMoving; } set { bool flag = base.uiBehaviour.m_hardBox != null; if (flag) { base.uiBehaviour.m_hardBox.enabled = !value; } bool flag2 = base.uiBehaviour.m_normalBox != null; if (flag2) { base.uiBehaviour.m_normalBox.enabled = !value; } this.m_bLevelIsMoving = value; } } public string EffectPath { get { bool flag = string.IsNullOrEmpty(this.m_effectPath); if (flag) { this.m_effectPath = XSingleton.singleton.GetValue("DungeonSelectRoleEffectPath"); } return this.m_effectPath; } } public string EffectPath1 { get { bool flag = string.IsNullOrEmpty(this.m_effectPath1); if (flag) { this.m_effectPath1 = XSingleton.singleton.GetValue("DungeonSelectRoleEffectPath1"); } return this.m_effectPath1; } } public override string fileName { get { return "Hall/DungeonSelect"; } } public override int layer { get { return 1; } } public override bool pushstack { get { return true; } } public override bool autoload { get { return true; } } public override bool fullscreenui { get { return true; } } public override bool hideMainMenu { get { return true; } } private bool _isShowBossAvatar = true; private int _HardModeNeedLevel = 0; private uint _SelectDifficult = 0u; private int _SelectedChapter = 0; private uint _SelectScene = 0u; private bool _bAutoSelect = false; private bool _bAutoSelectChapterId = true; private GameObject _MainFrame; private GameObject _LeftFrame; private GameObject _RightFrame; private bool m_bLevelIsMoving = false; private int _ChapterRank; private int _ChapterTotalRank; private const float LEVEL_FRAME_OFFSET = 1136f; private uint _FirstNoRankScene = 0u; private Dictionary SceneDic = new Dictionary(); private uint _SceneRemainTime = 9999u; public bool IsTaskMode = false; private float m_fSweepBtnCoolTime = 0.5f; private float m_fGoBattleCoolTime = 5f; private float m_fLastClickBtnTime = 0f; private DungeonSelect.FrameCache main; private DungeonSelect.FrameCache left; private DungeonSelect.FrameCache right; private XDummy bossDummy = null; private XWelfareDocument _welfareDoc; private GameObject m_goLevelUpGo; private XFx m_fx; private XFx m_fx1; private string m_effectPath = string.Empty; private string m_effectPath1 = string.Empty; private struct FrameCache { public IUIDummy snapShot; public GameObject fx; public void Clear() { this.snapShot = null; this.fx = null; } public void Copy(ref DungeonSelect.FrameCache fc) { this.snapShot = fc.snapShot; bool flag = this.fx != null; if (flag) { this.fx.SetActive(false); } this.fx = fc.fx; } } protected override void Init() { XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; this._welfareDoc = XDocuments.GetSpecificDocument(XWelfareDocument.uuID); bool flag = this._SelectedChapter == 0; if (flag) { this._SelectedChapter = XSingleton.singleton.GetPlayerLastChapter(this._SelectDifficult); } OpenSystemTable.RowData sysData = XSingleton.singleton.GetSysData(XSysDefineMgr.GetTypeInt(XSysDefine.XSys_Level_Elite)); bool flag2 = sysData != null; if (flag2) { this._HardModeNeedLevel = sysData.PlayerLevel; } else { this._HardModeNeedLevel = 1; XSingleton.singleton.AddErrorLog("_sysData is nill", null, null, null, null, null); } } public GameObject GetGoLevelUpInfo() { return this.m_goLevelUpGo; } public void FadeShow() { bool flag = !base.IsVisible(); if (flag) { XAutoFade.FadeOut2In(0.5f, 0.5f); XSingleton.singleton.SetTimer(0.484f, new XTimerMgr.ElapsedEventHandler(this.InnerShow), null); } } private void InnerShow(object o) { this.SetVisible(true, true); XTaskDocument specificDocument = XDocuments.GetSpecificDocument(XTaskDocument.uuID); specificDocument.ResetNavi(); } protected override void OnShow() { base.OnShow(); base.uiBehaviour.m_SceneDetail.SetActive(false); base.Alloc3DAvatarPool("DungeonSelect"); XMainInterfaceDocument specificDocument = XDocuments.GetSpecificDocument(XMainInterfaceDocument.uuID); specificDocument.OnTopUIRefreshed(this); XTaskDocument specificDocument2 = XDocuments.GetSpecificDocument(XTaskDocument.uuID); bool isTaskMode = this.IsTaskMode; if (isTaskMode) { int naviScene = (int)specificDocument2.NaviScene; bool flag = naviScene != 0; if (flag) { this.SetAutoSelectScene(naviScene, 0, 0u); this._bAutoSelect = false; this._bAutoSelectChapterId = true; } this.IsTaskMode = false; } bool flag2 = DlgBase.singleton.IsVisible(); if (flag2) { DlgBase.singleton.OnCloseClicked(null); } bool flag3 = DlgBase.singleton.IsVisible(); if (flag3) { DlgBase.singleton.SetVisible(false, true); } bool flag4 = DlgBase.singleton.IsVisible(); if (flag4) { DlgBase.singleton.SetVisible(false, true); } bool flag5 = DlgBase.singleton.IsVisible(); if (flag5) { DlgBase.singleton.SetVisible(false, true); } bool flag6 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); if (flag6) { DlgBase.singleton.SetVisible(false, true); } bool flag7 = this._SelectDifficult == 0u; base.uiBehaviour.m_cbNormal.ForceSetFlag(false); base.uiBehaviour.m_cbHard.ForceSetFlag(false); bool bAutoSelect = this._bAutoSelect; if (bAutoSelect) { this.OnSwitchDifficult(flag7 ? base.uiBehaviour.m_Normal : base.uiBehaviour.m_Hard); } else { base.uiBehaviour.m_cbNormal.bChecked = flag7; base.uiBehaviour.m_cbHard.bChecked = !flag7; this.SetupChapterImage(); } XTeamDocument specificDocument3 = XDocuments.GetSpecificDocument(XTeamDocument.uuID); specificDocument3.ReqTeamOp(TeamOperate.TEAM_QUERYCOUNT, 0UL, null, TeamMemberType.TMT_NORMAL, null); XDailyActivitiesDocument specificDocument4 = XDocuments.GetSpecificDocument(XDailyActivitiesDocument.uuID); specificDocument4.QueryDailyActivityData(); } private void ResetTexture(GameObject frame) { bool flag = frame != null; if (flag) { Transform transform = frame.transform.Find("BG"); bool flag2 = transform != null; if (flag2) { IXUITexture ixuitexture = transform.GetComponent("XUITexture") as IXUITexture; ixuitexture.SetTexturePath(""); } } } protected override void OnHide() { base.OnHide(); this.main.Clear(); this.left.Clear(); this.right.Clear(); base.Return3DAvatarPool(); this.bossDummy = null; XSingleton.singleton.Freezed = false; this.ResetTexture(this._MainFrame); this.ResetTexture(this._LeftFrame); this.ResetTexture(this._RightFrame); this._bLevelIsMoving = false; base.uiBehaviour.m_LevelTween.StopTween(); base.uiBehaviour.m_LevelTween.ResetTweenByGroup(true, 1); base.uiBehaviour.m_cbHard.ForceSetFlag(false); base.uiBehaviour.m_cbNormal.ForceSetFlag(false); } protected override void OnUnload() { XSingleton.singleton.OnUIUnloadMainDummy(this.main.snapShot); base.Return3DAvatarPool(); this.bossDummy = null; bool flag = this.m_fx != null; if (flag) { XSingleton.singleton.DestroyFx(this.m_fx, true); this.m_fx = null; } bool flag2 = this.m_fx1 != null; if (flag2) { XSingleton.singleton.DestroyFx(this.m_fx1, true); this.m_fx1 = null; } base.OnUnload(); } public override void RegisterEvent() { base.uiBehaviour.m_Normal.ID = 0UL; base.uiBehaviour.m_Hard.ID = 1UL; base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClicked)); base.uiBehaviour.m_Normal.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSwitchDifficult)); base.uiBehaviour.m_Hard.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSwitchDifficult)); base.uiBehaviour.m_LevelBg.RegisterSpriteDragEventHandler(new SpriteDragEventHandler(this.OnLevelBgDrag)); base.uiBehaviour.m_SceneClose.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnDetailClose)); base.uiBehaviour.m_SceneQuick1.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnQuickClicked)); base.uiBehaviour.m_SceneQuick10.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnQuickClicked)); base.uiBehaviour.m_SceneGoBattle.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnGoBattleBtnClicked)); base.uiBehaviour.m_SceneSoloBattle.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSoloBattleClicked)); base.uiBehaviour.m_SceneTeamBattle.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnTeamBattleClicked)); base.uiBehaviour.m_ShopBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnShopBtnClick)); base.uiBehaviour.m_Left.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnMoveLeft)); base.uiBehaviour.m_Right.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnMoveRight)); base.uiBehaviour.m_BoxFrameBg.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnChapterBoxBgClick)); base.uiBehaviour.m_BtnAddHardLeftCount0.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this._OnAddHardCountClicked)); base.uiBehaviour.m_BtnAddHardLeftCount1.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this._OnAddHardCountClicked)); base.uiBehaviour.m_PrerogativeBg.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnMemberPrivilegeClicked)); base.uiBehaviour.m_addTicketSpr.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickAddTicketBtn)); } private void OnMemberPrivilegeClicked(IXUISprite btn) { DlgBase.singleton.CheckActiveMemberPrivilege(MemberPrivilege.KingdomPrivilege_Adventurer); } private void OnClickAddTicketBtn(IXUISprite spr) { XSingleton.singleton.ShowItemAccess(XSingleton.singleton.GetInt("SweepTicketId"), null); } protected void OnSwitchDifficult(IXUISprite sp) { bool bLevelIsMoving = this._bLevelIsMoving; if (!bLevelIsMoving) { uint num = (uint)sp.ID; bool flag = this._IsHardModeEnable(); bool flag2 = 1u == num; if (flag2) { bool flag3 = !flag; if (flag3) { base.uiBehaviour.m_cbHard.bChecked = false; base.uiBehaviour.m_cbNormal.bChecked = true; XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("DUNGEONSELECT_HARDMODE_LEVEL_LIMIT_FMT", new object[] { this._HardModeNeedLevel }), "fece00"); return; } } else { bool flag4 = !XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Level_Normal); if (flag4) { return; } } base.uiBehaviour.m_cbHard.bChecked = (1u == num); base.uiBehaviour.m_cbNormal.bChecked = (1u != num); bool bAutoSelectChapterId = this._bAutoSelectChapterId; if (bAutoSelectChapterId) { int playerLocationChapter = XSingleton.singleton.GetPlayerLocationChapter(num); this._SelectedChapter = playerLocationChapter; } else { this._bAutoSelectChapterId = true; } this._SelectDifficult = num; this.SetupChapterImage(); XSingleton.singleton.AddGreenLog("OnSwitchDifficult", null, null, null, null, null); } } private bool _IsHardModeEnable() { bool flag = XSingleton.singleton.XPlayerData != null; bool result; if (flag) { result = ((long)this._HardModeNeedLevel <= (long)((ulong)XSingleton.singleton.XPlayerData.Level)); } else { XSingleton.singleton.AddGreenLog("XAttributeMgr.singleton.XPlayerData is null", null, null, null, null, null); result = false; } return result; } public void AutoShowLastChapter(uint difficult, bool showDetailFrame = true) { bool flag = 1u == difficult && !this._IsHardModeEnable(); if (flag) { difficult = 0u; } this._SelectDifficult = difficult; this._SelectedChapter = XSingleton.singleton.GetPlayerLocationChapter(this._SelectDifficult); this._SelectScene = XSingleton.singleton.GetPlayerLastSceneInChapter(this._SelectedChapter); bool flag2 = this._SelectDifficult == 0u; if (flag2) { this.OnSwitchDifficult(base.uiBehaviour.m_Normal); } else { this.OnSwitchDifficult(base.uiBehaviour.m_Hard); } bool flag3 = this._SelectScene > 0u && showDetailFrame; if (flag3) { this._SetupDetailFrame(this._SelectScene); } } protected bool OnQuickClicked(IXUIButton button) { bool flag = this.SetButtonCool(this.m_fSweepBtnCoolTime); bool result; if (flag) { result = true; } else { bool flag2 = XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Level_Swap); bool flag3 = !flag2; if (flag3) { XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("SWAP_NOT_OPEN"), "fece00"); result = true; } else { bool flag4 = this._SelectDifficult == 1u; if (flag4) { XMainInterfaceDocument xmainInterfaceDocument = XSingleton.singleton.Doc.GetXComponent(XMainInterfaceDocument.uuID) as XMainInterfaceDocument; SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(this._SelectScene); bool flag5 = sceneData != null && xmainInterfaceDocument != null && xmainInterfaceDocument.GetPlayerPPT() < sceneData.SweepNeedPPT; if (flag5) { XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("SWEEPPPT_NOTENOUGH"), "fece00"); return true; } bool flag6 = XSingleton.singleton.Doc.XBagDoc.GetItemCount(87) <= 0UL; if (flag6) { XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("SWEEPTICKETS_NOTENOUGH"), "fece00"); return true; } XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument(XExpeditionDocument.uuID); int expIDBySceneID = specificDocument.GetExpIDBySceneID(this._SelectScene); bool flag7 = !specificDocument.CheckCountAndBuy(expIDBySceneID, sceneData); if (flag7) { return true; } } bool flag8 = this.OnLackPower(); if (flag8) { result = true; } else { bool flag9 = this._SelectScene > 0u; if (flag9) { XSweepDocument specificDocument2 = XDocuments.GetSpecificDocument(XSweepDocument.uuID); bool flag10 = button.gameObject.name == "Quick1"; if (flag10) { specificDocument2.StartSweep(this._SelectScene, 1u); } else { bool flag11 = button.gameObject.name == "Quick10"; if (flag11) { bool flag12 = this._SelectDifficult == 0u; if (flag12) { specificDocument2.StartSweep(this._SelectScene, 10u); } else { bool flag13 = this._SelectDifficult == 1u; if (flag13) { specificDocument2.StartSweep(this._SelectScene, 5u); } } } } } result = true; } } } return result; } private bool SetButtonCool(float time) { float num = Time.realtimeSinceStartup - this.m_fLastClickBtnTime; bool flag = num < time; bool result; if (flag) { result = true; } else { this.m_fLastClickBtnTime = Time.realtimeSinceStartup; result = false; } return result; } protected bool OnCloseClicked(IXUIButton button) { bool bLevelIsMoving = this._bLevelIsMoving; bool result; if (bLevelIsMoving) { XSingleton.singleton.AddLog("isMoving!!!!", null, null, null, null, null, XDebugColor.XDebug_None); result = true; } else { this.SetVisible(false, true); result = true; } return result; } protected bool OnResetClicked(IXUIButton button) { int num = 0; XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; bool flag = xlevelDocument.SceneBuyCount.ContainsKey(this._SelectScene); if (flag) { num = (int)xlevelDocument.SceneBuyCount[this._SelectScene]; } List list = ListPool.Get(); string[] array = XSingleton.singleton.GetValue("BuyStageCountCost").Split(XGlobalConfig.ListSeparator); uint num2 = 0u; while ((ulong)num2 < (ulong)((long)array.Length)) { list.Add(uint.Parse(array[(int)num2])); num2 += 1u; } bool flag2 = num >= list.Count; if (flag2) { num = list.Count - 1; } uint num3 = list[num]; string label = string.Format(XStringDefineProxy.GetString("RESET_LEVEL"), num3); XSingleton.singleton.ShowModalDialog(label, XStringDefineProxy.GetString("COMMON_OK"), XStringDefineProxy.GetString("COMMON_CANCEL"), new ButtonClickEventHandler(this._ResetScene)); ListPool.Release(list); return true; } protected bool _ResetScene(IXUIButton button) { XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; xlevelDocument.ResetScene((int)this._SelectScene); XSingleton.singleton.CloseModalDlg(); return true; } public void OnResetSucc() { this._SetupDetailFrame(this._SelectScene); } public bool OnGoBattleBtnClicked(IXUIButton go) { bool flag = this._SelectScene > 0u; if (flag) { bool flag2 = this.OnLackPower(); if (flag2) { return true; } SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(this._SelectScene); bool flag3 = sceneData == null; if (flag3) { XSingleton.singleton.AddErrorLog("sceneData is null", null, null, null, null, null); return true; } float num = float.Parse(XSingleton.singleton.GetValue("SceneGotoPower")); bool flag4 = XSingleton.singleton.CheckMyPPT(Mathf.FloorToInt((float)sceneData.RecommendPower * num)); if (flag4) { this.GoBattle(null); } else { base.uiBehaviour.m_SceneDetail.gameObject.SetActive(false); XSingleton.singleton.ShowPPTNotEnoughDlg(0UL, new ButtonClickEventHandler(this.GoBattle)); } } return true; } public bool OnSoloBattleClicked(IXUIButton go) { bool flag = this._SelectDifficult == 1u; if (flag) { SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(this._SelectScene); bool flag2 = sceneData == null; if (flag2) { XSingleton.singleton.AddErrorLog("sceneData is null", null, null, null, null, null); return true; } float num = float.Parse(XSingleton.singleton.GetValue("SceneGotoPower")); bool flag3 = XSingleton.singleton.CheckMyPPT(Mathf.FloorToInt((float)sceneData.RecommendPower * num)); if (flag3) { this.OnRealSoloBattleClicked(null); } else { base.uiBehaviour.m_SceneDetail.gameObject.SetActive(false); XSingleton.singleton.ShowPPTNotEnoughDlg(0UL, new ButtonClickEventHandler(this.OnRealSoloBattleClicked)); } } return true; } public bool OnRealSoloBattleClicked(IXUIButton go) { bool flag = this.OnLackPower(); bool result; if (flag) { result = true; } else { XTeamDocument specificDocument = XDocuments.GetSpecificDocument(XTeamDocument.uuID); bool bInTeam = specificDocument.bInTeam; if (bInTeam) { XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("ERR_TEAM_ALREADY_INTEAM"), "fece00"); result = true; } else { result = true; } } return result; } public bool OnTeamBattleClicked(IXUIButton go) { bool flag = this._SelectDifficult == 1u; if (flag) { SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(this._SelectScene); float num = float.Parse(XSingleton.singleton.GetValue("SceneGotoPower")); bool flag2 = sceneData != null; if (flag2) { bool flag3 = XSingleton.singleton.CheckMyPPT(Mathf.FloorToInt((float)sceneData.RecommendPower * num)); if (flag3) { this.OnRealTeamBattleClicked(null); } else { base.uiBehaviour.m_SceneDetail.gameObject.SetActive(false); XSingleton.singleton.ShowPPTNotEnoughDlg(0UL, new ButtonClickEventHandler(this.OnRealTeamBattleClicked)); } } } return true; } public bool OnRealTeamBattleClicked(IXUIButton go) { XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument(XExpeditionDocument.uuID); XTeamDocument specificDocument2 = XDocuments.GetSpecificDocument(XTeamDocument.uuID); int expIDBySceneID = specificDocument.GetExpIDBySceneID(this._SelectScene); specificDocument2.SetAndMatch(expIDBySceneID); return true; } private bool OnLackPower() { return this.OnLackPower(1); } private bool OnLackPower(int times) { bool flag = !XSingleton.singleton.CanEnterBattleScene(this._SelectScene, times); bool result; if (flag) { bool flag2 = XSingleton.singleton.IsMaxBuyPowerCnt(); if (flag2) { XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("ERR_SCENE_NOFATIGUE"), "fece00"); } else { DlgBase.singleton.ShowBorad(ItemEnum.FATIGUE); } result = true; } else { result = false; } return result; } protected bool GoBattle(IXUIButton go) { DlgBase.singleton.SetVisible(false, true); bool flag = XTeamDocument.GoSingleBattleBeforeNeed(new ButtonClickEventHandler(this.GoBattle), go); bool result; if (flag) { result = true; } else { bool flag2 = this.SetButtonCool(this.m_fGoBattleCoolTime); if (flag2) { result = true; } else { PtcC2G_EnterSceneReq ptcC2G_EnterSceneReq = new PtcC2G_EnterSceneReq(); ptcC2G_EnterSceneReq.Data.sceneID = this._SelectScene; XSingleton.singleton.Send(ptcC2G_EnterSceneReq); result = true; } } return result; } public void SetAutoSelectScene(int sceneid, int chapterid, uint diff) { this._bAutoSelectChapterId = false; bool flag = sceneid == 0; if (flag) { this._SelectDifficult = diff; this._SelectedChapter = chapterid; this._SelectScene = 0u; bool flag2 = this._SelectedChapter == 0; if (flag2) { this._SelectedChapter = XSingleton.singleton.GetPlayerLocationChapter(this._SelectDifficult); } this._bAutoSelect = true; } else { this._SelectScene = (uint)sceneid; this._SelectedChapter = XSingleton.singleton.GetSceneChapter(sceneid); this._SelectDifficult = (uint)XSingleton.singleton.GetSceneDifficult(sceneid); this._bAutoSelect = true; } } public void SelectChapter(int chapterid, uint diff) { this._SelectScene = 0u; this._SelectedChapter = chapterid; this._SelectDifficult = diff; this.FadeShow(); } protected GameObject GetLevelFrame() { return base.uiBehaviour.m_SceneFramePool.FetchGameObject(false); } protected void SetupChapterBaseImage(int chapter, uint difficult, GameObject frame) { XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; XChapter.RowData chapter2 = XSingleton.singleton.GetChapter(chapter); IXUILabel ixuilabel = frame.transform.Find("Title").GetComponent("XUILabel") as IXUILabel; bool flag = chapter2 != null; if (flag) { ixuilabel.SetText(chapter2.Comment); } Transform transform = frame.transform.Find("me"); IXUISprite ixuisprite = frame.transform.Find("me/me/me").GetComponent("XUISprite") as IXUISprite; ixuisprite.spriteName = XSingleton.singleton.GetSuperRiskAvatar(XSingleton.singleton.Player.BasicTypeID); ixuisprite.MakePixelPerfect(); transform.gameObject.SetActive(false); Transform transform2 = frame.transform.Find("BG"); bool flag2 = transform2 != null; if (flag2) { IXUITexture ixuitexture = transform2.GetComponent("XUITexture") as IXUITexture; bool flag3 = chapter2 != null; if (flag3) { ixuitexture.SetTexturePath("atlas/UI/Hall/LevelBg/" + chapter2.Pic); } } List list = ListPool.Get(); XSingleton.singleton.GetSceneListByChapter(chapter, list); bool flag4 = list.Count == 0; if (flag4) { ListPool.Release(list); } else { list.Sort(); bool flag5 = difficult == 0u; if (flag5) { base.uiBehaviour.m_NormalBg.SetActive(true); base.uiBehaviour.m_HardBg.SetActive(false); base.uiBehaviour.m_HardLeftCountGo0.SetActive(false); base.uiBehaviour.m_ShopBtn.SetVisible(false); } else { base.uiBehaviour.m_PrerogativeSpr.SetGrey(this._welfareDoc.IsOwnMemberPrivilege(MemberPrivilege.KingdomPrivilege_Adventurer)); base.uiBehaviour.m_PrerogativeSpr.SetSprite(this._welfareDoc.GetMemberPrivilegeIcon(MemberPrivilege.KingdomPrivilege_Adventurer)); base.uiBehaviour.m_PrerogativeLab.SetEnabled(this._welfareDoc.IsOwnMemberPrivilege(MemberPrivilege.KingdomPrivilege_Adventurer)); base.uiBehaviour.m_PrerogativeLab.SetText(string.Format(XStringDefineProxy.GetString("Prerogative_Abyss"), this._welfareDoc.GetMemberPrivilegeConfig(MemberPrivilege.KingdomPrivilege_Adventurer).AbyssCount)); base.uiBehaviour.m_NormalBg.SetActive(false); base.uiBehaviour.m_HardBg.SetActive(true); base.uiBehaviour.m_HardLeftCountGo0.SetActive(true); base.uiBehaviour.m_ShopBtn.SetVisible(true); } bool flag6 = false; GameObject fx = null; Transform parent = frame.transform.Find("Levels"); XSingleton.singleton.ClearDummy(this.m_dummPool); this.bossDummy = null; bool flag7 = frame == this._MainFrame; if (flag7) { this._isShowBossAvatar = true; } for (int i = 0; i < list.Count; i++) { uint num = list[i]; SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(num); int num2 = XSingleton.singleton.GetRank(sceneData.id); bool flag8 = num2 == -1; if (flag8) { num2 = 0; } bool flag9 = sceneData != null; if (flag9) { GameObject gameObject = base.uiBehaviour.m_ScenePool.FetchGameObject(false); gameObject.name = sceneData.id.ToString(); gameObject.transform.parent = parent; bool flag10 = sceneData.UIPos != null; if (flag10) { gameObject.transform.localPosition = new Vector3((float)sceneData.UIPos[0], (float)sceneData.UIPos[1], 600f); } else { XSingleton.singleton.AddErrorLog("'uipos' is null,To the plotter(ce hua) Find a solution,please,sceneId = " + num.ToString(), null, null, null, null, null); } gameObject.transform.localScale = Vector3.one; this.SceneDic[num] = gameObject; IXUISprite ixuisprite2 = gameObject.transform.Find("SprBtn").GetComponent("XUISprite") as IXUISprite; ixuisprite2.ID = (ulong)sceneData.id; ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSceneSelected)); IXUISprite ixuisprite3 = gameObject.transform.Find("LevelPic").GetComponent("XUISprite") as IXUISprite; IXUISprite ixuisprite4 = gameObject.transform.Find("Star1").GetComponent("XUISprite") as IXUISprite; IXUISprite ixuisprite5 = gameObject.transform.Find("Star2").GetComponent("XUISprite") as IXUISprite; IXUISprite ixuisprite6 = gameObject.transform.Find("Star3").GetComponent("XUISprite") as IXUISprite; GameObject gameObject2 = gameObject.transform.Find("TaskHint").gameObject; Transform transform3 = gameObject.transform.Find("Snapshot"); IXUISprite ixuisprite7 = gameObject.transform.Find("Box").GetComponent("XUISprite") as IXUISprite; IXUILabel ixuilabel2 = gameObject.transform.Find("Hint").GetComponent("XUILabel") as IXUILabel; IXUILabel ixuilabel3 = gameObject.transform.Find("Hint/GoLevelup").GetComponent("XUILabel") as IXUILabel; IXUISprite ixuisprite8 = gameObject.transform.Find("BoxFx").GetComponent("XUISprite") as IXUISprite; ixuisprite7.gameObject.SetActive(false); ixuilabel2.gameObject.SetActive(false); ixuisprite8.gameObject.SetActive(false); XTaskDocument specificDocument = XDocuments.GetSpecificDocument(XTaskDocument.uuID); gameObject2.SetActive(specificDocument.GetSceneTaskState(num).Count > 0); bool flag11 = difficult == 0u; if (flag11) { ixuisprite3.SetSprite("gk_0"); } else { ixuisprite3.SetSprite("gk_1"); } ixuisprite4.gameObject.SetActive(true); ixuisprite4.spriteName = "gk_3"; ixuisprite5.gameObject.SetActive(true); ixuisprite5.spriteName = "gk_3"; ixuisprite6.gameObject.SetActive(true); ixuisprite6.spriteName = "gk_3"; bool flag12 = num2 >= 1; if (flag12) { ixuisprite4.spriteName = "gk_4"; } bool flag13 = num2 >= 2; if (flag13) { ixuisprite5.spriteName = "gk_4"; } bool flag14 = num2 >= 3; if (flag14) { ixuisprite6.spriteName = "gk_4"; } bool flag15 = num2 == 0; if (flag15) { ixuisprite4.gameObject.SetActive(false); ixuisprite5.gameObject.SetActive(false); ixuisprite6.gameObject.SetActive(false); } ixuisprite3.SetGrey(!flag6); bool flag16 = num2 <= 0; if (flag16) { SceneRefuseReason sceneRefuseReason = SceneRefuseReason.Invalid; bool flag17 = !flag6; if (flag17) { sceneRefuseReason = xlevelDocument.CanLevelOpen(num); ixuisprite3.SetGrey(true); transform.localPosition = gameObject.transform.localPosition; fx = transform.gameObject; bool flag18 = i == list.Count - 1; if (flag18) { this._isShowBossAvatar = false; } bool flag19 = sceneRefuseReason != SceneRefuseReason.Admit; if (flag19) { ixuilabel2.gameObject.SetActive(true); bool flag20 = sceneRefuseReason == SceneRefuseReason.PreTask_Notfinish; if (flag20) { ixuilabel3.SetText(XStringDefineProxy.GetString("LEVEL_GO_TASK")); ixuilabel2.SetText(string.Format(XStringDefineProxy.GetString("LEVEl_REQUIRE_TASK"), new object[0])); ixuilabel3.RegisterLabelClickEventHandler(new LabelClickEventHandler(this.OnGoLevelupClick)); } else { bool flag21 = sceneRefuseReason == SceneRefuseReason.PreScene_Notfinish; if (flag21) { ixuilabel3.SetText(XStringDefineProxy.GetString("LEVEL_GO_SCENE")); int unFinishedPreSceneID = xlevelDocument.GetUnFinishedPreSceneID(sceneData); SceneTable.RowData sceneData2 = XSingleton.singleton.GetSceneData((uint)unFinishedPreSceneID); bool flag22 = sceneData2 != null; if (flag22) { ixuilabel2.SetText(string.Format(XStringDefineProxy.GetString("LEVEL_REQUIRE_PRELEVEL"), sceneData2.Comment)); } ixuilabel3.RegisterLabelClickEventHandler(new LabelClickEventHandler(this.OnGoLevelupClick)); } else { bool flag23 = SceneRefuseReason.ReachLimitTimes == sceneRefuseReason; if (flag23) { ixuilabel3.SetText(XStringDefineProxy.GetString("LEVEL_REACH_LIMIT_TIMES")); ixuilabel2.SetText(XStringDefineProxy.GetString("LEVEL_REACH_LIMIT_TIMES")); ixuilabel3.RegisterLabelClickEventHandler(new LabelClickEventHandler(this.OnGoLevelupClick)); } else { ixuilabel3.SetText(XStringDefineProxy.GetString("LEVEL_GO_UP")); ixuilabel2.SetText(string.Format(XStringDefineProxy.GetString("LEVEL_REQUIRE_LEVEL"), sceneData.RequiredLevel)); this.m_goLevelUpGo = ixuilabel2.gameObject; XSingleton.singleton.AddGreenLog("get farme", null, null, null, null, null); } } } ixuilabel3.ID = (ulong)sceneData.id; } } bool flag24 = sceneRefuseReason == SceneRefuseReason.Admit; if (flag24) { transform.localPosition = gameObject.transform.localPosition; fx = transform.gameObject; } flag6 = true; } else { transform.localPosition = gameObject.transform.localPosition; fx = transform.gameObject; } bool flag25 = sceneData.SceneChest != 0 && sceneData.BoxUIPos != null && sceneData.BoxUIPos.Length == 2; if (flag25) { GameObject gameObject3 = base.uiBehaviour.m_ScenePool.FetchGameObject(false); gameObject3.name = "chest" + num; gameObject3.transform.parent = parent; gameObject3.transform.localPosition = new Vector3((float)sceneData.BoxUIPos[0], (float)sceneData.BoxUIPos[1], 600f); gameObject3.transform.localScale = Vector3.one; this.SetupLevelChest(gameObject3, num, sceneData.SceneChest, num2); } } } ListPool.Release(list); bool flag26 = frame == this._MainFrame; if (flag26) { this.main.fx = fx; } else { bool flag27 = frame == this._LeftFrame; if (flag27) { this.left.fx = fx; } else { bool flag28 = frame == this._RightFrame; if (flag28) { this.right.fx = fx; } } } } } protected void OnGoLevelupClick(IXUILabel go) { uint sceneID = (uint)go.ID; XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; switch (xlevelDocument.CanLevelOpen(sceneID)) { case SceneRefuseReason.PreTask_Notfinish: { XTaskDocument specificDocument = XDocuments.GetSpecificDocument(XTaskDocument.uuID); XTaskInfo mainTask = specificDocument.TaskRecord.MainTask; bool flag = mainTask != null; if (flag) { uint sceneID2 = XTaskDocument.GetSceneID(ref mainTask.TableData.PassScene); bool flag2 = mainTask.Status == TaskStatus.TaskStatus_Taked && sceneID2 > 0u; if (flag2) { this._SelectedChapter = XSingleton.singleton.GetSceneChapter((int)sceneID2); this._SelectDifficult = (uint)XSingleton.singleton.GetSceneDifficult((int)sceneID2); this._SelectScene = sceneID2; this._SetupDetailFrame(sceneID2); } else { this.SetVisible(false, true); specificDocument.DoTask(mainTask.ID); } } break; } case SceneRefuseReason.PreScene_Notfinish: { SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(sceneID); bool flag3 = sceneData == null; if (flag3) { XSingleton.singleton.AddGreenLog("scenedata is null", null, null, null, null, null); } else { int unFinishedPreSceneID = xlevelDocument.GetUnFinishedPreSceneID(sceneData); int rank = XSingleton.singleton.GetRank(unFinishedPreSceneID); bool flag4 = rank > 0 || xlevelDocument.CanLevelOpen((uint)unFinishedPreSceneID) == SceneRefuseReason.Admit; if (flag4) { this._SelectScene = (uint)unFinishedPreSceneID; int sceneChapter = XSingleton.singleton.GetSceneChapter(unFinishedPreSceneID); int sceneDifficult = XSingleton.singleton.GetSceneDifficult(unFinishedPreSceneID); bool flag5 = sceneChapter != this._SelectedChapter || (long)sceneDifficult != (long)((ulong)this._SelectDifficult); if (flag5) { base.uiBehaviour.m_cbNormal.ForceSetFlag(false); base.uiBehaviour.m_cbHard.ForceSetFlag(false); bool flag6 = sceneDifficult == 0; if (flag6) { base.uiBehaviour.m_cbNormal.bChecked = true; this.OnSwitchDifficult(base.uiBehaviour.m_Normal); } else { base.uiBehaviour.m_cbHard.bChecked = true; this.OnSwitchDifficult(base.uiBehaviour.m_Hard); } this._SelectDifficult = (uint)sceneDifficult; this._SelectedChapter = sceneChapter; } this._SetupDetailFrame((uint)unFinishedPreSceneID); } else { int sceneChapter2 = XSingleton.singleton.GetSceneChapter(unFinishedPreSceneID); int sceneDifficult2 = XSingleton.singleton.GetSceneDifficult(unFinishedPreSceneID); bool flag7 = sceneChapter2 != this._SelectedChapter || (long)sceneDifficult2 != (long)((ulong)this._SelectDifficult); if (flag7) { IXUICheckBox ixuicheckBox = base.uiBehaviour.m_Normal.gameObject.GetComponent("XUICheckBox") as IXUICheckBox; IXUICheckBox ixuicheckBox2 = base.uiBehaviour.m_Hard.gameObject.GetComponent("XUICheckBox") as IXUICheckBox; ixuicheckBox.bChecked = false; ixuicheckBox2.bChecked = false; bool flag8 = sceneDifficult2 == 0; if (flag8) { ixuicheckBox.bChecked = true; this.OnSwitchDifficult(base.uiBehaviour.m_Normal); } else { ixuicheckBox2.bChecked = true; this.OnSwitchDifficult(base.uiBehaviour.m_Hard); } this._SelectDifficult = (uint)sceneDifficult2; this._SelectedChapter = sceneChapter2; } } } break; } } } protected void SetupBossAvatar(int chapter, uint difficult, GameObject frame) { bool flag = this.bossDummy != null; if (flag) { XSingleton.singleton.EnableCommonDummy(this.bossDummy, null, false); } List list = ListPool.Get(); XSingleton.singleton.GetSceneListByChapter(chapter, list); bool flag2 = list.Count == 0; if (flag2) { ListPool.Release(list); } else { list.Sort(); bool flag3 = list.Count == 0; if (!flag3) { uint sceneID = list[list.Count - 1]; bool flag4 = !this._isShowBossAvatar; if (!flag4) { int rank = XSingleton.singleton.GetRank((int)sceneID); bool flag5 = rank >= 0; if (flag5) { ListPool.Release(list); } else { bool flag6 = rank < 0 && list.Count > 1; if (flag6) { bool flag7 = list.Count < 2; if (flag7) { return; } XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; uint sceneID2 = list[list.Count - 2]; int rank2 = XSingleton.singleton.GetRank((int)sceneID2); bool flag8 = rank2 > 0 && xlevelDocument.CanLevelOpen(sceneID) == SceneRefuseReason.Admit; if (flag8) { ListPool.Release(list); return; } } ListPool.Release(list); Transform transform = frame.transform.Find("Levels"); Transform child = transform.GetChild(transform.childCount - 1); bool flag9 = child.gameObject.name.StartsWith("chest"); if (flag9) { child = transform.GetChild(transform.childCount - 2); } IUIDummy iuidummy = child.Find("Snapshot").GetComponent("UIDummy") as IUIDummy; Vector3 localPosition = iuidummy.transform.localPosition; localPosition.z = -100f; iuidummy.transform.localPosition = localPosition; XChapter.RowData chapter2 = XSingleton.singleton.GetChapter(chapter); bool flag10 = chapter2 != null; if (flag10) { XEntityStatistics.RowData byID = XSingleton.singleton.EntityStatistics.GetByID((uint)chapter2.BossID); bool flag11 = byID == null; if (!flag11) { this.bossDummy = XSingleton.singleton.CreateCommonEntityDummy(this.m_dummPool, byID.PresentID, iuidummy, this.bossDummy, 1f); } } else { XSingleton.singleton.AddErrorLog(string.Format("error chapterId = {0}", chapter), null, null, null, null, null); } } } } } } public void SetupChapterImage() { base.uiBehaviour.m_ScenePool.ReturnAll(true); base.uiBehaviour.m_SceneFramePool.ReturnAll(false); this.SceneDic.Clear(); this._MainFrame = null; this._LeftFrame = null; this._RightFrame = null; this._bLevelIsMoving = false; this._MainFrame = this.GetLevelFrame(); base.uiBehaviour.m_LevelTween.gameObject.transform.Find("LevelFramePanel").localPosition = Vector3.zero; this._MainFrame.transform.localPosition = Vector3.zero; this._MainFrame.name = string.Format("chapter{0}", this._SelectedChapter); this._ChapterRank = 0; this._ChapterTotalRank = 0; this._FirstNoRankScene = 0u; this.SetupChapterBaseImage(this._SelectedChapter, this._SelectDifficult, this._MainFrame); this.SetupChapterExInfo(); bool bAutoSelect = this._bAutoSelect; if (bAutoSelect) { bool flag = this._SelectScene > 0u; if (flag) { this._SetupDetailFrame(this._SelectScene); } this._bAutoSelect = false; } } protected void SetupLeftChapterImage() { int previousChapter = XSingleton.singleton.GetPreviousChapter(this._SelectedChapter); bool flag = previousChapter == 0; if (!flag) { bool flag2 = this._LeftFrame == null; if (flag2) { this._LeftFrame = this.GetLevelFrame(); } bool flag3 = this._LeftFrame == null; if (flag3) { XSingleton.singleton.AddGreenLog("SetupLeftChapterImage,_LeftFrame is null!", null, null, null, null, null); } else { bool flag4 = this._MainFrame == null; if (flag4) { XSingleton.singleton.AddGreenLog("SetupLeftChapterImage,_MainFrame is null!", null, null, null, null, null); } else { this._LeftFrame.transform.localPosition = this._MainFrame.transform.localPosition + new Vector3(-1136f, 0f); this._LeftFrame.name = "chapter" + previousChapter; this.SetupChapterBaseImage(previousChapter, this._SelectDifficult, this._LeftFrame); } } } } protected void SetupRightChapterImage() { int nextChapter = XSingleton.singleton.GetNextChapter(this._SelectedChapter); bool flag = nextChapter == this._SelectedChapter; if (!flag) { int playerLastChapter = XSingleton.singleton.GetPlayerLastChapter(this._SelectDifficult); bool flag2 = nextChapter > playerLastChapter; if (!flag2) { bool flag3 = this._RightFrame == null; if (flag3) { this._RightFrame = this.GetLevelFrame(); } bool flag4 = this._RightFrame == null; if (flag4) { XSingleton.singleton.AddGreenLog("SetupRightChapterImage,_RightFrame is null!", null, null, null, null, null); } else { bool flag5 = this._MainFrame == null; if (flag5) { XSingleton.singleton.AddGreenLog("SetupRightChapterImage,_MainFrame is null!", null, null, null, null, null); } else { this._RightFrame.transform.localPosition = this._MainFrame.transform.localPosition + new Vector3(1136f, 0f, 0f); this._RightFrame.name = "chapter" + nextChapter; this.SetupChapterBaseImage(nextChapter, this._SelectDifficult, this._RightFrame); } } } } } protected void SetupLevelChest(GameObject level, uint sceneID, int dropID, int rank) { IXUISprite ixuisprite = level.transform.Find("LevelPic").GetComponent("XUISprite") as IXUISprite; IXUISprite ixuisprite2 = level.transform.Find("Star1").GetComponent("XUISprite") as IXUISprite; IXUISprite ixuisprite3 = level.transform.Find("Star2").GetComponent("XUISprite") as IXUISprite; IXUISprite ixuisprite4 = level.transform.Find("Star3").GetComponent("XUISprite") as IXUISprite; GameObject gameObject = level.transform.Find("TaskHint").gameObject; IXUISprite ixuisprite5 = level.transform.Find("Box").GetComponent("XUISprite") as IXUISprite; IXUISprite ixuisprite6 = level.transform.Find("BoxFx").GetComponent("XUISprite") as IXUISprite; IXUILabel ixuilabel = level.transform.Find("Hint").GetComponent("XUILabel") as IXUILabel; IXUISprite ixuisprite7 = level.transform.Find("SprBtn").GetComponent("XUISprite") as IXUISprite; ixuisprite7.SetGrey(rank > 0); ixuisprite7.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSceneChestClicked)); ixuisprite7.ID = (ulong)sceneID; ixuisprite6.gameObject.SetActive(false); bool flag = this._SelectDifficult == 0u; if (flag) { ixuisprite.SetSprite("gk_0"); } else { ixuisprite.SetSprite("gk_1"); } ixuisprite2.gameObject.SetActive(false); ixuisprite3.gameObject.SetActive(false); ixuisprite4.gameObject.SetActive(false); gameObject.gameObject.SetActive(false); ixuilabel.gameObject.SetActive(false); ixuisprite5.gameObject.SetActive(true); ixuisprite5.ID = (ulong)sceneID; } public void SetupChangeChapterUI() { XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; int previousChapter = XSingleton.singleton.GetPreviousChapter(this._SelectedChapter); bool flag = previousChapter > 0; if (flag) { base.uiBehaviour.m_Left.gameObject.SetActive(true); GameObject gameObject = base.uiBehaviour.m_Left.gameObject.transform.Find("RedPoint").gameObject; bool flag2 = xlevelDocument.HasChapterRedpoint(previousChapter); if (flag2) { gameObject.SetActive(true); } else { gameObject.SetActive(false); } } else { base.uiBehaviour.m_Left.gameObject.SetActive(false); } int nextChapter = XSingleton.singleton.GetNextChapter(this._SelectedChapter); int playerLastChapter = XSingleton.singleton.GetPlayerLastChapter(this._SelectDifficult); bool flag3 = nextChapter != this._SelectedChapter && playerLastChapter >= nextChapter; if (flag3) { base.uiBehaviour.m_Right.gameObject.SetActive(true); GameObject gameObject2 = base.uiBehaviour.m_Right.gameObject.transform.Find("RedPoint").gameObject; bool flag4 = xlevelDocument.HasChapterRedpoint(nextChapter); if (flag4) { gameObject2.SetActive(true); } else { gameObject2.SetActive(false); } } else { base.uiBehaviour.m_Right.gameObject.SetActive(false); } bool flag5 = this._SelectDifficult == 0u; if (flag5) { base.uiBehaviour.m_NormalRedpoint.SetActive(false); base.uiBehaviour.m_HardRedpoint.SetActive(xlevelDocument.HasDifficultAllChapterRedpoint(1)); } else { base.uiBehaviour.m_HardRedpoint.SetActive(false); base.uiBehaviour.m_NormalRedpoint.SetActive(xlevelDocument.HasDifficultAllChapterRedpoint(0)); } } public override void StackRefresh() { base.StackRefresh(); base.Alloc3DAvatarPool("DungeonSelect"); this.SetupPlayerAvatar(); this.SetupBossAvatar(this._SelectedChapter, this._SelectDifficult, this._MainFrame); this.RefreshHardLeftCount(); } public void SetupPlayerAvatar() { bool flag = this.main.fx != null; if (flag) { this.main.fx.SetActive(true); IXUITweenTool ixuitweenTool = this.main.fx.transform.Find("me").GetComponent("XUIPlayTween") as IXUITweenTool; bool flag2 = ixuitweenTool != null; if (flag2) { ixuitweenTool.StopTween(); ixuitweenTool.ResetTween(true); ixuitweenTool.PlayTween(true, -1f); } } } public void UpdateSceneEnterTime() { bool activeInHierarchy = base.uiBehaviour.m_SceneDetail.activeInHierarchy; if (activeInHierarchy) { this._SetupDetailFrame(this._SelectScene); this.RefreshHardLeftCount(); } } public void UpdateSceneBox() { XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; Transform transform = this._MainFrame.transform.Find("Levels"); int childCount = transform.childCount; for (int i = 0; i < childCount; i++) { Transform child = transform.GetChild(i); bool flag = !child.gameObject.name.StartsWith("chest"); if (!flag) { IXUISprite ixuisprite = child.Find("LevelPic").GetComponent("XUISprite") as IXUISprite; IXUISprite ixuisprite2 = child.Find("Box").GetComponent("XUISprite") as IXUISprite; IXUISprite ixuisprite3 = child.Find("BoxFx").GetComponent("XUISprite") as IXUISprite; IXUITweenTool ixuitweenTool = child.Find("Box").GetComponent("XUIPlayTween") as IXUITweenTool; uint num = (uint)ixuisprite2.ID; SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(num); bool flag2 = sceneData != null && sceneData.SceneChest > 0; if (flag2) { ixuisprite2.gameObject.SetActive(true); bool flag3 = xlevelDocument.SceneBox.Contains(num); if (flag3) { ixuisprite2.spriteName = "xz01_1"; ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSceneChestClicked)); ixuisprite3.gameObject.SetActive(false); ixuisprite.SetEnabled(true); ixuitweenTool.ResetTween(true); } else { ixuisprite2.spriteName = "xz01_0"; ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSceneChestClicked)); int rank = XSingleton.singleton.GetRank((int)num); bool flag4 = rank <= 0; if (flag4) { ixuisprite3.gameObject.SetActive(false); ixuisprite.SetEnabled(false); ixuitweenTool.ResetTween(true); } else { ixuisprite3.gameObject.SetActive(true); ixuisprite.SetEnabled(true); ixuitweenTool.PlayTween(true, -1f); } } } } } this.SetupChangeChapterUI(); } protected void OnSceneChestClicked(IXUISprite sp) { base.uiBehaviour.m_BoxFrame.SetActive(true); base.uiBehaviour.m_BoxFetch.ID = sp.ID; SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData((uint)sp.ID); bool flag = sceneData == null; if (flag) { XSingleton.singleton.AddGreenLog("OnSceneChestClicked sceneData is null", null, null, null, null, null); } else { XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; base.uiBehaviour.m_BoxRedPoint.SetActive(false); base.uiBehaviour.m_BoxChest.SetActive(true); base.uiBehaviour.m_BoxStar.gameObject.SetActive(false); int rank = XSingleton.singleton.GetRank((int)sp.ID); bool flag2 = rank <= 0; if (flag2) { base.uiBehaviour.m_BoxFetch.SetEnable(false, false); base.uiBehaviour.m_BoxFetch.SetCaption(XStringDefineProxy.GetString("SRS_FETCH")); } else { bool flag3 = xlevelDocument.SceneBox.Contains((uint)sceneData.id); if (flag3) { base.uiBehaviour.m_BoxFetch.SetEnable(false, false); base.uiBehaviour.m_BoxFetch.SetCaption(XStringDefineProxy.GetString("SRS_FETCHED")); } else { base.uiBehaviour.m_BoxFetch.SetEnable(true, false); base.uiBehaviour.m_BoxRedPoint.SetActive(true); base.uiBehaviour.m_BoxFetch.SetCaption(XStringDefineProxy.GetString("SRS_FETCH")); } } this.SetupBoxReward(sceneData.SceneChest); base.uiBehaviour.m_BoxFetch.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSceneChestBoxFetch)); } } protected void ReturnLevelFrameToPool(GameObject frame) { bool flag = frame == null; if (flag) { XSingleton.singleton.AddErrorLog("ReturnLevelFrameToPool frame is null", null, null, null, null, null); } else { List list = new List(); Transform transform = frame.transform.Find("Levels"); bool flag2 = transform == null; if (!flag2) { for (int i = 0; i < transform.childCount; i++) { list.Add(transform.GetChild(i).gameObject); } for (int j = 0; j < list.Count; j++) { base.uiBehaviour.m_ScenePool.ReturnInstance(list[j], true); } base.uiBehaviour.m_SceneFramePool.ReturnInstance(frame, false); } } } protected bool OnLevelBgDrag(Vector2 delta) { bool flag = delta.x > 0f; if (flag) { this.OnMoveLeft(null); } else { this.OnMoveRight(null); } return true; } protected bool OnMoveLeft(IXUIButton go) { bool bLevelIsMoving = this._bLevelIsMoving; bool result; if (bLevelIsMoving) { result = true; } else { int previousChapter = XSingleton.singleton.GetPreviousChapter(this._SelectedChapter); bool flag = previousChapter > 0; if (flag) { this._SelectedChapter = previousChapter; Vector3 localPosition = base.uiBehaviour.m_LevelTween.gameObject.transform.Find("LevelFramePanel").localPosition; Vector3 to = localPosition + new Vector3(1136f, 0f); bool flag2 = base.uiBehaviour.m_LevelTween != null; if (flag2) { this._bLevelIsMoving = true; } base.uiBehaviour.m_LevelTween.ResetTweenByGroup(true, 0); base.uiBehaviour.m_LevelTween.SetPositionTweenPos(1, localPosition, to); base.uiBehaviour.m_LevelTween.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnMoveLeftOver)); base.uiBehaviour.m_LevelTween.PlayTween(true, -1f); XSingleton.singleton.AddLog("MoveLeft-->> _bLevelIsMoving =" + this._bLevelIsMoving.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); } result = true; } return result; } protected void OnMoveLeftOver(IXUITweenTool tween) { this._bLevelIsMoving = false; this.ReturnLevelFrameToPool(this._MainFrame); bool flag = this._RightFrame != null; if (flag) { this.ReturnLevelFrameToPool(this._RightFrame); } this._RightFrame = null; this._MainFrame = this._LeftFrame; this._LeftFrame = null; this.main.Copy(ref this.left); this.left.Clear(); this.right.Clear(); this.SetupChapterExInfo(); XSingleton.singleton.AddLog("MoveLeftOver..... _bLevelIsMoving =" + this._bLevelIsMoving.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); } protected bool OnMoveRight(IXUIButton go) { bool bLevelIsMoving = this._bLevelIsMoving; bool result; if (bLevelIsMoving) { result = true; } else { int nextChapter = XSingleton.singleton.GetNextChapter(this._SelectedChapter); int playerLastChapter = XSingleton.singleton.GetPlayerLastChapter(this._SelectDifficult); bool flag = nextChapter != this._SelectedChapter && playerLastChapter >= nextChapter; if (flag) { this._SelectedChapter = nextChapter; Vector3 localPosition = base.uiBehaviour.m_LevelTween.gameObject.transform.Find("LevelFramePanel").localPosition; Vector3 to = localPosition + new Vector3(-1136f, 0f); bool flag2 = base.uiBehaviour.m_LevelTween != null; if (flag2) { this._bLevelIsMoving = true; } base.uiBehaviour.m_LevelTween.ResetTweenByGroup(true, 0); base.uiBehaviour.m_LevelTween.SetPositionTweenPos(1, localPosition, to); base.uiBehaviour.m_LevelTween.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnMoveRightOver)); base.uiBehaviour.m_LevelTween.PlayTween(true, -1f); XSingleton.singleton.AddLog("MoveRight-->> _bLevelIsMoving =" + this._bLevelIsMoving.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); } result = true; } return result; } protected void OnMoveRightOver(IXUITweenTool tween) { this._bLevelIsMoving = false; this.ReturnLevelFrameToPool(this._MainFrame); bool flag = this._LeftFrame != null; if (flag) { this.ReturnLevelFrameToPool(this._LeftFrame); } this._LeftFrame = null; this._MainFrame = this._RightFrame; this._RightFrame = null; this.main.Copy(ref this.right); this.left.Clear(); this.right.Clear(); this.SetupChapterExInfo(); XSingleton.singleton.AddLog("MoveRightOver..... _bLevelIsMoving =" + this._bLevelIsMoving.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); } protected void SetupChapterExInfo() { bool flag = this._MainFrame == null; if (flag) { this._bLevelIsMoving = false; XSingleton.singleton.AddGreenLog("SetupChapterExInfo,_MainFrame is null!", null, null, null, null, null); } else { Transform parent = this._MainFrame.transform.Find("me/Effect"); this.PlayEffect(ref this.m_fx, this.EffectPath, parent); parent = this._MainFrame.transform.Find("me/Effect/Effect"); this.PlayEffect(ref this.m_fx1, this.EffectPath1, parent); this.SetupLeftChapterImage(); this.SetupRightChapterImage(); this.SetupPlayerAvatar(); this.SetupBossAvatar(this._SelectedChapter, this._SelectDifficult, this._MainFrame); this.SetupChapterBoxProgress(); this.SetupChangeChapterUI(); this.UpdateSceneEnterTime(); this.UpdateSceneBox(); } } private void PlayEffect(ref XFx fx, string path, Transform parent) { bool flag = fx == null; if (flag) { fx = XSingleton.singleton.CreateFx(path, null, true); } else { fx.SetActive(true); } fx.Play(parent, Vector3.zero, Vector3.one, 1f, true, false); } public void SetupChapterBoxProgress() { List list = ListPool.Get(); XSingleton.singleton.GetSceneListByChapter(this._SelectedChapter, list); bool flag = list.Count == 0; if (flag) { ListPool.Release(list); } else { list.Sort(); this._ChapterTotalRank = (this._ChapterRank = 0); this._FirstNoRankScene = 0u; for (int i = 0; i < list.Count; i++) { uint num = list[i]; SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(num); int num2 = 0; bool flag2 = sceneData != null; if (flag2) { num2 = XSingleton.singleton.GetRank(sceneData.id); } bool flag3 = num2 == -1; if (flag3) { num2 = 0; } bool flag4 = sceneData != null; if (flag4) { this._ChapterTotalRank += 3; this._ChapterRank += num2; } bool flag5 = num2 <= 0; if (flag5) { bool flag6 = this._FirstNoRankScene == 0u; if (flag6) { this._FirstNoRankScene = num; } } } ListPool.Release(list); base.uiBehaviour.m_Rank.SetText(this._ChapterRank + "/" + this._ChapterTotalRank); base.uiBehaviour.m_RankProgress.value = (float)this._ChapterRank / (float)this._ChapterTotalRank; XChapter.RowData chapter = XSingleton.singleton.GetChapter(this._SelectedChapter); bool flag7 = chapter == null; if (flag7) { XSingleton.singleton.AddErrorLog("SetupChapterBoxProgress chData is null", null, null, null, null, null); } else { int num3 = 390; base.uiBehaviour.m_RankBox.FakeReturnAll(); for (int j = 0; j < chapter.Drop.Count; j++) { int num4 = chapter.Drop[j, 0]; GameObject gameObject = base.uiBehaviour.m_RankBox.FetchGameObject(false); gameObject.transform.localPosition = base.uiBehaviour.m_RankBox.TplPos + new Vector3((float)(num3 * num4 / this._ChapterTotalRank), 0f); IXUISprite ixuisprite = gameObject.GetComponent("XUISprite") as IXUISprite; IXUISprite ixuisprite2 = gameObject.transform.Find("Box").GetComponent("XUISprite") as IXUISprite; IXUILabel ixuilabel = gameObject.transform.Find("Star").GetComponent("XUILabel") as IXUILabel; IXUITweenTool ixuitweenTool = gameObject.transform.Find("Box").GetComponent("XUIPlayTween") as IXUITweenTool; IXUISprite ixuisprite3 = gameObject.transform.Find("Fx").GetComponent("XUISprite") as IXUISprite; ixuilabel.SetText(num4.ToString()); ixuisprite2.ID = (ulong)((long)j); ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnChapterBoxClicked)); ixuisprite.ID = (ulong)((long)j); ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnChapterBoxClicked)); bool flag8 = this._ChapterRank >= num4; if (flag8) { bool flag9 = XSingleton.singleton.HasChapterBoxFetched(this._SelectedChapter, j); if (flag9) { ixuisprite2.spriteName = "xz02_1"; ixuisprite3.SetAlpha(0f); ixuitweenTool.ResetTween(true); } else { ixuisprite2.spriteName = "xz02_0"; ixuisprite3.SetAlpha(1f); ixuitweenTool.PlayTween(true, -1f); } } else { ixuisprite2.spriteName = "xz02_0"; ixuisprite3.SetAlpha(0f); ixuitweenTool.ResetTween(true); } } base.uiBehaviour.m_RankBox.ActualReturnAll(false); } } } protected void OnChapterBoxClicked(IXUISprite sp) { bool bLevelIsMoving = this._bLevelIsMoving; if (!bLevelIsMoving) { base.uiBehaviour.m_BoxFrame.SetActive(true); int index = (int)sp.ID; base.uiBehaviour.m_BoxFetch.ID = sp.ID; base.uiBehaviour.m_BoxRedPoint.SetActive(false); XChapter.RowData chapter = XSingleton.singleton.GetChapter(this._SelectedChapter); bool flag = chapter == null; if (flag) { XSingleton.singleton.AddErrorLog("OnChapterBoxClicked chdata is null", null, null, null, null, null); } else { base.uiBehaviour.m_BoxChest.SetActive(false); base.uiBehaviour.m_BoxStar.gameObject.SetActive(true); base.uiBehaviour.m_BoxStar.SetText(chapter.Drop[index, 0] + "/" + this._ChapterTotalRank); bool flag2 = this._ChapterRank < chapter.Drop[index, 0]; if (flag2) { base.uiBehaviour.m_BoxFetch.SetEnable(false, false); base.uiBehaviour.m_BoxFetch.SetCaption(XStringDefineProxy.GetString("SRS_FETCH")); } else { bool flag3 = XSingleton.singleton.HasChapterBoxFetched(this._SelectedChapter, index); if (flag3) { base.uiBehaviour.m_BoxFetch.SetEnable(false, false); base.uiBehaviour.m_BoxFetch.SetCaption(XStringDefineProxy.GetString("SRS_FETCHED")); } else { base.uiBehaviour.m_BoxFetch.SetEnable(true, false); base.uiBehaviour.m_BoxRedPoint.SetActive(true); base.uiBehaviour.m_BoxFetch.SetCaption(XStringDefineProxy.GetString("SRS_FETCH")); } } this.SetupBoxReward(chapter.Drop[index, 1]); base.uiBehaviour.m_BoxFetch.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnChapterBoxFetch)); } } } protected void SetupBoxReward(int dropID) { base.uiBehaviour.m_BoxRewardPool.ReturnAll(false); XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; List dropData = xlevelDocument.GetDropData(dropID); bool flag = dropData != null; if (flag) { int num = (dropData.Count + 1) / 2 - 1; int num2 = (int)((float)((dropData.Count + 1) % 2) * base.uiBehaviour.m_BoxRewardPool.TplPos.x); Vector3 vector; vector = new Vector3((float)(num2 - num * base.uiBehaviour.m_BoxRewardPool.TplWidth), base.uiBehaviour.m_BoxRewardPool.TplPos.y); for (int i = 0; i < dropData.Count; i++) { XDropData xdropData = dropData[i]; GameObject gameObject = base.uiBehaviour.m_BoxRewardPool.FetchGameObject(false); gameObject.transform.localPosition = vector + new Vector3((float)(i * base.uiBehaviour.m_BoxRewardPool.TplWidth), 0f); XSingleton.singleton.normalItemDrawer.DrawItem(gameObject, xdropData.itemID, xdropData.count, false); IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; ixuisprite.ID = (ulong)((long)xdropData.itemID); ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton.singleton.OnItemClick)); } } } protected void OnChapterBoxBgClick(IXUISprite sp) { base.uiBehaviour.m_BoxFrame.SetActive(false); } protected bool OnChapterBoxFetch(IXUIButton go) { RpcC2G_FetchChapterChest rpcC2G_FetchChapterChest = new RpcC2G_FetchChapterChest(); rpcC2G_FetchChapterChest.oArg.chapterID = this._SelectedChapter; rpcC2G_FetchChapterChest.oArg.chestID = (int)go.ID; XSingleton.singleton.Send(rpcC2G_FetchChapterChest); return true; } protected bool OnSceneChestBoxFetch(IXUIButton go) { RpcC2G_OpenSceneChest rpcC2G_OpenSceneChest = new RpcC2G_OpenSceneChest(); rpcC2G_OpenSceneChest.oArg.sceneID = (uint)go.ID; XSingleton.singleton.Send(rpcC2G_OpenSceneChest); return true; } public void OnFetchSceneChestSucc() { base.uiBehaviour.m_BoxFrame.SetActive(false); this.UpdateSceneBox(); } public void OnFetchChapterBoxSucc() { base.uiBehaviour.m_BoxFrame.SetActive(false); XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; xlevelDocument.RefreshRedPoint(); this.SetupChapterBoxProgress(); } protected void _SetupDetailFrame(uint sceneID) { XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; XMainInterfaceDocument xmainInterfaceDocument = XSingleton.singleton.Doc.GetXComponent(XMainInterfaceDocument.uuID) as XMainInterfaceDocument; base.uiBehaviour.m_SceneDetail.gameObject.SetActive(true); this._SceneRemainTime = 9999u; SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(sceneID); int rank = XSingleton.singleton.GetRank((int)sceneID); uint sceneDifficult = (uint)XSingleton.singleton.GetSceneDifficult((int)sceneID); bool flag = sceneData == null; if (flag) { XSingleton.singleton.AddErrorLog("_SetupDetailFrame sceneData is null", null, null, null, null, null); } else { base.uiBehaviour.m_SceneRecommendHint.SetVisible(0 < sceneData.RecommendHint.Length); base.uiBehaviour.m_SceneRecommendHint.SetText(string.Format(" {0}", sceneData.RecommendHint)); bool flag2 = sceneDifficult == 0u; if (flag2) { base.uiBehaviour.m_SceneNormal.SetActive(true); base.uiBehaviour.m_SceneHard.SetActive(false); base.uiBehaviour.m_HardLeftCountGo1.SetActive(false); base.uiBehaviour.m_SceneSoloBattle.gameObject.SetActive(false); base.uiBehaviour.m_SceneTeamBattle.gameObject.SetActive(false); base.uiBehaviour.m_SceneGoBattle.gameObject.SetActive(true); } else { base.uiBehaviour.m_SceneNormal.SetActive(false); base.uiBehaviour.m_SceneHard.SetActive(true); base.uiBehaviour.m_HardLeftCountGo1.SetActive(true); base.uiBehaviour.m_SceneGoBattle.gameObject.SetActive(false); bool flag3 = rank <= 0; if (flag3) { base.uiBehaviour.m_SceneSoloBattle.gameObject.SetActive(false); base.uiBehaviour.m_SceneTeamBattle.gameObject.SetActive(true); base.uiBehaviour.m_SceneTeamBattle.gameObject.transform.localPosition = base.uiBehaviour.m_SceneGoBattle.gameObject.transform.localPosition; } else { base.uiBehaviour.m_SceneSoloBattle.gameObject.SetActive(false); base.uiBehaviour.m_SceneTeamBattle.gameObject.SetActive(true); base.uiBehaviour.m_SceneTeamBattle.gameObject.transform.localPosition = base.uiBehaviour.m_SceneTeamBattlePos; } } base.uiBehaviour.m_SceneName.SetText(sceneData.Comment); int num = -1; for (int i = 0; i < XLevelRewardDocument.Table.Table.Length; i++) { bool flag4 = XLevelRewardDocument.Table.Table[i].scendid == sceneID; if (flag4) { num = i; break; } } bool flag5 = num >= 0; if (flag5) { base.uiBehaviour.m_SceneStarCond[1].SetText(LevelRewardGerenalHandler.GetReqText(XLevelRewardDocument.Table.Table[num], 1)); base.uiBehaviour.m_SceneStarCond[2].SetText(LevelRewardGerenalHandler.GetReqText(XLevelRewardDocument.Table.Table[num], 2)); } for (int j = 0; j < 3; j++) { bool rankDetail = XSingleton.singleton.GetRankDetail((int)sceneID, j); if (rankDetail) { base.uiBehaviour.m_SceneStar[j].SetColor(Color.white); } else { base.uiBehaviour.m_SceneStar[j].SetColor(Color.grey); } } base.uiBehaviour.m_SceneDropPool.ReturnAll(false); Vector3 tplPos = base.uiBehaviour.m_SceneDropPool.TplPos; int tplWidth = base.uiBehaviour.m_SceneDropPool.TplWidth; int tplHeight = base.uiBehaviour.m_SceneDropPool.TplHeight; bool flag6 = XSingleton.singleton.XPlayerData != null; if (flag6) { int num2 = (int)(xlevelDocument.GetExpAddition((int)XSingleton.singleton.XPlayerData.Level) * (double)sceneData.Exp); base.uiBehaviour.m_DropExpLab.SetText(num2.ToString()); } bool flag7 = sceneData.Money == 0; if (flag7) { base.uiBehaviour.m_DropExpLab1.gameObject.transform.parent.gameObject.SetActive(false); } else { base.uiBehaviour.m_DropExpLab1.gameObject.transform.parent.gameObject.SetActive(true); base.uiBehaviour.m_DropExpLab1.SetText(sceneData.Money.ToString()); } int num3 = (sceneData.ViewableDropList != null) ? sceneData.ViewableDropList.Length : 0; int num4 = 6; int num5 = Mathf.Max(num3, num4); for (int k = 0; k < num5; k++) { int num6 = k; GameObject gameObject = base.uiBehaviour.m_SceneDropPool.FetchGameObject(false); gameObject.name = k.ToString(); gameObject.transform.localPosition = tplPos + new Vector3((float)(tplWidth * num6), 0f, 0f); gameObject.transform.localScale = Vector3.one; GameObject gameObject2 = gameObject.transform.Find("Item").gameObject; bool flag8 = k >= num3 && k < num4; if (flag8) { gameObject2.SetActive(false); } else { gameObject2.SetActive(true); XSingleton.singleton.normalItemDrawer.DrawItem(gameObject2, sceneData.ViewableDropList[k], 0, false); IXUISprite ixuisprite = gameObject2.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; ixuisprite.ID = (ulong)sceneData.ViewableDropList[k]; ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickItemIcon)); } } int playerPPT = xmainInterfaceDocument.GetPlayerPPT(); string difficulty = XLevelDocument.GetDifficulty(playerPPT, sceneData.RecommendPower); base.uiBehaviour.m_SceneHint.SetText(difficulty); base.uiBehaviour.m_SceneRecommendPPT.SetText(string.Format("{0}{1}[-]", difficulty.Substring(0, 8), sceneData.RecommendPower)); base.uiBehaviour.m_SceneMyPPT.SetText(playerPPT.ToString()); bool flag9 = this._SelectDifficult == 1u; if (flag9) { bool flag10 = playerPPT >= sceneData.SweepNeedPPT; string arg; if (flag10) { arg = "[9ce500]"; } else { arg = "[e30000]"; } bool flag11 = XSingleton.singleton.XPlayerData != null; if (flag11) { bool flag12 = (ulong)XSingleton.singleton.XPlayerData.Level < (ulong)((long)XSingleton.singleton.GetInt("SweepPPTLevelLimit")); if (flag12) { base.uiBehaviour.m_SweepPPT.gameObject.SetActive(false); base.uiBehaviour.m_SweepPPTName.SetActive(false); } else { base.uiBehaviour.m_SweepPPT.gameObject.SetActive(true); base.uiBehaviour.m_SweepPPT.SetText(string.Format("{0}{1}[-]", arg, sceneData.SweepNeedPPT)); base.uiBehaviour.m_SweepPPTName.SetActive(true); base.uiBehaviour.m_SweepTicketLab.SetText(XBagDocument.BagDoc.GetItemCount(XSingleton.singleton.GetInt("SweepTicketId")).ToString()); } } base.uiBehaviour.m_SceneQuick10Lab.SetText(string.Format(XStringDefineProxy.GetString("SWEEP_TITLE"), 5)); } else { base.uiBehaviour.m_SweepPPT.SetText(""); base.uiBehaviour.m_SweepPPTName.SetActive(false); base.uiBehaviour.m_SceneQuick10Lab.SetText(string.Format(XStringDefineProxy.GetString("SWEEP_TITLE"), 10)); } uint num7 = sceneData.DayLimitGroupID; bool flag13 = num7 == 0u; if (flag13) { num7 = sceneID; } uint num8 = 0u; bool flag14 = xlevelDocument.SceneDayEnter.TryGetValue(num7, out num8); if (flag14) { this._SceneRemainTime = (uint)sceneData.DayLimit - num8; bool flag15 = (long)sceneData.DayLimit - (long)((ulong)num8) == 0L; if (flag15) { base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(false); base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(false); } else { base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(true); base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(true); } } else { base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(true); base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(true); } bool flag16 = rank < 3; if (flag16) { base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(false); base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(false); base.uiBehaviour.m_SweepTicketGo.SetActive(false); base.uiBehaviour.m_SceneFirstSSS.SetActive(true); string text = ""; for (int l = 0; l < sceneData.FirstSSS.Count; l++) { text += XLabelSymbolHelper.FormatCostWithIcon((int)sceneData.FirstSSS[l, 1], (ItemEnum)sceneData.FirstSSS[l, 0]); } base.uiBehaviour.m_SceneFirstSSSReward.InputText = text; } else { bool flag17 = this._SelectDifficult == 0u; if (flag17) { base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(true); base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(true); base.uiBehaviour.m_SweepTicketGo.SetActive(false); } else { bool flag18 = XSingleton.singleton.XPlayerData != null; if (flag18) { bool flag19 = (ulong)XSingleton.singleton.XPlayerData.Level < (ulong)((long)XSingleton.singleton.GetInt("SweepPPTLevelLimit")); if (flag19) { base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(false); base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(false); base.uiBehaviour.m_SweepTicketGo.SetActive(false); } else { base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(true); base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(true); base.uiBehaviour.m_SweepTicketGo.SetActive(true); } } } base.uiBehaviour.m_SceneFirstSSS.SetActive(false); } base.uiBehaviour.m_Cost.InputText = XLabelSymbolHelper.FormatCostWithIcon(sceneData.FatigueCost[0, 1], ItemEnum.FATIGUE); base.uiBehaviour.m_SceneSoloBattleCost.InputText = XLabelSymbolHelper.FormatCostWithIcon(sceneData.FatigueCost[0, 1], ItemEnum.FATIGUE); base.uiBehaviour.m_SceneTeamBattleCost.InputText = XLabelSymbolHelper.FormatCostWithIcon(sceneData.FatigueCost[0, 1], ItemEnum.FATIGUE); } } private void OnClickItemIcon(IXUISprite spr) { XItem mainItem = XBagDocument.MakeXItem((int)spr.ID, false); XSingleton.singleton.ShowTooltipDialogWithSearchingCompare(mainItem, spr, false, 0u); } private void OnSceneSelected(IXUISprite sp) { XLevelDocument xlevelDocument = XSingleton.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument; this._SelectScene = (uint)sp.ID; bool flag = this._FirstNoRankScene > 0u; if (flag) { bool flag2 = this._SelectScene == this._FirstNoRankScene; if (flag2) { SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(this._SelectScene); bool flag3 = sceneData == null; if (flag3) { XSingleton.singleton.AddErrorLog("OnSceneSelected sceneData is null", null, null, null, null, null); return; } SceneRefuseReason sceneRefuseReason = xlevelDocument.CanLevelOpen(this._SelectScene); bool flag4 = sceneRefuseReason == SceneRefuseReason.PreTask_Notfinish; if (flag4) { base.uiBehaviour.m_MainHintText.SetText(string.Format(XStringDefineProxy.GetString("LEVEl_REQUIRE_TASK"), sceneData.RequiredLevel)); base.uiBehaviour.m_MainHint.PlayTween(true, -1f); return; } bool flag5 = sceneRefuseReason == SceneRefuseReason.PreScene_Notfinish; if (flag5) { int unFinishedPreSceneID = xlevelDocument.GetUnFinishedPreSceneID(sceneData); SceneTable.RowData sceneData2 = XSingleton.singleton.GetSceneData((uint)unFinishedPreSceneID); bool flag6 = sceneData2 != null; if (flag6) { base.uiBehaviour.m_MainHintText.SetText(string.Format(XStringDefineProxy.GetString("LEVEL_REQUIRE_PRELEVEL"), sceneData2.Comment)); } base.uiBehaviour.m_MainHint.PlayTween(true, -1f); return; } bool flag7 = sceneRefuseReason == SceneRefuseReason.Level_NotEnough; if (flag7) { base.uiBehaviour.m_MainHintText.SetText(string.Format(XStringDefineProxy.GetString("LEVEL_REQUIRE_LEVEL"), sceneData.RequiredLevel)); base.uiBehaviour.m_MainHint.PlayTween(true, -1f); return; } bool flag8 = sceneRefuseReason == SceneRefuseReason.ReachLimitTimes; if (flag8) { base.uiBehaviour.m_MainHintText.SetText(XStringDefineProxy.GetString("LEVEL_REACH_LIMIT_TIMES")); base.uiBehaviour.m_MainHint.PlayTween(false, -1f); return; } } bool flag9 = this._SelectScene > this._FirstNoRankScene; if (flag9) { base.uiBehaviour.m_MainHintText.SetText(string.Format(XStringDefineProxy.GetString("LEVEL_REQUIRE_DEFAULT"), new object[0])); base.uiBehaviour.m_MainHint.PlayTween(true, -1f); return; } } this._SetupDetailFrame(this._SelectScene); } public void OnPlayerLevelUp() { bool flag = base.IsVisible(); if (flag) { this.SetupChapterImage(); } } public void OnGotSweepRes() { bool flag = base.IsVisible(); if (flag) { this.SetupChapterImage(); } } public bool OnDetailClose(IXUIButton go) { base.uiBehaviour.m_SceneDetail.SetActive(false); return true; } public void RefreshHardLeftCount() { XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument(XExpeditionDocument.uuID); int dayCount = specificDocument.GetDayCount(TeamLevelType.TeamLevelAbyss, null); int dayMaxCount = specificDocument.GetDayMaxCount(TeamLevelType.TeamLevelAbyss, null); string text = string.Format("{0}/{1}", dayCount, dayMaxCount); base.uiBehaviour.m_HardLeftCount1.SetText(text); bool flag = this._welfareDoc.IsOwnMemberPrivilege(MemberPrivilege.KingdomPrivilege_Adventurer); if (flag) { int num = 0; PayMemberTable.RowData memberPrivilegeConfig = this._welfareDoc.GetMemberPrivilegeConfig(MemberPrivilege.KingdomPrivilege_Adventurer); bool flag2 = memberPrivilegeConfig != null; if (flag2) { num = memberPrivilegeConfig.AbyssCount; } int num2 = 0; bool flag3 = this._welfareDoc.PayMemberPrivilege != null; if (flag3) { num2 = this._welfareDoc.PayMemberPrivilege.usedAbyssCount; } bool flag4 = num2 >= num; if (flag4) { base.uiBehaviour.m_HardLeftCount0.SetText(string.Format("{0}/{1}", dayCount, dayMaxCount)); base.uiBehaviour.m_HardLeftCount1.SetText(string.Format("{0}/{1}", dayCount, dayMaxCount)); } else { base.uiBehaviour.m_HardLeftCount0.SetText(string.Format("[ffb400][c]{0}[/c][-]/{1}", dayCount, dayMaxCount)); base.uiBehaviour.m_HardLeftCount1.SetText(string.Format("[ffb400][c]{0}[/c][-]/{1}", dayCount, dayMaxCount)); } } else { base.uiBehaviour.m_HardLeftCount0.SetText(string.Format("{0}/{1}", dayCount, dayMaxCount)); base.uiBehaviour.m_HardLeftCount1.SetText(string.Format("{0}/{1}", dayCount, dayMaxCount)); } } private void _OnAddHardCountClicked(IXUISprite iSp) { DlgBase.singleton.ActiveShow(TeamLevelType.TeamLevelAbyss); } private bool OnShopBtnClick(IXUIButton btn) { SeqList sequenceList = XSingleton.singleton.GetSequenceList("AbyssTeamShopLevel", true); List intList = XSingleton.singleton.GetIntList("AbyssTeamShopType"); int num = 0; bool flag = XSingleton.singleton.XPlayerData != null; if (flag) { num = (int)XSingleton.singleton.XPlayerData.Level; } for (int i = 0; i < (int)sequenceList.Count; i++) { bool flag2 = num >= sequenceList[i, 0] && num <= sequenceList[i, 1]; if (flag2) { XSysDefine xsysDefine = (XSysDefine)(XFastEnumIntEqualityComparer.ToInt(XSysDefine.XSys_Mall_MystShop) + intList[i]); bool flag3 = XSingleton.singleton.IsSystemOpened(xsysDefine); bool result; if (flag3) { DlgBase.singleton.ShowShopSystem(xsysDefine, 0UL); result = true; } else { int sysOpenLevel = XSingleton.singleton.GetSysOpenLevel(XFastEnumIntEqualityComparer.ToInt(xsysDefine)); XSingleton.singleton.ShowSystemTip(string.Format(XStringDefineProxy.GetString("SHOP_OPEN_LEVEL"), sysOpenLevel), "fece00"); result = false; } return result; } } XSingleton.singleton.AddErrorLog("Can't find player level state from golbalconfig by AbyssTeamShop. level = ", num.ToString(), null, null, null, null); return true; } } }