summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/CareerTrophyHandler.cs
blob: c5f5d684372adf399c777253a89efcf9decca5d0 (plain)
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
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
using System;
using System.Collections.Generic;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient
{
	internal class CareerTrophyHandler : DlgHandlerBase
	{
		protected override string FileName
		{
			get
			{
				return "GameSystem/PersonalCareer/CareerTrophy";
			}
		}

		private XPersonalCareerDocument doc = null;

		private uint curLevel;

		private List<CareerTrophyHandler.TrophyData> m_TrophyData = new List<CareerTrophyHandler.TrophyData>();

		public Dictionary<Transform, IXUITexture> _WrapTextureList = new Dictionary<Transform, IXUITexture>();

		private IXUILabel m_GloryExp;

		private IXUILabel m_GloryLevel;

		private IXUILabel m_NextRewardLevel;

		private IXUIButton m_HonorRewardOpen;

		private IXUIButton m_Push;

		private IXUIButton m_Share;

		private Transform m_RewardItem;

		private IXUIWrapContent m_WrapContent;

		private IXUIScrollView m_ListScrollView;

		private Transform m_TrophyDetailFrame;

		private IXUIButton m_TrophyClose;

		private IXUILabel m_TrophyTitle;

		private XUIPool m_TrophyPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);

		private Transform m_HonorRewardFrame;

		private IXUIButton m_HonorRewardClose;

		private IXUILabel m_HonorCurrentLevel;

		private IXUIScrollView m_HonorScrollView;

		private XUIPool m_HonorRewardPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);

		private XUIPool m_HonorItemPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);

		private class TrophyData
		{
			public uint ID;

			public uint SceneID;

			public int SortID;

			public uint pass_count;

			public uint quickly_pass_time;

			public ulong hight_damage;

			public ulong hight_treat;

			public uint help_count;

			public uint no_deathpass_count;

			public List<TrophyDetail> trophyDetail;

			public void Clear()
			{
				this.SceneID = 0u;
				this.pass_count = 0u;
				this.quickly_pass_time = 0u;
				this.hight_damage = 0UL;
				this.hight_treat = 0UL;
				this.help_count = 0u;
				this.no_deathpass_count = 0u;
				this.trophyDetail = null;
			}

			public void SetData(StageTrophyData data, uint tID)
			{
				this.ID = tID;
				this.SceneID = data.scene_id;
				this.pass_count = data.pass_count;
				this.quickly_pass_time = data.quickly_pass_time;
				this.hight_damage = data.hight_damage;
				this.hight_treat = data.hight_treat;
				this.help_count = data.help_count;
				this.no_deathpass_count = data.no_deathpass_count;
				for (int i = 0; i < data.get_trophy_detail.Count; i++)
				{
					bool flag = data.get_trophy_detail[i].trophy_id == tID;
					if (flag)
					{
						this.trophyDetail = data.get_trophy_detail[i].detail;
					}
				}
			}

			public TrophyDetail GetBestTrophy()
			{
				bool flag = this.trophyDetail == null;
				TrophyDetail result;
				if (flag)
				{
					result = null;
				}
				else
				{
					TrophyDetail trophyDetail = null;
					for (int i = 0; i < this.trophyDetail.Count; i++)
					{
						bool flag2 = trophyDetail == null || trophyDetail.tropy_order < this.trophyDetail[i].tropy_order;
						if (flag2)
						{
							trophyDetail = this.trophyDetail[i];
						}
					}
					result = trophyDetail;
				}
				return result;
			}

			public TrophyDetail GetTrophyDetail(int index)
			{
				bool flag = this.trophyDetail == null;
				TrophyDetail result;
				if (flag)
				{
					result = null;
				}
				else
				{
					for (int i = 0; i < this.trophyDetail.Count; i++)
					{
						bool flag2 = (long)index == (long)((ulong)this.trophyDetail[i].tropy_order);
						if (flag2)
						{
							return this.trophyDetail[i];
						}
					}
					result = null;
				}
				return result;
			}

			public string GetProgress(uint type)
			{
				bool flag = type == 1u;
				string result;
				if (flag)
				{
					result = this.pass_count.ToString();
				}
				else
				{
					bool flag2 = type == 2u;
					if (flag2)
					{
						result = XSingleton<UiUtility>.singleton.TimeFormatString((int)this.quickly_pass_time, 2, 2, 4, false, true);
					}
					else
					{
						bool flag3 = type == 3u;
						if (flag3)
						{
							result = XSingleton<UiUtility>.singleton.NumberFormatBillion(this.hight_damage * 10000UL);
						}
						else
						{
							bool flag4 = type == 4u;
							if (flag4)
							{
								result = XSingleton<UiUtility>.singleton.NumberFormatBillion(this.hight_treat * 10000UL);
							}
							else
							{
								bool flag5 = type == 5u;
								if (flag5)
								{
									result = this.help_count.ToString();
								}
								else
								{
									bool flag6 = type == 6u;
									if (flag6)
									{
										result = this.no_deathpass_count.ToString();
									}
									else
									{
										result = "";
									}
								}
							}
						}
					}
				}
				return result;
			}

			public string GetProgress(uint type, uint param)
			{
				bool flag = type == 1u;
				string result;
				if (flag)
				{
					result = param.ToString();
				}
				else
				{
					bool flag2 = type == 2u;
					if (flag2)
					{
						result = XSingleton<UiUtility>.singleton.TimeFormatString((int)param, 2, 2, 4, false, true);
					}
					else
					{
						bool flag3 = type == 3u;
						if (flag3)
						{
							result = XSingleton<UiUtility>.singleton.NumberFormatBillion((ulong)param * 10000UL);
						}
						else
						{
							bool flag4 = type == 4u;
							if (flag4)
							{
								result = XSingleton<UiUtility>.singleton.NumberFormatBillion((ulong)param * 10000UL);
							}
							else
							{
								bool flag5 = type == 5u;
								if (flag5)
								{
									result = param.ToString();
								}
								else
								{
									bool flag6 = type == 6u;
									if (flag6)
									{
										result = param.ToString();
									}
									else
									{
										result = "";
									}
								}
							}
						}
					}
				}
				return result;
			}
		}

		protected override void Init()
		{
			base.Init();
			this.doc = XDocuments.GetSpecificDocument<XPersonalCareerDocument>(XPersonalCareerDocument.uuID);
			for (int i = 0; i < XPersonalCareerDocument.TrophyInfoTable.Table.Length; i++)
			{
				CareerTrophyHandler.TrophyData trophyData = new CareerTrophyHandler.TrophyData();
				trophyData.ID = XPersonalCareerDocument.TrophyInfoTable.Table[i].ID;
				trophyData.SortID = i;
				this.m_TrophyData.Add(trophyData);
			}
			this.m_GloryExp = (base.transform.Find("GloryLevel/Exp").GetComponent("XUILabel") as IXUILabel);
			this.m_GloryLevel = (base.transform.Find("GloryLevel/Level").GetComponent("XUILabel") as IXUILabel);
			this.m_NextRewardLevel = (base.transform.Find("NextRewardLevel").GetComponent("XUILabel") as IXUILabel);
			this.m_RewardItem = base.transform.Find("Item");
			this.m_HonorRewardOpen = (base.transform.Find("Reward").GetComponent("XUIButton") as IXUIButton);
			this.m_WrapContent = (base.transform.Find("TrophyFrame/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent);
			this.m_ListScrollView = (base.transform.Find("TrophyFrame").GetComponent("XUIScrollView") as IXUIScrollView);
			this.m_Push = (base.transform.Find("Push").GetComponent("XUIButton") as IXUIButton);
			this.m_Share = (base.transform.Find("Share").GetComponent("XUIButton") as IXUIButton);
			this.m_TrophyDetailFrame = base.transform.Find("TrophyDetail");
			this.m_TrophyClose = (this.m_TrophyDetailFrame.Find("Close").GetComponent("XUIButton") as IXUIButton);
			this.m_TrophyTitle = (this.m_TrophyDetailFrame.Find("Title").GetComponent("XUILabel") as IXUILabel);
			this.m_TrophyPool.SetupPool(null, this.m_TrophyDetailFrame.Find("TrophyDetailTpl").gameObject, 3u, false);
			this.m_HonorRewardFrame = base.transform.Find("PointRewardFrame");
			this.m_HonorRewardClose = (this.m_HonorRewardFrame.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton);
			this.m_HonorScrollView = (this.m_HonorRewardFrame.Find("Bg/Bg/ScrollView").GetComponent("XUIScrollView") as IXUIScrollView);
			this.m_HonorCurrentLevel = (this.m_HonorRewardFrame.Find("Bg/CurrentPoint/Text").GetComponent("XUILabel") as IXUILabel);
			this.m_HonorRewardPool.SetupPool(null, this.m_HonorRewardFrame.Find("Bg/Bg/ScrollView/RewardTpl").gameObject, 8u, false);
			this.m_HonorItemPool.SetupPool(null, this.m_HonorRewardFrame.Find("Bg/Bg/ScrollView/Item").gameObject, 5u, false);
			this.InitShow();
		}

		public override void RegisterEvent()
		{
			this.m_Push.RegisterClickEventHandler(new ButtonClickEventHandler(this._PushBtnClick));
			this.m_Share.RegisterClickEventHandler(new ButtonClickEventHandler(this._ShareBtnClick));
			this.m_WrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this._OnListItemUpdated));
			this.m_TrophyClose.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnTrophyCloseClicked));
			this.m_HonorRewardOpen.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnHonorRewardOpenClick));
			this.m_HonorRewardClose.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnHonorRewardCloseClicked));
		}

		protected override void OnShow()
		{
			base.OnShow();
		}

		protected override void OnHide()
		{
			this.ClearPreTabTextures();
			base.OnHide();
		}

		public override void OnUnload()
		{
			base.OnUnload();
		}

		public void ClearPreTabTextures()
		{
			foreach (KeyValuePair<Transform, IXUITexture> keyValuePair in this._WrapTextureList)
			{
				IXUITexture value = keyValuePair.Value;
				value.SetTexturePath("");
			}
			this._WrapTextureList.Clear();
		}

		private void InitShow()
		{
			this.m_GloryLevel.SetText("");
			this.m_GloryExp.SetText("");
			this.m_NextRewardLevel.SetText("");
			this.m_RewardItem.gameObject.SetActive(false);
			this.m_TrophyDetailFrame.gameObject.SetActive(false);
			this.m_HonorRewardFrame.gameObject.SetActive(false);
		}

		public void SetData(StageTrophy data)
		{
			bool flag = data != null;
			if (flag)
			{
				this.curLevel = data.honour_rank;
				this.m_GloryLevel.SetText(this.curLevel.ToString());
				TrophyReward.RowData rowData = XPersonalCareerDocument.GetTrophyReward((int)this.curLevel);
				rowData = this.doc.ProcessHonorLevelMax(rowData);
				this.m_GloryExp.SetText(string.Format("({0}/{1})", data.total_score.ToString(), rowData.TrophyScore.ToString()));
				TrophyReward.RowData honorNextReward = XPersonalCareerDocument.GetHonorNextReward(rowData.HonourRank);
				bool flag2 = honorNextReward != null && honorNextReward.Rewards.Count > 0;
				if (flag2)
				{
					this.m_NextRewardLevel.SetText(string.Format(XStringDefineProxy.GetString("CAREER_TROPHY_LEVEL_REWARD"), honorNextReward.HonourRank.ToString()));
					this.m_RewardItem.gameObject.SetActive(true);
					XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.DrawItem(this.m_RewardItem.gameObject, (int)honorNextReward.Rewards[0, 0], (int)honorNextReward.Rewards[0, 1], false);
					IXUISprite ixuisprite = this.m_RewardItem.Find("Icon").GetComponent("XUISprite") as IXUISprite;
					ixuisprite.ID = (ulong)honorNextReward.Rewards[0, 0];
					ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton<UiUtility>.singleton.OnItemClick));
				}
				else
				{
					this.m_NextRewardLevel.SetText(string.Format(XStringDefineProxy.GetString("CAREER_TROPHY_LEVEL_REWARD_MAX"), new object[0]));
					this.m_RewardItem.gameObject.SetActive(false);
				}
				for (int i = 0; i < this.m_TrophyData.Count; i++)
				{
					this.m_TrophyData[i].Clear();
				}
				XSingleton<XDebug>.singleton.AddGreenLog("trophydata.Count:" + data.trophydata.Count, null, null, null, null, null);
				for (int j = 0; j < data.trophydata.Count; j++)
				{
					List<TrophyInfo.RowData> trophyTableDataToSceneID = XPersonalCareerDocument.GetTrophyTableDataToSceneID(data.trophydata[j].scene_id);
					for (int k = 0; k < trophyTableDataToSceneID.Count; k++)
					{
						CareerTrophyHandler.TrophyData trophyData = this.GetTrophyData(trophyTableDataToSceneID[k].ID);
						trophyData.SetData(data.trophydata[j], trophyTableDataToSceneID[k].ID);
					}
				}
			}
			this.m_TrophyData.Sort(new Comparison<CareerTrophyHandler.TrophyData>(this._Compare));
			this.RefreshList(true);
		}

		public void RefreshList(bool bResetPosition = true)
		{
			int count = this.m_TrophyData.Count;
			this.m_WrapContent.SetContentCount(count, false);
			if (bResetPosition)
			{
				this.m_ListScrollView.ResetPosition();
			}
			else
			{
				this.m_WrapContent.RefreshAllVisibleContents();
			}
		}

		private void _OnListItemUpdated(Transform t, int index)
		{
			bool flag = index < 0;
			if (flag)
			{
				XSingleton<XDebug>.singleton.AddErrorLog("index:" + index, null, null, null, null, null);
			}
			else
			{
				Transform transform = t.Find("Bg");
				bool flag2 = index >= this.m_TrophyData.Count;
				if (flag2)
				{
					transform.gameObject.SetActive(false);
				}
				else
				{
					transform.gameObject.SetActive(true);
					TrophyInfo.RowData trophyTableData = XPersonalCareerDocument.GetTrophyTableData(this.m_TrophyData[index].ID);
					IXUILabel ixuilabel = transform.Find("Name").GetComponent("XUILabel") as IXUILabel;
					bool flag3 = trophyTableData != null;
					if (flag3)
					{
						ixuilabel.SetText(trophyTableData.Name);
					}
					TrophyDetail bestTrophy = this.m_TrophyData[index].GetBestTrophy();
					IXUILabel ixuilabel2 = transform.Find("Time").GetComponent("XUILabel") as IXUILabel;
					bool flag4 = bestTrophy != null;
					string text;
					if (flag4)
					{
						text = XSingleton<UiUtility>.singleton.TimeFormatSince1970((int)bestTrophy.trophy_time, XStringDefineProxy.GetString("CAREER_TROPHY_TIME"), true);
					}
					else
					{
						text = XStringDefineProxy.GetString("CAREER_TROPHY_UNREACH");
					}
					ixuilabel2.SetText(text);
					IXUITexture ixuitexture = transform.Find("Trophy").GetComponent("XUITexture") as IXUITexture;
					int num = 0;
					bool flag5 = bestTrophy != null;
					if (flag5)
					{
						num = (int)bestTrophy.tropy_order;
					}
					ixuitexture.SetTexturePath(this.GetTrophyTex(num));
					this._WrapTextureList[t] = ixuitexture;
					IXUISprite ixuisprite = ixuitexture.gameObject.transform.Find("P").GetComponent("XUISprite") as IXUISprite;
					ixuisprite.SetSprite(trophyTableData.Icon);
					Transform transform2 = transform.Find("Block");
					transform2.gameObject.SetActive(num == 0);
					IXUISprite ixuisprite2 = t.GetComponent("XUISprite") as IXUISprite;
					ixuisprite2.ID = (ulong)this.m_TrophyData[index].ID;
					ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this._OpenTrophyClick));
				}
			}
		}

		private int _Compare(CareerTrophyHandler.TrophyData left, CareerTrophyHandler.TrophyData right)
		{
			int num = (left.trophyDetail == null) ? 1 : 0;
			int num2 = (right.trophyDetail == null) ? 1 : 0;
			bool flag = num == num2;
			int result;
			if (flag)
			{
				result = left.SortID.CompareTo(right.SortID);
			}
			else
			{
				result = num.CompareTo(num2);
			}
			return result;
		}

		private CareerTrophyHandler.TrophyData GetTrophyData(uint ID)
		{
			for (int i = 0; i < this.m_TrophyData.Count; i++)
			{
				bool flag = this.m_TrophyData[i].ID == ID;
				if (flag)
				{
					return this.m_TrophyData[i];
				}
			}
			XSingleton<XDebug>.singleton.AddErrorLog("TrophyData:" + ID + " No Find", null, null, null, null, null);
			return new CareerTrophyHandler.TrophyData();
		}

		private string GetTrophyTex(int data)
		{
			bool flag = data == 1;
			string result;
			if (flag)
			{
				result = "atlas/UI/common/Pic/tex_glory4";
			}
			else
			{
				bool flag2 = data == 2;
				if (flag2)
				{
					result = "atlas/UI/common/Pic/tex_glory5";
				}
				else
				{
					bool flag3 = data == 3;
					if (flag3)
					{
						result = "atlas/UI/common/Pic/tex_glory6";
					}
					else
					{
						result = "atlas/UI/common/Pic/tex_glory4";
					}
				}
			}
			return result;
		}

		public bool OnTrophyCloseClicked(IXUIButton btn)
		{
			this.m_TrophyDetailFrame.gameObject.SetActive(false);
			return true;
		}

		private void RefreshTrophyDetail(uint ID)
		{
			TrophyInfo.RowData trophyTableData = XPersonalCareerDocument.GetTrophyTableData(ID);
			CareerTrophyHandler.TrophyData trophyData = this.GetTrophyData(ID);
			this.m_TrophyPool.FakeReturnAll();
			for (int i = 0; i < 3; i++)
			{
				GameObject gameObject = this.m_TrophyPool.FetchGameObject(false);
				Transform transform = this.m_TrophyDetailFrame.Find(string.Format("Trophy/Trophy{0}", i));
				XSingleton<UiUtility>.singleton.AddChild(transform, gameObject.transform);
				IXUILabel ixuilabel = gameObject.transform.Find("Bg/Name").GetComponent("XUILabel") as IXUILabel;
				bool flag = trophyTableData != null;
				if (flag)
				{
					ixuilabel.SetText(trophyTableData.Name);
				}
				bool flag2 = trophyTableData != null;
				if (flag2)
				{
					this.m_TrophyTitle.SetText(trophyTableData.Name);
				}
				IXUILabel ixuilabel2 = gameObject.transform.Find("Bg/Point").GetComponent("XUILabel") as IXUILabel;
				bool flag3 = trophyTableData != null;
				if (flag3)
				{
					ixuilabel2.SetText(string.Format(XStringDefineProxy.GetString("CAREER_TROPHY_POINT"), trophyTableData.TrophyScore[i]));
				}
				IXUITexture ixuitexture = gameObject.transform.Find("Bg/Tex").GetComponent("XUITexture") as IXUITexture;
				ixuitexture.SetTexturePath(this.GetTrophyTex(i + 1));
				this._WrapTextureList[transform] = ixuitexture;
				IXUISprite ixuisprite = ixuitexture.gameObject.transform.Find("P").GetComponent("XUISprite") as IXUISprite;
				ixuisprite.SetSprite(trophyTableData.Icon);
				IXUILabel ixuilabel3 = gameObject.transform.Find("Bg/Desc").GetComponent("XUILabel") as IXUILabel;
				IXUILabel ixuilabel4 = gameObject.transform.Find("Bg/Progress").GetComponent("XUILabel") as IXUILabel;
				Transform transform2 = gameObject.transform.Find("Bg/OK");
				Transform transform3 = gameObject.transform.Find("Bg/Block");
				IXUILabel ixuilabel5 = gameObject.transform.Find("Bg/OK/Time").GetComponent("XUILabel") as IXUILabel;
				bool flag4 = trophyTableData != null;
				if (flag4)
				{
					string format = "";
					uint param = 0u;
					uint type = 0u;
					bool flag5 = i == 0;
					if (flag5)
					{
						format = trophyTableData.ThirdDesc;
						param = trophyTableData.ThirdPara;
						type = trophyTableData.Third;
					}
					bool flag6 = i == 1;
					if (flag6)
					{
						format = trophyTableData.SecondDesc;
						param = trophyTableData.SecondPara;
						type = trophyTableData.Second;
					}
					bool flag7 = i == 2;
					if (flag7)
					{
						format = trophyTableData.FirstDesc;
						param = trophyTableData.FirstPara;
						type = trophyTableData.First;
					}
					ixuilabel3.SetText(string.Format(format, trophyData.GetProgress(type, param)));
					TrophyDetail trophyDetail = trophyData.GetTrophyDetail(i + 1);
					bool flag8 = trophyDetail == null;
					if (flag8)
					{
						transform2.gameObject.SetActive(false);
						transform3.gameObject.SetActive(true);
						ixuilabel4.gameObject.SetActive(true);
						ixuilabel4.SetText(string.Format("({0}/{1})", trophyData.GetProgress(type), trophyData.GetProgress(type, param)));
					}
					else
					{
						transform2.gameObject.SetActive(true);
						transform3.gameObject.SetActive(false);
						ixuilabel4.gameObject.SetActive(false);
						ixuilabel5.SetText(XSingleton<UiUtility>.singleton.TimeFormatSince1970((int)trophyDetail.trophy_time, XStringDefineProxy.GetString("CAREER_TROPHY_TIME"), true));
					}
				}
			}
			this.m_TrophyPool.ActualReturnAll(false);
		}

		public bool OnHonorRewardCloseClicked(IXUIButton btn)
		{
			this.m_HonorRewardFrame.gameObject.SetActive(false);
			return true;
		}

		private void RefreshHonorReward(bool resetPos = true)
		{
			this.m_HonorCurrentLevel.SetText(this.curLevel.ToString());
			List<TrophyReward.RowData> honorRewardList = XPersonalCareerDocument.GetHonorRewardList();
			bool flag = honorRewardList == null;
			if (!flag)
			{
				this.m_HonorRewardPool.FakeReturnAll();
				this.m_HonorItemPool.FakeReturnAll();
				for (int i = 0; i < honorRewardList.Count; i++)
				{
					GameObject gameObject = this.m_HonorRewardPool.FetchGameObject(false);
					IXUILabel ixuilabel = gameObject.transform.Find("Bg/Point/Num").GetComponent("XUILabel") as IXUILabel;
					ixuilabel.SetText(honorRewardList[i].HonourRank.ToString());
					for (int j = 0; j < honorRewardList[i].Rewards.Count; j++)
					{
						GameObject gameObject2 = this.m_HonorItemPool.FetchGameObject(false);
						XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.DrawItem(gameObject2, (int)honorRewardList[i].Rewards[j, 0], (int)honorRewardList[i].Rewards[j, 1], false);
						IXUISprite ixuisprite = gameObject2.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite;
						ixuisprite.ID = (ulong)honorRewardList[i].Rewards[j, 0];
						ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton<UiUtility>.singleton.OnItemClick));
						gameObject2.transform.parent = gameObject.transform;
						gameObject2.transform.localPosition = new Vector3(this.m_HonorItemPool.TplPos.x - this.m_HonorRewardPool.TplPos.x + (float)(this.m_HonorItemPool.TplWidth * j), 0f);
					}
					gameObject.transform.localPosition = new Vector3(0f, (float)(-(float)this.m_HonorRewardPool.TplHeight * i)) + this.m_HonorRewardPool.TplPos;
					Transform transform = gameObject.transform.Find("Bg/Reach");
					Transform transform2 = gameObject.transform.Find("Bg/UnReach");
					transform.gameObject.SetActive((ulong)this.curLevel >= (ulong)((long)honorRewardList[i].HonourRank));
					transform2.gameObject.SetActive((ulong)this.curLevel < (ulong)((long)honorRewardList[i].HonourRank));
				}
				this.m_HonorItemPool.ActualReturnAll(false);
				this.m_HonorRewardPool.ActualReturnAll(false);
				if (resetPos)
				{
					this.m_HonorScrollView.ResetPosition();
				}
			}
		}

		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 bool OnHonorRewardOpenClick(IXUIButton btn)
		{
			this.m_HonorRewardFrame.gameObject.SetActive(true);
			this.RefreshHonorReward(true);
			return true;
		}

		private void _OpenTrophyClick(IXUISprite sp)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("TrophyID:" + sp.ID, null, null, null, null, null);
			this.m_TrophyDetailFrame.gameObject.SetActive(true);
			this.RefreshTrophyDetail((uint)sp.ID);
		}
	}
}