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
|
using System;
using UILib;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class GuildArenaDuelRoundResultDlg : DlgBase<GuildArenaDuelRoundResultDlg, GuildArenaDuelRoundResultBehaviour>
{
public override string fileName
{
get
{
return "Battle/GuildArenaDuelRoundResultDlg";
}
}
public override int layer
{
get
{
return 1;
}
}
public override bool autoload
{
get
{
return true;
}
}
private XGuildArenaBattleDocument _Doc;
private XElapseTimer m_lastTime;
private bool Countdown = false;
private bool mDone = false;
protected override void Init()
{
base.Init();
this._Doc = XDocuments.GetSpecificDocument<XGuildArenaBattleDocument>(XGuildArenaBattleDocument.uuID);
}
public override void RegisterEvent()
{
base.RegisterEvent();
}
protected override void OnShow()
{
base.OnShow();
this.OnHideBattle();
this.RefreshData();
this.RefreahCountTime((float)XSingleton<XGlobalConfig>.singleton.GetInt("GPRFightAfterTime"), true);
}
private void OnHideBattle()
{
bool bSpectator = XSingleton<XScene>.singleton.bSpectator;
if (bSpectator)
{
bool flag = DlgBase<SpectateSceneView, SpectateSceneBehaviour>.singleton.IsLoaded();
if (flag)
{
DlgBase<SpectateSceneView, SpectateSceneBehaviour>.singleton.SetVisible(false, true);
}
}
else
{
bool flag2 = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsLoaded();
if (flag2)
{
DlgBase<BattleMain, BattleMainBehaviour>.singleton.SetVisible(false, true);
}
}
}
private void RefreshData()
{
base.uiBehaviour.m_RoundLabel.SetText(XStringDefineProxy.GetString("GUILD_ARENA_ROUNDLABEL", new object[]
{
this._Doc.Round
}));
base.uiBehaviour.m_Blue.Set(this._Doc.BlueDuelResult);
base.uiBehaviour.m_Red.Set(this._Doc.RedDuelResult);
bool flag = this._Doc.BlueDuelResult.RoleCombats.Count == 0 && this._Doc.RedDuelResult.RoleCombats.Count == 0;
base.uiBehaviour.m_EmptyWin.gameObject.SetActive(flag);
bool flag2 = flag;
if (flag2)
{
bool isWinner = this._Doc.BlueDuelResult.isWinner;
if (isWinner)
{
base.uiBehaviour.m_GuildName.SetText(this._Doc.BlueDuelResult.Guild.guildname);
}
else
{
bool isWinner2 = this._Doc.RedDuelResult.isWinner;
if (isWinner2)
{
base.uiBehaviour.m_GuildName.SetText(this._Doc.RedDuelResult.Guild.guildname);
}
else
{
base.uiBehaviour.m_GuildName.SetText(string.Empty);
}
}
}
}
private void ClickClose(IXUISprite sprite)
{
this.ReturnHall();
}
protected override void OnUnload()
{
this.m_lastTime = null;
base.OnUnload();
}
public void RefreahCountTime(float time, bool Done)
{
bool flag = this.m_lastTime == null;
if (flag)
{
this.m_lastTime = new XElapseTimer();
}
bool flag2 = !this._Doc.InBattleGroup;
if (flag2)
{
this.m_lastTime.LeftTime = time - 2f;
}
else
{
this.m_lastTime.LeftTime = time;
}
this.Countdown = true;
this.mDone = Done;
}
public override void OnUpdate()
{
base.OnUpdate();
this.UpdateCountTime();
}
private void UpdateCountTime()
{
bool flag = !this.Countdown || this.m_lastTime == null;
if (!flag)
{
this.m_lastTime.Update();
bool flag2 = this.m_lastTime.LeftTime > 0f;
if (flag2)
{
bool flag3 = this._Doc.Round == 3u;
if (flag3)
{
base.uiBehaviour.m_TimeLabel.SetText(XStringDefineProxy.GetString("GUILD_ARENA_FINALWATTING", new object[]
{
XSingleton<UiUtility>.singleton.TimeDuarationFormatString((int)this.m_lastTime.LeftTime, 5)
}));
}
else
{
base.uiBehaviour.m_TimeLabel.SetText(XStringDefineProxy.GetString("GUILD_ARENA_ROUNDWATTING", new object[]
{
XSingleton<UiUtility>.singleton.TimeDuarationFormatString((int)this.m_lastTime.LeftTime, 5)
}));
}
}
else
{
this.Countdown = false;
bool flag4 = this.mDone;
if (flag4)
{
this.ReturnHall();
}
}
}
}
public void ReturnHall()
{
bool flag = !this._Doc.InBattleGroup;
if (flag)
{
XSingleton<XScene>.singleton.ReqLeaveScene();
}
else
{
this.SetVisibleWithAnimation(false, null);
}
}
}
}
|