summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/CutoverViewView.cs
blob: 5103899dd87aca3727dcddbaa743a10ac6b084a1 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
using System;
using UILib;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient
{
	internal class CutoverViewView : DlgBase<CutoverViewView, CutoverViewBehaviour>
	{
		public override string fileName
		{
			get
			{
				return "Battle/CutoverViewDlg";
			}
		}

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

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

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

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

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

		private uint _TimerID = 0u;

		public bool IsOpening = false;

		public XOperationMode SelectLook;

		protected override void Init()
		{
		}

		public override void RegisterEvent()
		{
			base.uiBehaviour.m_OK.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnOKClicked));
			base.uiBehaviour.m_25D.ID = (ulong)((long)XFastEnumIntEqualityComparer<XOperationMode>.ToInt(XOperationMode.X25D));
			base.uiBehaviour.m_25D.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSetView));
			base.uiBehaviour.m_3D.ID = (ulong)((long)XFastEnumIntEqualityComparer<XOperationMode>.ToInt(XOperationMode.X3D));
			base.uiBehaviour.m_3D.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSetView));
		}

		protected override void OnShow()
		{
			base.OnShow();
			XSingleton<XPostEffectMgr>.singleton.MakeEffectEnable(XPostEffect.GausBlur, true);
			DlgBase<XChatMaqueeView, XChatMaqueeBehaviour>.singleton.SetMaqueeSwitch(false);
			this.IsOpening = true;
			base.uiBehaviour.m_25D.bChecked = true;
			this.SelectLook = XOperationMode.X25D;
			XSingleton<XTimerMgr>.singleton.KillTimer(this._TimerID);
			this._TimerID = XSingleton<XTimerMgr>.singleton.SetTimer(float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("CutoverViewDeadLine")), new XTimerMgr.ElapsedEventHandler(this.SelectView), null);
		}

		protected override void OnHide()
		{
			base.OnHide();
			XSingleton<XTimerMgr>.singleton.KillTimer(this._TimerID);
			this._TimerID = 0u;
			XSingleton<XPostEffectMgr>.singleton.MakeEffectEnable(XPostEffect.GausBlur, false);
			DlgBase<XChatMaqueeView, XChatMaqueeBehaviour>.singleton.SetMaqueeSwitch(true);
			this.IsOpening = false;
		}

		protected override void OnUnload()
		{
			XSingleton<XTimerMgr>.singleton.KillTimer(this._TimerID);
			this._TimerID = 0u;
			XSingleton<XPostEffectMgr>.singleton.MakeEffectEnable(XPostEffect.GausBlur, false);
			DlgBase<XChatMaqueeView, XChatMaqueeBehaviour>.singleton.SetMaqueeSwitch(true);
			this.IsOpening = false;
			base.OnUnload();
		}

		public override void OnUpdate()
		{
			base.OnUpdate();
		}

		public bool OnOKClicked(IXUIButton sp)
		{
			this.SelectView(null);
			return true;
		}

		private void SelectView(object param)
		{
			XSingleton<XTutorialHelper>.singleton.SelectView = true;
			XOptionsDocument specificDocument = XDocuments.GetSpecificDocument<XOptionsDocument>(XOptionsDocument.uuID);
			specificDocument.SetValue(XOptionsDefine.OD_VIEW, XFastEnumIntEqualityComparer<XOperationMode>.ToInt(this.SelectLook), true);
			specificDocument.SetBattleOptionValue();
			DlgBase<BattleMain, BattleMainBehaviour>.singleton.SetView(XSingleton<XOperationData>.singleton.OperationMode);
			XSingleton<XFxMgr>.singleton.CreateAndPlay("Effects/FX_Particle/UIfx/UI_BattleDlg_Clip01", DlgBase<BattleMain, BattleMainBehaviour>.singleton.uiBehaviour.m_canvas, Vector3.zero, Vector3.one, 1f, true, 9f, true);
			this.SetVisibleWithAnimation(false, null);
		}

		private bool OnSetView(IXUICheckBox box)
		{
			bool flag = !box.bChecked;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				this.SelectLook = (XOperationMode)box.ID;
				result = true;
			}
			return result;
		}
	}
}