From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Assets/Scripts/XMainClient/UI/SuperRiskDlg.cs | 156 +++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/SuperRiskDlg.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/SuperRiskDlg.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/SuperRiskDlg.cs b/Client/Assets/Scripts/XMainClient/UI/SuperRiskDlg.cs new file mode 100644 index 00000000..962d67ad --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/SuperRiskDlg.cs @@ -0,0 +1,156 @@ +using System; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class SuperRiskDlg : DlgBase + { + private XSuperRiskDocument _doc + { + get + { + return XSuperRiskDocument.Doc; + } + } + + public override string fileName + { + get + { + return "GameSystem/SuperRisk/SuperRiskDlg"; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + public override bool hideMainMenu + { + get + { + return true; + } + } + + public override bool fullscreenui + { + get + { + return true; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + private SuperRiskSelectMapHandler _SelectMapHandler; + + private SuperRiskGameHandler _GameHandler; + + protected override void Init() + { + DlgHandlerBase.EnsureCreate(ref this._GameHandler, base.uiBehaviour.m_RiskMapPanel.transform, false, null); + DlgHandlerBase.EnsureCreate(ref this._SelectMapHandler, base.uiBehaviour.m_SelectMapPanel.transform, false, null); + } + + protected override void OnLoad() + { + base.OnLoad(); + } + + protected override void OnUnload() + { + DlgHandlerBase.EnsureUnload(ref this._SelectMapHandler); + DlgHandlerBase.EnsureUnload(ref this._GameHandler); + base.OnUnload(); + } + + public override void LeaveStackTop() + { + bool flag = this._GameHandler != null && this._GameHandler.IsVisible(); + if (flag) + { + this._GameHandler.LeaveStackTop(); + } + base.LeaveStackTop(); + } + + public override void RegisterEvent() + { + } + + protected override void OnHide() + { + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_SuperRisk, true); + base.OnHide(); + } + + protected override void OnShow() + { + bool isNeedEnterMainGame = this._doc.IsNeedEnterMainGame; + if (isNeedEnterMainGame) + { + this.ShowGameMap(); + XSuperRiskDocument.Doc.IsNeedEnterMainGame = false; + } + else + { + this.ShowSelectMap(); + } + } + + public override void OnUpdate() + { + base.OnUpdate(); + bool flag = this._GameHandler != null && this._GameHandler.IsVisible(); + if (flag) + { + this._GameHandler.OnUpdate(); + } + } + + public override void StackRefresh() + { + base.StackRefresh(); + bool flag = this._GameHandler != null && this._GameHandler.IsVisible(); + if (flag) + { + this._GameHandler.StackRefresh(); + } + } + + public void Show(bool isNeedEnterMainGame, int mapId = 0) + { + this._doc.CurrentMapID = mapId; + bool flag = !this._doc.IsNeedEnterMainGame; + if (flag) + { + this._doc.IsNeedEnterMainGame = isNeedEnterMainGame; + } + this.SetVisibleWithAnimation(true, null); + } + + public void ShowGameMap() + { + this._SelectMapHandler.SetVisible(false); + this._GameHandler.SetVisible(true); + } + + public void ShowSelectMap() + { + this._GameHandler.SetVisible(false); + this._SelectMapHandler.SetVisible(true); + } + } +} -- cgit v1.1-26-g67d0