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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
|
using System;
using System.Collections.Generic;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class CareerHomepageHandler : DlgHandlerBase
{
protected override string FileName
{
get
{
return "GameSystem/PersonalCareer/CareerHomepage";
}
}
private IXUILabelSymbol m_Username;
private IXUILabel m_UID;
private IXUILabel m_Level;
private IXUILabel m_Server;
private IXUILabel m_Guild;
private IXUILabel m_Profession;
private IXUILabel m_ContinuousLogin;
private IXUILabel m_OnlineTime;
private IXUILabel m_PPT;
private IXUISprite m_Portrait;
private Transform m_SignatureSelfShow;
private IXUIButton m_SignatureChange;
private IXUILabel m_SignatureLabel;
private Transform m_QQVipIcon;
private Transform m_QQSVipIcon;
private IXUIButton m_Push;
private IXUIButton m_Share;
private XUIPool m_CoursePool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
private XUIPool m_TimePool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
private XUIPool m_LinePool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
public enum GrowthType
{
NONE,
Level,
Nest,
Dragon
}
protected override void Init()
{
base.Init();
Transform transform = base.transform.Find("BaseInfo");
this.m_Username = (transform.Find("Username").GetComponent("XUILabelSymbol") as IXUILabelSymbol);
this.m_Server = (transform.Find("Server").GetComponent("XUILabel") as IXUILabel);
this.m_UID = (transform.Find("UID/T").GetComponent("XUILabel") as IXUILabel);
this.m_Level = (transform.Find("Level/T").GetComponent("XUILabel") as IXUILabel);
this.m_Guild = (transform.Find("Guild/T").GetComponent("XUILabel") as IXUILabel);
this.m_Profession = (transform.Find("Occupation/T").GetComponent("XUILabel") as IXUILabel);
this.m_ContinuousLogin = (transform.Find("ContinuousLogin/T").GetComponent("XUILabel") as IXUILabel);
this.m_OnlineTime = (transform.Find("OnlineTime/T").GetComponent("XUILabel") as IXUILabel);
this.m_PPT = (transform.Find("PPT/T").GetComponent("XUILabel") as IXUILabel);
this.m_Portrait = (transform.Find("Portrait").GetComponent("XUISprite") as IXUISprite);
this.m_SignatureSelfShow = transform.Find("Signature/SelfShow");
this.m_SignatureChange = (transform.Find("Signature/SelfShow/Change").GetComponent("XUIButton") as IXUIButton);
this.m_SignatureLabel = (transform.Find("Signature/Tag/T").GetComponent("XUILabel") as IXUILabel);
this.m_QQVipIcon = transform.Find("QQVIP");
this.m_QQSVipIcon = transform.Find("QQSVIP");
transform = base.transform.Find("Career/Career");
Transform transform2 = transform.Find("CourseTpl");
this.m_CoursePool.SetupPool(null, transform2.gameObject, 10u, false);
Transform transform3 = transform.Find("TimeTpl");
this.m_TimePool.SetupPool(null, transform3.gameObject, 10u, false);
Transform transform4 = transform.Find("LineTpl");
this.m_LinePool.SetupPool(null, transform4.gameObject, 10u, false);
this.m_Push = (base.transform.Find("Push").GetComponent("XUIButton") as IXUIButton);
this.m_Share = (base.transform.Find("Share").GetComponent("XUIButton") as IXUIButton);
this.InitInfo();
}
public override void RegisterEvent()
{
this.m_SignatureChange.RegisterClickEventHandler(new ButtonClickEventHandler(this._InputBtnClick));
this.m_Push.RegisterClickEventHandler(new ButtonClickEventHandler(this._PushBtnClick));
this.m_Share.RegisterClickEventHandler(new ButtonClickEventHandler(this._ShareBtnClick));
}
protected override void OnShow()
{
base.OnShow();
}
protected override void OnHide()
{
base.OnHide();
}
public override void OnUnload()
{
base.OnUnload();
}
private void InitInfo()
{
this.m_Username.InputText = "";
this.m_Server.SetText("");
this.m_UID.SetText("");
this.m_Level.SetText("");
this.m_Guild.SetText("");
this.m_Profession.SetText("");
this.m_ContinuousLogin.SetText("");
this.m_OnlineTime.SetText("");
this.m_PPT.SetText("");
this.m_SignatureSelfShow.gameObject.SetActive(false);
this.m_SignatureLabel.SetText("");
this.m_QQVipIcon.gameObject.SetActive(false);
this.m_QQSVipIcon.gameObject.SetActive(false);
}
public void SetData(PersonalHomePage data)
{
this.m_Username.InputText = XSingleton<XCommon>.singleton.StringCombine(data.play_name, XWelfareDocument.GetMemberPrivilegeIconString(data.paymember_id));
this.m_Server.SetText(data.server_name);
this.m_UID.SetText(data.uid.ToString());
this.m_Level.SetText(data.level.ToString());
bool flag = "".Equals(data.guild_name);
if (flag)
{
this.m_Guild.SetText(XSingleton<XStringTable>.singleton.GetString("NONE"));
}
else
{
this.m_Guild.SetText(data.guild_name);
}
this.m_Portrait.SetSprite(XSingleton<XProfessionSkillMgr>.singleton.GetProfHeadIcon((int)data.profession_id));
this.m_Profession.SetText(XSingleton<XProfessionSkillMgr>.singleton.GetProfName((int)data.profession_id));
this.m_ContinuousLogin.SetText(string.Format(XSingleton<XStringTable>.singleton.GetString("CAREER_CONTINUOUS_LOGIN"), data.continue_login_time.ToString()));
float num = data.online_time / 3600f;
string arg = (num < 10f) ? num.ToString("f1") : num.ToString("f0");
this.m_OnlineTime.SetText(string.Format(XSingleton<XStringTable>.singleton.GetString("CAREER_ONLINE_TIME"), arg));
this.m_PPT.SetText(((int)data.power).ToString());
this.m_SignatureSelfShow.gameObject.SetActive(DlgBase<PersonalCareerView, PersonalCareerBehaviour>.singleton.roleId == 0UL);
this.m_SignatureLabel.SetText(data.declaration);
this.SetQQVip(data.qq_vip);
List<CareerData> list = new List<CareerData>();
for (int i = 0; i < data.carrer_data.Count; i++)
{
list.Add(data.carrer_data[i]);
}
list.Sort(new Comparison<CareerData>(this._CompareGrowthProcess));
this.SetGrowthProcess(list);
this.m_Push.gameObject.SetActive(DlgBase<PersonalCareerView, PersonalCareerBehaviour>.singleton.roleId == 0UL);
this.m_Share.gameObject.SetActive(DlgBase<PersonalCareerView, PersonalCareerBehaviour>.singleton.roleId == 0UL);
}
public void SetDeclaration(string declaration)
{
this.m_SignatureLabel.SetText(declaration);
}
private void SetQQVip(uint vip)
{
bool flag = XSingleton<XLoginDocument>.singleton.Channel == XAuthorizationChannel.XAuthorization_QQ && XSingleton<XGameSysMgr>.singleton.IsSystemOpened(XSysDefine.XSys_QQVIP);
if (flag)
{
this.m_QQVipIcon.gameObject.SetActive(vip == 1u);
this.m_QQSVipIcon.gameObject.SetActive(vip == 2u || vip == 3u);
}
else
{
this.m_QQVipIcon.gameObject.SetActive(false);
this.m_QQSVipIcon.gameObject.SetActive(false);
}
}
private int _CompareGrowthProcess(CareerData left, CareerData right)
{
bool flag = left.time == right.time;
int result;
if (flag)
{
bool flag2 = left.type == right.type;
if (flag2)
{
result = -left.para1.CompareTo(right.para1);
}
else
{
result = -left.type.CompareTo(right.type);
}
}
else
{
result = -left.time.CompareTo(right.time);
}
return result;
}
private void SetGrowthProcess(List<CareerData> data)
{
bool flag = data.Count == 0;
if (!flag)
{
int num = 0;
int num2 = 0;
uint num3 = 0u;
this.m_CoursePool.FakeReturnAll();
this.m_TimePool.FakeReturnAll();
this.m_LinePool.FakeReturnAll();
for (int i = 0; i < data.Count; i++)
{
uint time = data[i].time;
string text = this.GrowthText(data[i]);
bool flag2 = text == null;
if (!flag2)
{
bool flag3 = time != num3;
if (flag3)
{
num3 = time;
bool flag4 = num2 - num > 0;
if (flag4)
{
GameObject gameObject = this.m_LinePool.FetchGameObject(false);
gameObject.transform.localPosition = new Vector3(0f, (float)(num2 + this.m_TimePool.TplHeight), 0f) + this.m_LinePool.TplPos;
IXUISprite ixuisprite = gameObject.GetComponent("XUISprite") as IXUISprite;
ixuisprite.spriteWidth = num2 - num;
}
GameObject gameObject2 = this.m_TimePool.FetchGameObject(false);
gameObject2.transform.localPosition = new Vector3(0f, (float)num, 0f) + this.m_TimePool.TplPos;
IXUILabel ixuilabel = gameObject2.transform.Find("Time").GetComponent("XUILabel") as IXUILabel;
num -= this.m_TimePool.TplHeight;
num2 = num;
ixuilabel.SetText(string.Format(XSingleton<XStringTable>.singleton.GetString("CAREER_GROWTH_PROCESS_TIME"), time / 10000u, (time / 100u % 100u).ToString().PadLeft(2, '0'), (time % 100u).ToString().PadLeft(2, '0')));
}
GameObject gameObject3 = this.m_CoursePool.FetchGameObject(false);
gameObject3.transform.localPosition = new Vector3(0f, (float)(num + this.m_TimePool.TplHeight), 0f) + this.m_CoursePool.TplPos;
IXUILabel ixuilabel2 = gameObject3.transform.Find("T").GetComponent("XUILabel") as IXUILabel;
ixuilabel2.SetText(text);
IXUISprite ixuisprite2 = gameObject3.transform.Find("p").GetComponent("XUISprite") as IXUISprite;
ixuisprite2.UpdateAnchors();
num -= ixuisprite2.spriteHeight;
}
}
this.m_LinePool.ActualReturnAll(false);
this.m_TimePool.ActualReturnAll(false);
this.m_CoursePool.ActualReturnAll(false);
}
}
private string GrowthText(CareerData data)
{
bool flag = data == null;
string result;
if (flag)
{
result = null;
}
else
{
string text;
switch (data.type)
{
case CarrerDataType.CARRER_DATA_LEVEL:
text = string.Format(XSingleton<XStringTable>.singleton.GetString("CAREER_GROWTH_PROCESS_LEVEL"), data.para1);
break;
case CarrerDataType.CARRER_DATA_NEST:
{
SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(data.para1);
bool flag2 = sceneData == null;
if (flag2)
{
return null;
}
text = string.Format(XSingleton<XStringTable>.singleton.GetString("CAREER_GROWTH_PROCESS_NEST"), sceneData.Comment);
break;
}
case CarrerDataType.CARRER_DATA_DRAGON:
{
SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(data.para1);
bool flag3 = sceneData == null;
if (flag3)
{
return null;
}
text = string.Format(XSingleton<XStringTable>.singleton.GetString("CAREER_GROWTH_PROCESS_DRAGON"), sceneData.Comment);
break;
}
case CarrerDataType.CARRER_DATA_CREATEROLE:
text = XSingleton<XStringTable>.singleton.GetString("CAREER_GROWTH_PROCESS_BORN");
break;
default:
return null;
}
result = text;
}
return result;
}
private bool _PushBtnClick(IXUIButton btn)
{
DlgBase<PersonalCareerView, PersonalCareerBehaviour>.singleton.PushClick(0UL);
return true;
}
private bool _ShareBtnClick(IXUIButton btn)
{
DlgBase<PersonalCareerView, PersonalCareerBehaviour>.singleton.ShareClick();
return true;
}
private void test()
{
this.SetGrowthProcess(new List<CareerData>
{
new CareerData
{
time = 1u,
type = CarrerDataType.CARRER_DATA_LEVEL,
para1 = 10u
},
new CareerData
{
time = 2u,
type = CarrerDataType.CARRER_DATA_NEST,
para1 = 1u
},
new CareerData
{
time = 2u,
type = CarrerDataType.CARRER_DATA_DRAGON,
para1 = 2u
},
new CareerData
{
time = 4u,
type = CarrerDataType.CARRER_DATA_CREATEROLE,
para1 = 2u
}
});
}
private bool _InputBtnClick(IXUIButton btn)
{
DlgBase<XChatInputView, XChatInputBehaviour>.singleton.ShowChatInput(new ChatInputStringBack(this.ReqSetDeclaration));
DlgBase<XChatInputView, XChatInputBehaviour>.singleton.SetInputType(ChatInputType.TEXT);
DlgBase<XChatInputView, XChatInputBehaviour>.singleton.SetCharacterLimit(40);
return true;
}
public void ReqSetDeclaration(string str)
{
RpcC2G_ChangeDeclaration rpcC2G_ChangeDeclaration = new RpcC2G_ChangeDeclaration();
rpcC2G_ChangeDeclaration.oArg.declaration = str;
XSingleton<XClientNetwork>.singleton.Send(rpcC2G_ChangeDeclaration);
}
}
}
|