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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
using System;
using System.Collections.Generic;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class XWorldBossEndRankView : DlgBase<XWorldBossEndRankView, XWorldBossEndRankBehaviour>
{
public override string fileName
{
get
{
return "GameSystem/WorldBossEndRankDlg";
}
}
public override int sysid
{
get
{
return XFastEnumIntEqualityComparer<XSysDefine>.ToInt(XSysDefine.XSys_WorldBoss_EndRank);
}
}
public override bool autoload
{
get
{
return true;
}
}
private XWorldBossDocument _Doc;
private RankeType m_CurrRankType;
protected override void Init()
{
base.Init();
this._Doc = XDocuments.GetSpecificDocument<XWorldBossDocument>(XWorldBossDocument.uuID);
this._Doc.WorldBossEndRankView = this;
}
protected override void OnShow()
{
base.OnShow();
base.uiBehaviour.m_DamageRankTab.bChecked = true;
}
public override void RegisterEvent()
{
base.RegisterEvent();
base.uiBehaviour.m_BtnClose.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClick));
base.uiBehaviour.m_BtnGoReward.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnGoRewardClick));
base.uiBehaviour.m_DamageRankTab.ID = (ulong)((long)XFastEnumIntEqualityComparer<RankeType>.ToInt(RankeType.WorldBossDamageRank));
base.uiBehaviour.m_DamageRankTab.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnRankTabClicked));
base.uiBehaviour.m_GuildRankTab.ID = (ulong)((long)XFastEnumIntEqualityComparer<RankeType>.ToInt(RankeType.WorldBossGuildRank));
base.uiBehaviour.m_GuildRankTab.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnRankTabClicked));
base.uiBehaviour.m_WrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.DamageRankWrapContentItemUpdated));
}
private bool OnRankTabClicked(IXUICheckBox checkbox)
{
bool flag = !checkbox.bChecked;
bool result;
if (flag)
{
result = false;
}
else
{
XWorldBossDocument specificDocument = XDocuments.GetSpecificDocument<XWorldBossDocument>(XWorldBossDocument.uuID);
this.m_CurrRankType = (RankeType)checkbox.ID;
RankeType currRankType = this.m_CurrRankType;
if (currRankType != RankeType.WorldBossGuildRank)
{
if (currRankType == RankeType.WorldBossDamageRank)
{
specificDocument.ReqWorldBossEnd();
}
}
else
{
specificDocument.ReqRankData(this.m_CurrRankType, false);
}
result = true;
}
return result;
}
protected override void OnUnload()
{
this._Doc.WorldBossDescView = null;
base.OnUnload();
}
private bool OnCloseClick(IXUIButton button)
{
this.SetVisibleWithAnimation(false, null);
return true;
}
private bool OnGoRewardClick(IXUIButton button)
{
XSingleton<XGameSysMgr>.singleton.OpenSystem(XSysDefine.XSys_Mail, 0UL);
this.SetVisibleWithAnimation(false, null);
return true;
}
public void RefreshDamageRank()
{
bool flag = !base.IsVisible();
if (!flag)
{
base.uiBehaviour.m_RankTitle.SetText(XSingleton<XStringTable>.singleton.GetString("WORLDBOSS_RESULT_RANK_ROLE"));
XWorldBossDocument specificDocument = XDocuments.GetSpecificDocument<XWorldBossDocument>(XWorldBossDocument.uuID);
List<WorldBossDamageInfo> endListDamage = specificDocument.EndListDamage;
bool flag2 = endListDamage.Count == 0;
if (flag2)
{
base.uiBehaviour.m_RankPanel_EmptyRank.gameObject.SetActive(true);
base.uiBehaviour.m_RankPanel_EmptyRank.SetText(XStringDefineProxy.GetString("GUILD_BOSS_EMPTY_RANK"));
base.uiBehaviour.m_WrapContent.gameObject.SetActive(false);
}
else
{
base.uiBehaviour.m_RankPanel_EmptyRank.gameObject.SetActive(false);
base.uiBehaviour.m_WrapContent.gameObject.SetActive(true);
base.uiBehaviour.m_WrapContent.SetContentCount(endListDamage.Count, false);
base.uiBehaviour.m_ScrollView.ResetPosition();
}
}
}
public void RefreshGuildRank()
{
bool flag = !base.IsVisible();
if (!flag)
{
base.uiBehaviour.m_RankTitle.SetText(XSingleton<XStringTable>.singleton.GetString("WORLDBOSS_RESULT_RANK_GUILD"));
XWorldBossDocument specificDocument = XDocuments.GetSpecificDocument<XWorldBossDocument>(XWorldBossDocument.uuID);
List<XBaseRankInfo> rankList = specificDocument.GuildRankList.rankList;
bool flag2 = rankList == null || rankList.Count == 0;
if (flag2)
{
base.uiBehaviour.m_RankPanel_EmptyRank.gameObject.SetActive(true);
base.uiBehaviour.m_RankPanel_EmptyRank.SetText(XStringDefineProxy.GetString("GUILD_BOSS_EMPTY_RANK"));
base.uiBehaviour.m_WrapContent.gameObject.SetActive(false);
}
else
{
base.uiBehaviour.m_RankPanel_EmptyRank.gameObject.SetActive(false);
base.uiBehaviour.m_WrapContent.gameObject.SetActive(true);
base.uiBehaviour.m_WrapContent.SetContentCount(rankList.Count, false);
base.uiBehaviour.m_ScrollView.ResetPosition();
}
}
}
private void DamageRankWrapContentItemUpdated(Transform t, int index)
{
bool flag = !base.IsVisible();
if (!flag)
{
XWorldBossDocument specificDocument = XDocuments.GetSpecificDocument<XWorldBossDocument>(XWorldBossDocument.uuID);
IXUISprite ixuisprite = t.Find("RankImage").GetComponent("XUISprite") as IXUISprite;
IXUILabel ixuilabel = t.Find("Rank").GetComponent("XUILabel") as IXUILabel;
IXUILabelSymbol ixuilabelSymbol = t.Find("Name").GetComponent("XUILabelSymbol") as IXUILabelSymbol;
IXUILabel ixuilabel2 = t.Find("Value").GetComponent("XUILabel") as IXUILabel;
float num = 0f;
string inputText = "";
bool flag2 = this.m_CurrRankType == RankeType.WorldBossDamageRank;
if (flag2)
{
List<WorldBossDamageInfo> endListDamage = specificDocument.EndListDamage;
bool flag3 = endListDamage == null;
if (flag3)
{
return;
}
bool flag4 = index < 0 || index >= endListDamage.Count;
if (flag4)
{
return;
}
WorldBossDamageInfo worldBossDamageInfo = endListDamage[index];
bool flag5 = worldBossDamageInfo == null;
if (flag5)
{
XSingleton<XDebug>.singleton.AddErrorLog("XGuildDragonView.GuildRankWrapContentItemUpdated is null ", null, null, null, null, null);
return;
}
num = worldBossDamageInfo.damage;
inputText = worldBossDamageInfo.rolename;
}
else
{
bool flag6 = this.m_CurrRankType == RankeType.WorldBossGuildRank;
if (flag6)
{
List<XBaseRankInfo> rankList = specificDocument.GuildRankList.rankList;
bool flag7 = rankList == null;
if (flag7)
{
return;
}
bool flag8 = index < 0 || index >= rankList.Count;
if (flag8)
{
return;
}
XBaseRankInfo xbaseRankInfo = rankList[index];
bool flag9 = xbaseRankInfo == null;
if (flag9)
{
XSingleton<XDebug>.singleton.AddErrorLog("XGuildDragonView.GuildRankWrapContentItemUpdated is null ", null, null, null, null, null);
return;
}
num = xbaseRankInfo.value;
inputText = xbaseRankInfo.name;
}
}
ixuilabel2.SetText(XSingleton<UiUtility>.singleton.NumberFormatBillion((ulong)num));
ixuilabelSymbol.InputText = inputText;
bool flag10 = index < 3;
if (flag10)
{
ixuisprite.spriteName = string.Format("N{0}", index + 1);
ixuisprite.SetVisible(true);
}
else
{
ixuisprite.SetVisible(false);
ixuilabel.SetText((index + 1).ToString());
}
}
}
public void SetMyRankFrame()
{
GameObject myRank = base.uiBehaviour.m_MyRank;
GameObject myOutOfRange = base.uiBehaviour.m_MyOutOfRange;
XWorldBossDocument specificDocument = XDocuments.GetSpecificDocument<XWorldBossDocument>(XWorldBossDocument.uuID);
List<XBaseRankInfo> rankList = specificDocument.GuildRankList.rankList;
bool flag = rankList != null && rankList.Count == 0;
if (flag)
{
myOutOfRange.SetActive(false);
myRank.SetActive(false);
}
else
{
bool flag2 = this.m_CurrRankType == RankeType.WorldBossGuildRank;
if (flag2)
{
XGuildDocument specificDocument2 = XDocuments.GetSpecificDocument<XGuildDocument>(XGuildDocument.uuID);
bool flag3 = !specificDocument2.bInGuild;
if (flag3)
{
myOutOfRange.SetActive(false);
myRank.SetActive(false);
return;
}
}
bool flag4 = specificDocument.GuildRankList.myRankInfo == null;
if (flag4)
{
myRank.SetActive(false);
}
else
{
myRank.SetActive(true);
IXUISprite ixuisprite = myRank.transform.Find("RankImage").GetComponent("XUISprite") as IXUISprite;
IXUILabelSymbol ixuilabelSymbol = myRank.transform.Find("Name").gameObject.GetComponent("XUILabelSymbol") as IXUILabelSymbol;
IXUILabel ixuilabel = myRank.transform.Find("Value").gameObject.GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel2 = myRank.transform.Find("Rank").gameObject.GetComponent("XUILabel") as IXUILabel;
ixuilabelSymbol.InputText = specificDocument.GuildRankList.myRankInfo.name;
ixuilabel.SetText(XSingleton<UiUtility>.singleton.NumberFormatBillion(specificDocument.GuildRankList.myRankInfo.value));
bool flag5 = specificDocument.GuildRankList.myRankInfo.rank < 3u;
if (flag5)
{
ixuisprite.spriteName = string.Format("N{0}", specificDocument.GuildRankList.myRankInfo.rank + 1u);
ixuisprite.SetVisible(true);
}
else
{
ixuisprite.SetVisible(false);
ixuilabel2.SetText((specificDocument.GuildRankList.myRankInfo.rank + 1u).ToString());
}
myOutOfRange.SetActive(specificDocument.GuildRankList.myRankInfo.rank == XRankDocument.INVALID_RANK);
}
}
}
public void SetMyRankFrame(WorldBossDamageInfo myInfo)
{
XWorldBossDocument specificDocument = XDocuments.GetSpecificDocument<XWorldBossDocument>(XWorldBossDocument.uuID);
GameObject myRank = base.uiBehaviour.m_MyRank;
GameObject myOutOfRange = base.uiBehaviour.m_MyOutOfRange;
List<WorldBossDamageInfo> endListDamage = specificDocument.EndListDamage;
bool flag = endListDamage.Count == 0;
if (flag)
{
myOutOfRange.SetActive(false);
myRank.SetActive(false);
}
else
{
bool flag2 = myInfo == null;
if (flag2)
{
myRank.SetActive(false);
}
else
{
myRank.SetActive(true);
IXUISprite ixuisprite = myRank.transform.Find("RankImage").GetComponent("XUISprite") as IXUISprite;
IXUILabelSymbol ixuilabelSymbol = myRank.transform.Find("Name").gameObject.GetComponent("XUILabelSymbol") as IXUILabelSymbol;
IXUILabel ixuilabel = myRank.transform.Find("Value").gameObject.GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel2 = myRank.transform.Find("Rank").gameObject.GetComponent("XUILabel") as IXUILabel;
ixuilabelSymbol.InputText = myInfo.rolename;
ixuilabel.SetText(XSingleton<UiUtility>.singleton.NumberFormatBillion((ulong)myInfo.damage));
bool flag3 = myInfo.rank < 3u;
if (flag3)
{
ixuisprite.spriteName = string.Format("N{0}", myInfo.rank + 1u);
ixuisprite.SetVisible(true);
}
else
{
ixuisprite.SetVisible(false);
ixuilabel2.SetText((myInfo.rank + 1u).ToString());
}
myOutOfRange.SetActive(myInfo.rank == XRankDocument.INVALID_RANK);
}
}
}
}
}
|