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/MailSystemDlg.cs | 94 ++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/MailSystemDlg.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/MailSystemDlg.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/MailSystemDlg.cs b/Client/Assets/Scripts/XMainClient/UI/MailSystemDlg.cs new file mode 100644 index 00000000..9b807db7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/MailSystemDlg.cs @@ -0,0 +1,94 @@ +using System; +using UnityEngine; +using XMainClient.Utility; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class MailSystemDlg : TabDlgBase + { + public override string fileName + { + get + { + return "GameSystem/MailDlg"; + } + } + + public override int group + { + get + { + return 1; + } + } + + public XSystemMailView _systemFrameView; + + public XPlayerMailView _playerFrameView; + + public XContentMailView _contMailView; + + private XMailDocument _doc = null; + + public GameObject m_systemFramePanel; + + public GameObject m_playerFramePanel; + + public GameObject m_contentFramePanel; + + public Transform tabTpl; + + public XUITabControl m_tabcontrol = new XUITabControl(); + + protected override void Init() + { + base.Init(); + base.RegisterSubSysRedPointMgr(XSysDefine.XSys_Mail); + this._doc = (XSingleton.singleton.Doc.GetXComponent(XMailDocument.uuID) as XMailDocument); + } + + protected override void OnLoad() + { + base.OnLoad(); + this.tabTpl = base.uiBehaviour.transform.Find("Bg/Tabs/TabTpl"); + this.m_tabcontrol.SetTabTpl(this.tabTpl); + this.m_systemFramePanel = base.uiBehaviour.transform.Find("Bg/SystemFrame").gameObject; + this.m_systemFramePanel.SetActive(true); + this.m_playerFramePanel = base.uiBehaviour.transform.Find("Bg/PlayerFrame").gameObject; + this.m_playerFramePanel.SetActive(false); + this.m_contentFramePanel = base.uiBehaviour.transform.Find("Bg/ContentFrame").gameObject; + this.m_contentFramePanel.SetActive(true); + } + + protected override void OnUnload() + { + DlgHandlerBase.EnsureUnload(ref this._systemFrameView); + DlgHandlerBase.EnsureUnload(ref this._playerFrameView); + DlgHandlerBase.EnsureUnload(ref this._contMailView); + base.OnUnload(); + } + + public override void SetupHandlers(XSysDefine sys) + { + this._doc = (XSingleton.singleton.Doc.GetXComponent(XMailDocument.uuID) as XMailDocument); + base._AddActiveHandler(DlgHandlerBase.EnsureCreate(ref this._contMailView, this.m_contentFramePanel, null, true)); + XSysDefine xsysDefine = sys; + if (xsysDefine != XSysDefine.XSys_Mail_System) + { + if (xsysDefine != XSysDefine.XSys_Mail_Player) + { + XSingleton.singleton.AddErrorLog("System has not finished:", sys.ToString(), null, null, null, null); + } + else + { + base._AddActiveHandler(DlgHandlerBase.EnsureCreate(ref this._playerFrameView, this.m_playerFramePanel, this, true)); + } + } + else + { + base._AddActiveHandler(DlgHandlerBase.EnsureCreate(ref this._systemFrameView, this.m_systemFramePanel, this, true)); + } + } + } +} -- cgit v1.1-26-g67d0