summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/MailSystemDlg.cs
blob: 9b807db73233f8a4cd97ef67a7b2ba78fe44ddce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using UnityEngine;
using XMainClient.Utility;
using XUtliPoolLib;

namespace XMainClient.UI
{
	internal class MailSystemDlg : TabDlgBase<MailSystemDlg>
	{
		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<XGame>.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<XSystemMailView>(ref this._systemFrameView);
			DlgHandlerBase.EnsureUnload<XPlayerMailView>(ref this._playerFrameView);
			DlgHandlerBase.EnsureUnload<XContentMailView>(ref this._contMailView);
			base.OnUnload();
		}

		public override void SetupHandlers(XSysDefine sys)
		{
			this._doc = (XSingleton<XGame>.singleton.Doc.GetXComponent(XMailDocument.uuID) as XMailDocument);
			base._AddActiveHandler(DlgHandlerBase.EnsureCreate<XContentMailView>(ref this._contMailView, this.m_contentFramePanel, null, true));
			XSysDefine xsysDefine = sys;
			if (xsysDefine != XSysDefine.XSys_Mail_System)
			{
				if (xsysDefine != XSysDefine.XSys_Mail_Player)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("System has not finished:", sys.ToString(), null, null, null, null);
				}
				else
				{
					base._AddActiveHandler(DlgHandlerBase.EnsureCreate<XPlayerMailView>(ref this._playerFrameView, this.m_playerFramePanel, this, true));
				}
			}
			else
			{
				base._AddActiveHandler(DlgHandlerBase.EnsureCreate<XSystemMailView>(ref this._systemFrameView, this.m_systemFramePanel, this, true));
			}
		}
	}
}