summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/XPatfaceView.cs
blob: 90804ec7f03b662c6b3b148e4f29b1c26ed900a5 (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
95
96
97
98
99
100
101
102
using System;
using UILib;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient
{
	internal class XPatfaceView : DlgBase<XPatfaceView, XPatfaceBehaviour>
	{
		public override string fileName
		{
			get
			{
				return "Hall/PatfaceDlg";
			}
		}

		public override int group
		{
			get
			{
				return 1;
			}
		}

		public override bool autoload
		{
			get
			{
				return true;
			}
		}

		public override bool isMainUI
		{
			get
			{
				return true;
			}
		}

		public override bool pushstack
		{
			get
			{
				return true;
			}
		}

		private XAnnouncementDocument doc;

		public bool bShow = false;

		protected override void Init()
		{
			base.Init();
			this.doc = XDocuments.GetSpecificDocument<XAnnouncementDocument>(XAnnouncementDocument.uuID);
		}

		protected override void OnHide()
		{
			base.OnHide();
			base.uiBehaviour.m_Pic.SetTexturePath("");
		}

		public override void RegisterEvent()
		{
			base.RegisterEvent();
			base.uiBehaviour.m_OK.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnEnterClicked));
		}

		private bool OnEnterClicked(IXUIButton button)
		{
			this.bShow = true;
			this.doc.SendClickNotice(this.doc.NoticeList[(int)button.ID]);
			return true;
		}

		public void ShowPatface()
		{
			bool flag = !this.bShow;
			if (!flag)
			{
				this.bShow = false;
				this.doc = XDocuments.GetSpecificDocument<XAnnouncementDocument>(XAnnouncementDocument.uuID);
				for (int i = 0; i < this.doc.NoticeList.Count; i++)
				{
					bool flag2 = this.doc.NoticeList[i].type != 5u || !this.doc.NoticeList[i].isnew;
					if (!flag2)
					{
						this.SetVisible(true, true);
						XSingleton<XUICacheImage>.singleton.Load(this.doc.NoticeList[i].content, base.uiBehaviour.m_Pic, base.uiBehaviour);
						base.uiBehaviour.m_OK.ID = (ulong)i;
						return;
					}
				}
				XSingleton<XPandoraSDKDocument>.singleton.CheckPandoraPLPanel();
				this.SetVisible(false, true);
			}
		}
	}
}