summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateView.cs
blob: 62c4769a37d8500f913b5e2c19eb1a130ba992de (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
using System;
using System.Collections.Generic;
using UILib;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient
{
	internal class XGuildDonateView : DlgBase<XGuildDonateView, XGuildDonateBehavior>
	{
		public override string fileName
		{
			get
			{
				return "Guild/GuildDonation";
			}
		}

		public override bool autoload
		{
			get
			{
				return true;
			}
		}

		public override bool hideMainMenu
		{
			get
			{
				return true;
			}
		}

		public override bool pushstack
		{
			get
			{
				return true;
			}
		}

		public override bool fullscreenui
		{
			get
			{
				return true;
			}
		}

		private XGuildGrowthDocument _growthDoc;

		private DonateRankType _rankType = DonateRankType.TodayRank;

		public GuildDonateType DonateType = GuildDonateType.DailyDonate;

		public uint _curDonateID = 0u;

		public uint toSelectID = 0u;

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

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

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

		protected override void Init()
		{
			base.Init();
			this._growthDoc = XDocuments.GetSpecificDocument<XGuildGrowthDocument>(XGuildGrowthDocument.uuID);
			this.InitProperties();
		}

		protected override void OnHide()
		{
			this.toSelectID = 0u;
			this.DonateType = GuildDonateType.DailyDonate;
			base.OnHide();
		}

		protected override void OnShow()
		{
			base.OnShow();
			base.uiBehaviour.RankRoot.gameObject.SetActive(false);
			base.uiBehaviour.RankBtn.gameObject.SetActive(true);
			XGuildDonateDocument.Doc.SendGetDonateBaseInfo();
			base.uiBehaviour.TodayTab.ForceSetFlag(true);
			base.uiBehaviour.dailyTab.ForceSetFlag(this.DonateType == GuildDonateType.DailyDonate);
			base.uiBehaviour.WeeklyTab.ForceSetFlag(this.DonateType == GuildDonateType.WeeklyDonate);
			base.uiBehaviour.GrowthTab.ForceSetFlag(this.DonateType == GuildDonateType.GrowthDonate);
			bool flag = this.DonateType == GuildDonateType.GrowthDonate;
			if (flag)
			{
				this.OnSelectGrowthDonation(base.uiBehaviour.GrowthTab);
			}
			this.UpdateDonationWrapContent();
		}

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

		private void InitProperties()
		{
			base.uiBehaviour.RankRoot.gameObject.SetActive(true);
			base.uiBehaviour.DonationContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.DonateItemUpdate));
			base.uiBehaviour.RankContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.DonateRankItemUpdate));
			base.uiBehaviour.HistoryTab.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.SelectedHistoryTab));
			base.uiBehaviour.TodayTab.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.SelectedTodayTab));
			base.uiBehaviour.CloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnclickCloseBtn));
			base.uiBehaviour.dailyTab.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSelectDailyDonation));
			base.uiBehaviour.WeeklyTab.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSelectWeeklyDonation));
			base.uiBehaviour.GrowthTab.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSelectGrowthDonation));
			base.uiBehaviour.RankCloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseRankView));
			base.uiBehaviour.RankBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnShowRankView));
			base.uiBehaviour.m_GrowthRecordBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnGrowthListBtnClick));
			base.uiBehaviour.m_GrowthRecordCloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnGrowthListCloseBtnClick));
		}

		private bool OnGrowthListBtnClick(IXUIButton btn)
		{
			this.ShowGrowthList();
			return true;
		}

		private bool OnGrowthListCloseBtnClick(IXUIButton btn)
		{
			base.uiBehaviour.m_GrowthRecordList.gameObject.SetActive(false);
			return true;
		}

		private bool OnShowRankView(IXUIButton button)
		{
			base.uiBehaviour.RankRoot.gameObject.SetActive(true);
			this.UpdateRankContent();
			return true;
		}

		private bool OnCloseRankView(IXUIButton button)
		{
			base.uiBehaviour.RankRoot.gameObject.SetActive(false);
			return true;
		}

		private bool OnSelectWeeklyDonation(IXUICheckBox iXUICheckBox)
		{
			bool bChecked = iXUICheckBox.bChecked;
			if (bChecked)
			{
				this.DonateType = GuildDonateType.WeeklyDonate;
				base.uiBehaviour.RankBtn.gameObject.SetActive(false);
				base.uiBehaviour.m_DonateFrame.gameObject.SetActive(true);
				base.uiBehaviour.m_GrowthFrame.gameObject.SetActive(false);
				this.UpdateDonationWrapContent();
			}
			return true;
		}

		private bool OnSelectDailyDonation(IXUICheckBox iXUICheckBox)
		{
			bool bChecked = iXUICheckBox.bChecked;
			if (bChecked)
			{
				this.DonateType = GuildDonateType.DailyDonate;
				base.uiBehaviour.RankBtn.gameObject.SetActive(true);
				base.uiBehaviour.m_DonateFrame.gameObject.SetActive(true);
				base.uiBehaviour.m_GrowthFrame.gameObject.SetActive(false);
				this.UpdateDonationWrapContent();
			}
			return true;
		}

		private bool OnSelectGrowthDonation(IXUICheckBox iXUICheckBox)
		{
			bool bChecked = iXUICheckBox.bChecked;
			if (bChecked)
			{
				this.DonateType = GuildDonateType.GrowthDonate;
				base.uiBehaviour.RankBtn.gameObject.SetActive(false);
				base.uiBehaviour.m_DonateFrame.gameObject.SetActive(false);
				base.uiBehaviour.m_GrowthFrame.gameObject.SetActive(true);
				this.SetupGrowthDonate();
				this._growthDoc.QueryGrowthRecordList();
			}
			return true;
		}

		private bool OnclickCloseBtn(IXUIButton button)
		{
			this.SetVisibleWithAnimation(false, null);
			return true;
		}

		private bool SelectedTodayTab(IXUICheckBox iXUICheckBox)
		{
			bool bChecked = iXUICheckBox.bChecked;
			if (bChecked)
			{
				this._rankType = DonateRankType.TodayRank;
				this.UpdateRankContent();
			}
			return true;
		}

		private void UpdateRankContent()
		{
			this.UpdateRankWrapContent();
			this.UpdateMyRank();
		}

		private bool SelectedHistoryTab(IXUICheckBox iXUICheckBox)
		{
			bool bChecked = iXUICheckBox.bChecked;
			if (bChecked)
			{
				this._rankType = DonateRankType.HistoryRank;
				this.UpdateRankContent();
			}
			return true;
		}

		private void DonateRankItemUpdate(Transform itemTransform, int index)
		{
			GuildDonateRankInfo rankInfoByIndex = XGuildDonateDocument.Doc.GetRankInfoByIndex(index, this._rankType);
			bool flag = rankInfoByIndex != null;
			if (flag)
			{
				IXUILabel ixuilabel = itemTransform.Find("Win").GetComponent("XUILabel") as IXUILabel;
				bool flag2 = this._rankType == DonateRankType.HistoryRank;
				if (flag2)
				{
					ixuilabel.SetText(rankInfoByIndex.totalCount.ToString());
				}
				else
				{
					ixuilabel.SetText(rankInfoByIndex.todayCount.ToString());
				}
				IXUILabel ixuilabel2 = itemTransform.Find("Name").GetComponent("XUILabel") as IXUILabel;
				ixuilabel2.SetText(rankInfoByIndex.roleName);
				IXUISprite ixuisprite = itemTransform.Find("Rank").GetComponent("XUISprite") as IXUISprite;
				IXUILabel ixuilabel3 = itemTransform.Find("Rank3").GetComponent("XUILabel") as IXUILabel;
				bool flag3 = index < 3;
				if (flag3)
				{
					ixuilabel3.gameObject.SetActive(false);
					ixuisprite.gameObject.SetActive(true);
					ixuisprite.SetSprite(ixuisprite.spriteName.Substring(0, ixuisprite.spriteName.Length - 1) + (index + 1));
				}
				else
				{
					ixuisprite.gameObject.SetActive(false);
					ixuilabel3.gameObject.SetActive(true);
					ixuilabel3.SetText((index + 1).ToString());
				}
			}
		}

		private void DonateItemUpdate(Transform itemTransform, int index)
		{
			GuildDonateItemInfo donateItemInfoByIndex = XGuildDonateDocument.Doc.GetDonateItemInfoByIndex(this.DonateType, index);
			Transform transform = itemTransform.Find("MemberTpl");
			bool flag = donateItemInfoByIndex != null;
			if (flag)
			{
				IXUICheckBox ixuicheckBox = transform.GetComponent("XUICheckBox") as IXUICheckBox;
				bool flag2 = donateItemInfoByIndex.id == this.toSelectID;
				if (flag2)
				{
					ixuicheckBox.ForceSetFlag(true);
				}
				else
				{
					ixuicheckBox.ForceSetFlag(false);
				}
				transform.gameObject.SetActive(true);
				itemTransform.gameObject.SetActive(true);
				Transform transform2 = itemTransform.Find("MemberTpl/Item");
				bool flag3 = donateItemInfoByIndex.itemType > 0u;
				ulong num;
				if (flag3)
				{
					DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID(donateItemInfoByIndex.taskID);
					num = (ulong)((dailyTaskTableInfoByID == null) ? 0u : dailyTaskTableInfoByID.BQ[0, 0]);
				}
				else
				{
					num = (ulong)donateItemInfoByIndex.itemID;
				}
				XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.DrawItem(transform2.gameObject, (int)num, 1, false);
				IXUISprite ixuisprite = transform2.Find("Icon").GetComponent("XUISprite") as IXUISprite;
				ixuisprite.ID = num;
				ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickItemIcon));
				IXUILabel ixuilabel = itemTransform.Find("MemberTpl/Contribution").GetComponent("XUILabel") as IXUILabel;
				ixuilabel.SetText(donateItemInfoByIndex.getCount + "/" + donateItemInfoByIndex.needCount);
				IXUILabel ixuilabel2 = itemTransform.Find("MemberTpl/Name").GetComponent("XUILabel") as IXUILabel;
				ixuilabel2.SetText(donateItemInfoByIndex.name);
				IXUILabel ixuilabel3 = itemTransform.Find("MemberTpl/Owned/Num").GetComponent("XUILabel") as IXUILabel;
				bool flag4 = donateItemInfoByIndex.itemType > 0u;
				ulong num2;
				if (flag4)
				{
					num2 = (ulong)((long)XBagDocument.BagDoc.GetItemsByTypeAndQuality(1UL << (int)donateItemInfoByIndex.itemType, (ItemQuality)donateItemInfoByIndex.itemQuality).Count);
				}
				else
				{
					num2 = XBagDocument.BagDoc.GetItemCount((int)donateItemInfoByIndex.itemID);
				}
				ixuilabel3.SetText(num2.ToString());
				Transform transform3 = itemTransform.Find("MemberTpl/Complete");
				IXUIButton ixuibutton = itemTransform.Find("MemberTpl/Do").GetComponent("XUIButton") as IXUIButton;
				ixuibutton.ID = (ulong)donateItemInfoByIndex.id;
				ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnclickDonateBtn));
				ixuibutton.gameObject.SetActive(true);
				transform3.gameObject.SetActive(false);
				ixuibutton.gameObject.SetActive(true);
				bool flag5 = donateItemInfoByIndex.roleID == XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID;
				if (flag5)
				{
					ixuibutton.gameObject.SetActive(false);
				}
				else
				{
					bool flag6 = donateItemInfoByIndex.getCount >= donateItemInfoByIndex.needCount;
					if (flag6)
					{
						ixuibutton.gameObject.SetActive(false);
						transform3.gameObject.SetActive(true);
					}
					else
					{
						ixuibutton.SetEnable(true, false);
					}
				}
			}
			else
			{
				transform.gameObject.SetActive(false);
			}
		}

		private void OnClickItemIcon(IXUISprite uiSprite)
		{
			XSingleton<UiUtility>.singleton.ShowItemAccess((int)uiSprite.ID, null);
		}

		private bool OnclickDonateBtn(IXUIButton button)
		{
			GuildDonateItemInfo donationItemInfoWithTypeID = XGuildDonateDocument.Doc.GetDonationItemInfoWithTypeID(this.DonateType, (uint)button.ID);
			uint canDonateMaxNum = XGuildDonateDocument.Doc.GetCanDonateMaxNum();
			bool flag = donationItemInfoWithTypeID != null;
			if (flag)
			{
				bool flag2 = donationItemInfoWithTypeID.itemType > 0u;
				ulong num;
				if (flag2)
				{
					num = (ulong)((long)XBagDocument.BagDoc.GetItemsByTypeAndQuality(1UL << (int)donationItemInfoWithTypeID.itemType, (ItemQuality)donationItemInfoWithTypeID.itemQuality).Count);
				}
				else
				{
					num = XBagDocument.BagDoc.GetItemCount((int)donationItemInfoWithTypeID.itemID);
				}
				bool flag3 = num == 0UL;
				if (flag3)
				{
					XSingleton<UiUtility>.singleton.ShowSystemTip(XSingleton<XStringTable>.singleton.GetString("DonateItemLess"), "fece00");
				}
				else
				{
					bool flag4 = canDonateMaxNum == 0u;
					if (flag4)
					{
						XSingleton<UiUtility>.singleton.ShowSystemTip(XSingleton<XStringTable>.singleton.GetString("DonateReachedMax"), "fece00");
					}
					else
					{
						this._curDonateID = donationItemInfoWithTypeID.id;
						uint max = (uint)Mathf.Min(new float[]
						{
							(uint)num,
							donationItemInfoWithTypeID.needCount - donationItemInfoWithTypeID.getCount,
							canDonateMaxNum
						});
						bool flag5 = donationItemInfoWithTypeID.itemType > 0u;
						if (flag5)
						{
							DlgBase<XShowSameQualityItemsView, XShowSameQualityItemsBehavior>.singleton.ShowView(new XShowSameQualityItemsView.SelectItemsHandler(this.OnSelectQualityItem), (ItemType)donationItemInfoWithTypeID.itemType, (ItemQuality)donationItemInfoWithTypeID.itemQuality, XStringDefineProxy.GetString("WeelyCommitTip"), (int)donationItemInfoWithTypeID.needCount, (int)donationItemInfoWithTypeID.getCount);
						}
						else
						{
							XSingleton<UiUtility>.singleton.ShowSettingNumberDialog(donationItemInfoWithTypeID.itemID, XSingleton<XStringTable>.singleton.GetString("ItemDonate"), 1u, max, 1u, new ModalSettingNumberDlg.GetInputNumber(this.GetItemNumer), 50);
						}
					}
				}
			}
			return true;
		}

		private void OnSelectQualityItem(List<ulong> itemList)
		{
			bool flag = itemList.Count > 0;
			if (flag)
			{
				XGuildDonateDocument.Doc.SendDonateMemberItem(this._curDonateID, (uint)itemList.Count, itemList);
			}
		}

		private void GetItemNumer(uint number)
		{
			bool flag = number > 0u;
			if (flag)
			{
				XGuildDonateDocument.Doc.SendDonateMemberItem(this._curDonateID, number, null);
			}
		}

		private void UpdateMyRank()
		{
			int myRankIndex = XGuildDonateDocument.Doc.GetMyRankIndex(this._rankType);
			bool flag = myRankIndex >= 0;
			if (flag)
			{
				base.uiBehaviour.MyRankItem.gameObject.SetActive(true);
				this.DonateRankItemUpdate(base.uiBehaviour.MyRankItem, myRankIndex);
			}
			else
			{
				base.uiBehaviour.MyRankItem.gameObject.SetActive(false);
			}
		}

		public void RefreshUI(GuildDonateType type)
		{
			bool flag = this.DonateType == type;
			if (flag)
			{
				this.UpdateRankWrapContent();
			}
		}

		public void RefreshCurDonateTypeUI()
		{
			this.UpdateDonationWrapContent();
		}

		private void UpdateRankWrapContent()
		{
			int rankContentCount = XGuildDonateDocument.Doc.GetRankContentCount(this._rankType);
			XGuildDonateDocument.Doc.SortRankListWithRankType(this._rankType);
			base.uiBehaviour.LeftScrollView.ResetPosition();
			base.uiBehaviour.RankContent.SetContentCount(rankContentCount, false);
			bool flag = rankContentCount > 0;
			if (flag)
			{
				base.uiBehaviour.EmptyRank.gameObject.SetActive(false);
			}
			else
			{
				base.uiBehaviour.EmptyRank.gameObject.SetActive(true);
			}
			this.UpdateDonationWrapContent();
		}

		private void UpdateDonationWrapContent()
		{
			int donationListCount = XGuildDonateDocument.Doc.GetDonationListCount(this.DonateType);
			base.uiBehaviour.DonationContent.SetContentCount(donationListCount, false);
			base.uiBehaviour.RightScrollView.ResetPosition();
		}

		public void SetupGrowthDonate()
		{
			this._growthDoc.QueryGrowthRecordList();
			base.uiBehaviour.m_GrowthRecordList.gameObject.SetActive(false);
			this.RefreshGrowthDonateTimes();
			this._growthDoc.QueryBuildRank();
			this.Refresh();
		}

		public void Refresh()
		{
			bool flag = !base.uiBehaviour.m_GrowthFrame.gameObject.activeInHierarchy;
			if (!flag)
			{
				base.uiBehaviour.m_GrowthDonatePool.ReturnAll(false);
				Vector3 tplPos = base.uiBehaviour.m_GrowthDonatePool.TplPos;
				for (int i = 0; i < this._growthDoc.GuildZiCaiTableReader.Table.Length; i++)
				{
					GuildZiCai.RowData rowData = this._growthDoc.GuildZiCaiTableReader.Table[i];
					GameObject gameObject = base.uiBehaviour.m_GrowthDonatePool.FetchGameObject(false);
					gameObject.transform.localPosition = new Vector3(tplPos.x + (float)(base.uiBehaviour.m_GrowthDonatePool.TplWidth * i), tplPos.y);
					GameObject gameObject2 = gameObject.transform.Find("Item").gameObject;
					ItemList.RowData itemConf = XBagDocument.GetItemConf((int)rowData.itemid);
					XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.DrawItem(gameObject2, itemConf, 0, false);
					XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.OpenClickShowTooltipEvent(gameObject2, (int)rowData.itemid);
					IXUILabel ixuilabel = gameObject2.transform.Find("Num").GetComponent("XUILabel") as IXUILabel;
					ixuilabel.SetVisible(true);
					ulong itemCount = XBagDocument.BagDoc.GetItemCount((int)rowData.itemid);
					ixuilabel.SetText(string.Format("{0}{1}[ffffff]/1", (itemCount != 0UL) ? "" : "[e60012]", itemCount));
					IXUIButton ixuibutton = gameObject.transform.Find("Do").GetComponent("XUIButton") as IXUIButton;
					ixuibutton.ID = (ulong)rowData.itemid;
					ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnDoBtnClick));
					Transform transform = gameObject.transform.Find("box");
					transform.gameObject.SetActive(i == this._growthDoc.GuildZiCaiTableReader.Table.Length - 1);
					this.SetReward(gameObject.transform.Find("Private"), rowData.rolerewards);
					this.SetReward(gameObject.transform.Find("Guild"), rowData.guildrewards);
					IXUILabel ixuilabel2 = gameObject.transform.Find("label").GetComponent("XUILabel") as IXUILabel;
					ixuilabel2.SetText(XSingleton<UiUtility>.singleton.ReplaceReturn(rowData.ShowTips));
				}
			}
		}

		public bool OnDoBtnClick(IXUIButton btn)
		{
			this._growthDoc.QueryGuildGrowthDonate((uint)btn.ID);
			return true;
		}

		public void SetReward(Transform t, SeqListRef<uint> list)
		{
			bool flag = list.Count == 0;
			if (!flag)
			{
				IXUILabel ixuilabel = t.Find("t0").GetComponent("XUILabel") as IXUILabel;
				IXUISprite ixuisprite = t.Find("t0/icon").GetComponent("XUISprite") as IXUISprite;
				IXUILabel ixuilabel2 = t.Find("t1").GetComponent("XUILabel") as IXUILabel;
				IXUISprite ixuisprite2 = t.Find("t1/icon").GetComponent("XUISprite") as IXUISprite;
				ixuilabel.SetText(list[0, 1].ToString());
				ixuisprite.spriteName = XBagDocument.GetItemSmallIcon((int)list[0, 0], 0u);
				bool flag2 = list.Count <= 1;
				if (flag2)
				{
					ixuilabel2.SetVisible(false);
					ixuisprite2.SetVisible(false);
				}
				else
				{
					ixuilabel2.SetVisible(true);
					ixuisprite2.SetVisible(true);
					ixuilabel2.SetText(list[1, 1].ToString());
					ixuisprite2.spriteName = XBagDocument.GetItemSmallIcon((int)list[1, 0], 0u);
				}
			}
		}

		public void ShowGrowthList()
		{
			base.uiBehaviour.m_GrowthRecordList.gameObject.SetActive(true);
			this.RefreshDonateList();
		}

		public void RefreshDonateList()
		{
			base.uiBehaviour.m_GrowthRecordEmpty.gameObject.SetActive(this._growthDoc.RecordList.Count == 0);
			base.uiBehaviour.m_GrowthRecordPool.ReturnAll(false);
			int machineTimeFrom = XSingleton<UiUtility>.singleton.GetMachineTimeFrom1970();
			for (int i = 0; i < this._growthDoc.RecordList.Count; i++)
			{
				GameObject gameObject = base.uiBehaviour.m_GrowthRecordPool.FetchGameObject(false);
				gameObject.transform.localPosition = new Vector3(base.uiBehaviour.m_GrowthRecordPool.TplPos.x, base.uiBehaviour.m_GrowthRecordPool.TplPos.y - (float)(base.uiBehaviour.m_GrowthRecordPool.TplHeight * i));
				IXUILabel ixuilabel = gameObject.transform.Find("Name").GetComponent("XUILabel") as IXUILabel;
				IXUILabel ixuilabel2 = gameObject.transform.Find("Time").GetComponent("XUILabel") as IXUILabel;
				ItemList.RowData itemConf = XBagDocument.GetItemConf((int)this._growthDoc.RecordList[i].ItemID);
				ixuilabel.SetText(string.Format(XStringDefineProxy.GetString("GuildGrowthRecord"), this._growthDoc.RecordList[i].Name, itemConf.ItemName[0]));
				int num = machineTimeFrom - (int)this._growthDoc.RecordList[i].Time;
				ixuilabel2.SetText(XSingleton<UiUtility>.singleton.TimeAgoFormatString((num > 0) ? num : 60));
			}
		}

		public void CheckRecordRefresh()
		{
			bool activeInHierarchy = base.uiBehaviour.m_GrowthRecordList.gameObject.activeInHierarchy;
			if (activeInHierarchy)
			{
				this.RefreshDonateList();
			}
		}

		public void RefreshGrowthDonateTimes()
		{
			bool flag = !base.uiBehaviour.m_GrowthFrame.gameObject.activeInHierarchy;
			if (!flag)
			{
				int @int = XSingleton<XGlobalConfig>.singleton.GetInt("GuildJZDonateMaxCount");
				base.uiBehaviour.m_GrowthWeekTimes.SetText(string.Format("{0}/{1}", this._growthDoc.WeekDonateTimes, @int));
			}
		}
	}
}