Elin Modding Docs Doc
Loading...
Searching...
No Matches
ContentHomeRanking.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5// Token: 0x0200054F RID: 1359
7{
8 // Token: 0x060024EF RID: 9455 RVA: 0x000D0DBC File Offset: 0x000CEFBC
9 public override void OnSwitchContent(int idTab)
10 {
11 this.Refresh();
12 }
13
14 // Token: 0x060024F0 RID: 9456 RVA: 0x000D0DC4 File Offset: 0x000CEFC4
15 public void Refresh()
16 {
17 List<RankedZone> ranks = EClass.game.spatials.ranks.GetList();
18 UIDynamicList list = this.listRanking;
19 list.Clear();
20 BaseList list2 = list;
21 UIList.Callback<RankedZone, UIItem> callback = new UIList.Callback<RankedZone, UIItem>();
22 callback.onClick = delegate(RankedZone a, UIItem b)
23 {
24 };
25 callback.onRedraw = delegate(RankedZone a, UIItem b, int i)
26 {
27 b.text1.text = ((a.z.visitCount > 0) ? a.Name : "?????");
28 b.text2.text = string.Format("{0:#,0}", a.Value);
29 b.text3.text = (a.rank.ToString() ?? "");
30 b.text4.text = a.GetFactionName();
31 b.image1.sprite = (a.GetSprite() ?? b.image1.sprite);
32 b.image1.SetNativeSize();
33 b.text3.color = this.colors[(a.rank <= 3) ? 0 : ((a.rank <= 10) ? 1 : ((a.rank <= 100) ? 2 : 3))];
34 b.image2.SetActive(a.z.IsPCFaction);
35 };
36 callback.onList = delegate(UIList.SortMode m)
37 {
38 foreach (RankedZone o in ranks)
39 {
40 list.Add(o);
41 }
42 };
43 callback.onRefresh = null;
44 list2.callbacks = callback;
45 list.List();
46 int num = -1;
47 foreach (RankedZone rankedZone in ranks)
48 {
49 if (rankedZone.z == EClass._zone)
50 {
51 num = list.objects.IndexOf(rankedZone);
52 }
53 }
54 if (num != -1)
55 {
56 list.dsv.scrollByItemIndex(num);
57 list.Refresh();
58 }
59 this.RebuildLayout(true);
60 }
61
62 // Token: 0x04001474 RID: 5236
63 public UIDynamicList listRanking;
64
65 // Token: 0x04001475 RID: 5237
66 public Color[] colors;
67}