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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
using System;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class SkyArenaBattleHandler : DlgHandlerBase
{
protected override string FileName
{
get
{
return "Battle/SkyArenaBattle";
}
}
private XSkyArenaBattleDocument doc = null;
private SkyCityTimeType m_CurStatus;
private XLeftTimeCounter _CDCounter;
private Transform m_Info;
private IXUILabel m_BlueScore;
private IXUILabel m_RedScore;
private IXUILabel m_BlueDamage;
private IXUILabel m_RedDamage;
private IXUILabel m_TimeLabel;
private IXUILabel m_RestTip;
protected override void Init()
{
base.Init();
this.doc = XDocuments.GetSpecificDocument<XSkyArenaBattleDocument>(XSkyArenaBattleDocument.uuID);
this.doc.BattleHandler = this;
this.m_Info = base.transform.Find("Bg/Info");
this.m_BlueScore = (base.transform.Find("Bg/Info/Blue/Score").GetComponent("XUILabel") as IXUILabel);
this.m_RedScore = (base.transform.Find("Bg/Info/Red/Score").GetComponent("XUILabel") as IXUILabel);
this.m_BlueDamage = (base.transform.Find("Bg/Info/Blue/Damage").GetComponent("XUILabel") as IXUILabel);
this.m_RedDamage = (base.transform.Find("Bg/Info/Red/Damage").GetComponent("XUILabel") as IXUILabel);
this.m_RestTip = (base.transform.Find("Bg/start").GetComponent("XUILabel") as IXUILabel);
this.m_TimeLabel = (base.transform.Find("Bg/Time").GetComponent("XUILabel") as IXUILabel);
this.m_TimeLabel.SetText(XSingleton<XStringTable>.singleton.GetString("SKY_ARENA_BEGIN_WAIT_TIP"));
this._CDCounter = new XLeftTimeCounter(this.m_TimeLabel, false);
}
public override void RegisterEvent()
{
}
protected override void OnShow()
{
base.OnShow();
this.RefreshInfo();
}
protected override void OnHide()
{
base.OnHide();
}
public override void OnUnload()
{
this.doc.BattleHandler = null;
base.OnUnload();
}
public override void OnUpdate()
{
base.OnUpdate();
this._CDCounter.Update();
}
private void RefreshInfo()
{
this.m_BlueScore.SetText("0");
this.m_RedScore.SetText("0");
this.m_BlueDamage.SetText("0");
this.m_RedDamage.SetText("0");
DlgBase<BattleMain, BattleMainBehaviour>.singleton.HideLeftTime();
this.m_RestTip.gameObject.SetActive(false);
}
public void SetScore(uint score, bool isBlue)
{
if (isBlue)
{
this.m_BlueScore.SetText(score.ToString());
}
else
{
this.m_RedScore.SetText(score.ToString());
}
}
public void SetDamage(ulong damage, bool isBlue)
{
if (isBlue)
{
this.m_BlueDamage.SetText(damage.ToString());
}
else
{
this.m_RedDamage.SetText(damage.ToString());
}
}
public void RefreshStatusTime(SkyCityTimeType status, uint time)
{
XSingleton<XDebug>.singleton.AddGreenLog(string.Concat(new object[]
{
"status:",
status,
"\ntime:",
time
}), null, null, null, null, null);
bool flag = time == 0u;
if (!flag)
{
bool flag2 = status == SkyCityTimeType.Race;
if (flag2)
{
bool flag3 = this.m_TimeLabel.IsVisible();
if (flag3)
{
this.m_TimeLabel.gameObject.SetActive(false);
}
DlgBase<BattleMain, BattleMainBehaviour>.singleton.SetLeftTime(time, -1);
XSingleton<UiUtility>.singleton.SetMiniMapOpponentStatus(false);
this.m_RestTip.gameObject.SetActive(false);
}
else
{
bool flag4 = status == SkyCityTimeType.FirstWaiting;
if (flag4)
{
bool flag5 = !this.m_TimeLabel.IsVisible();
if (flag5)
{
this.m_TimeLabel.gameObject.SetActive(true);
}
this._CDCounter.SetLeftTime(time, -1);
this._CDCounter.SetFinishEventHandler(null, null);
this._CDCounter.SetFormatString(XSingleton<XStringTable>.singleton.GetString("SKY_ARENA_REST_TIME"));
bool flag6 = this.m_CurStatus != status;
if (flag6)
{
DlgBase<XShowGetItemView, XShowGetItemBehaviour>.singleton.ShowTip(XSingleton<XStringTable>.singleton.GetString("SKY_ARENA_ROUND_END_REST"));
}
DlgBase<BattleMain, BattleMainBehaviour>.singleton.HideLeftTime();
XSingleton<UiUtility>.singleton.SetMiniMapOpponentStatus(true);
this.m_RestTip.gameObject.SetActive(true);
}
else
{
bool flag7 = status == SkyCityTimeType.SecondWaiting;
if (flag7)
{
bool flag8 = this.m_CurStatus == status;
if (flag8)
{
return;
}
bool flag9 = !this.m_TimeLabel.IsVisible();
if (flag9)
{
this.m_TimeLabel.gameObject.SetActive(true);
}
this._CDCounter.SetLeftTime(time, -1);
this._CDCounter.SetFinishEventHandler(new TimeOverFinishEventHandler(this._OnLeftTimeOver), null);
this._CDCounter.SetFormatString(XSingleton<XStringTable>.singleton.GetString("SKY_ARENA_NEXT_BATTLE_TIME"));
this.HideInfo();
DlgBase<BattleMain, BattleMainBehaviour>.singleton.HideLeftTime();
XSingleton<UiUtility>.singleton.SetMiniMapOpponentStatus(true);
}
else
{
bool flag10 = status == SkyCityTimeType.MidleEndInRest;
if (flag10)
{
}
}
}
}
this.m_CurStatus = status;
}
}
private void _OnLeftTimeOver(object o)
{
this.m_TimeLabel.SetText(XSingleton<XStringTable>.singleton.GetString("SKY_ARENA_MATCHING"));
}
public void HideTime()
{
DlgBase<BattleMain, BattleMainBehaviour>.singleton.HideLeftTime();
this.m_TimeLabel.gameObject.SetActive(false);
}
private void HideInfo()
{
this.m_Info.gameObject.SetActive(false);
}
}
}
|