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
|
using System;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class DragonCrusadeRankDlg : DlgBase<DragonCrusadeRankDlg, DragonCrusadeRankBehavior>
{
public override string fileName
{
get
{
return "DragonCrusade/DragonCrusadeRank";
}
}
public override bool hideMainMenu
{
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;
}
}
public bool isHallUI
{
get
{
return XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.Hall;
}
}
public override int sysid
{
get
{
return 50;
}
}
private XDragonCrusadeDocument mDoc = null;
private XLeftTimeCounter m_LeftTime;
private XUIPool m_role_pool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
public override void OnXNGUIClick(GameObject obj, string path)
{
base.OnXNGUIClick(obj, path);
}
public override void RegisterEvent()
{
base.RegisterEvent();
base.uiBehaviour.mClosedBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClose));
}
protected override void Init()
{
base.Init();
}
protected override void OnLoad()
{
base.OnLoad();
this.mDoc = (XSingleton<XGame>.singleton.Doc.GetXComponent(XDragonCrusadeDocument.uuID) as XDragonCrusadeDocument);
GameObject gameObject = base.SetXUILable("Bg/CountDown/CountDown", "");
IXUILabel label = gameObject.GetComponent("XUILabel") as IXUILabel;
this.m_LeftTime = new XLeftTimeCounter(label, false);
this.ScrollViewInit();
}
public override void OnUpdate()
{
base.OnUpdate();
bool flag = this.m_LeftTime != null;
if (flag)
{
this.m_LeftTime.Update();
bool flag2 = this.m_LeftTime.GetLeftTime() <= 0;
if (flag2)
{
}
}
}
private void ScrollViewInit()
{
Transform transform = base.uiBehaviour.transform.Find("ScrollView/GuildList/Tpl");
this.m_role_pool.SetupPool(transform.parent.gameObject, transform.gameObject, 10u, false);
}
public void RefreshRankWindow(DERankRes oRes)
{
bool flag = oRes != null;
if (flag)
{
this.m_LeftTime.SetLeftTime(oRes.rewardlefttime, -1);
}
bool flag2 = oRes == null || oRes.ranks == null || oRes.ranks.Count == 0;
if (flag2)
{
base.uiBehaviour.m_EmptyHint.SetActive(true);
}
else
{
Vector3 tplPos = this.m_role_pool.TplPos;
this.m_role_pool.FakeReturnAll();
for (int i = 0; i < oRes.ranks.Count; i++)
{
DERank derank = oRes.ranks[i];
GameObject gameObject = this.m_role_pool.FetchGameObject(false);
IXUILabel ixuilabel = gameObject.transform.Find("Rank").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel2 = gameObject.transform.Find("Name").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel3 = gameObject.transform.Find("Level").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel4 = gameObject.transform.Find("LeaderName").GetComponent("XUILabel") as IXUILabel;
IXUISprite ixuisprite = gameObject.transform.Find("P").GetComponent("XUISprite") as IXUISprite;
ixuilabel.SetText(derank.rank.ToString());
IXUISprite ixuisprite2 = gameObject.transform.Find("RankImage").GetComponent("XUISprite") as IXUISprite;
bool flag3 = i < 3;
if (flag3)
{
ixuisprite2.SetSprite("N" + (i + 1));
ixuisprite2.SetVisible(true);
ixuilabel.SetVisible(false);
}
else
{
ixuisprite2.SetVisible(false);
ixuilabel.SetVisible(true);
}
ixuilabel2.SetText(derank.rolename);
string text = string.Empty;
for (int j = 0; j < derank.reward.Count; j++)
{
ItemBrief itemBrief = derank.reward[j];
ItemList.RowData itemConf = XBagDocument.GetItemConf((int)itemBrief.itemID);
text += itemBrief.itemCount.ToString();
}
ixuilabel3.SetText(text);
bool flag4 = derank.progress != null;
if (flag4)
{
ixuilabel4.SetText(this.mDoc.GetChapter(derank.progress.sceneID) + " " + (100 - derank.progress.bossavghppercent).ToString() + "%");
}
else
{
ixuilabel4.SetText(this.mDoc.GetChapter(derank.progress.sceneID) + "info.progress == null%");
}
ixuilabel2.ID = derank.roleID;
bool flag5 = derank.roleID == 0UL;
if (flag5)
{
ixuilabel2.RegisterLabelClickEventHandler(null);
}
else
{
ixuilabel2.RegisterLabelClickEventHandler(new LabelClickEventHandler(this.OnRankItemClicked));
}
bool flag6 = i % 2 == 0;
if (flag6)
{
ixuisprite.SetVisible(true);
ixuisprite.SetSprite("Panel_popup2_back");
}
else
{
ixuisprite.SetVisible(false);
ixuisprite.SetSprite("Panel_popup2_back");
}
gameObject.transform.localPosition = new Vector3(tplPos.x, tplPos.y - (float)(this.m_role_pool.TplHeight * i), tplPos.z);
}
this.m_role_pool.ActualReturnAll(false);
base.uiBehaviour.m_scroll_view.ResetPosition();
base.uiBehaviour.m_EmptyHint.SetActive(false);
}
}
private void OnRankItemClicked(IXUILabel label)
{
XCharacterCommonMenuDocument.ReqCharacterMenuInfo(label.ID, false);
}
protected bool OnClose(IXUIButton btn)
{
this.SetVisible(false, true);
return true;
}
}
}
|