Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ContentHomeRanking.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using UnityEngine;
3
5{
7
8 public Color[] colors;
9
10 public override void OnSwitchContent(int idTab)
11 {
12 Refresh();
13 }
14
15 public void Refresh()
16 {
17 List<RankedZone> ranks = EClass.game.spatials.ranks.GetList();
19 list.Clear();
20 list.callbacks = new UIList.Callback<RankedZone, UIItem>
21 {
22 onClick = delegate
23 {
24 },
25 onRedraw = delegate(RankedZone a, UIItem b, int i)
26 {
27 b.text1.text = ((a.z.visitCount > 0) ? a.Name : "?????");
28 b.text2.text = $"{a.Value:#,0}";
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 = colors[(a.rank > 3) ? ((a.rank <= 10) ? 1 : ((a.rank <= 100) ? 2 : 3)) : 0];
34 b.image2.SetActive(a.z.IsPCFaction);
35 },
36 onList = delegate
37 {
38 foreach (RankedZone item in ranks)
39 {
40 list.Add(item);
41 }
42 },
43 onRefresh = null
44 };
45 list.List();
46 int num = -1;
47 foreach (RankedZone item2 in ranks)
48 {
49 if (item2.z == EClass._zone)
50 {
51 num = list.objects.IndexOf(item2);
52 }
53 }
54 if (num != -1)
55 {
56 list.dsv.scrollByItemIndex(num);
57 list.Refresh();
58 }
59 this.RebuildLayout(recursive: true);
60 }
61}
UIDynamicList listRanking
override void OnSwitchContent(int idTab)
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static Zone _zone
Definition: EClass.cs:20
SpatialManager spatials
Definition: Game.cs:152
List< RankedZone > GetList()
string Name
Definition: RankedZone.cs:14
Sprite GetSprite()
Definition: RankedZone.cs:29
int rank
Definition: RankedZone.cs:8
Zone z
Definition: RankedZone.cs:6
string GetFactionName()
Definition: RankedZone.cs:16
RankedZoneManager ranks
override void List()
override void Add(object o)
override void Clear()
Definition: UIItem.cs:5
Image image2
Definition: UIItem.cs:16
Image image1
Definition: UIItem.cs:14
Definition: UIList.cs:9
bool IsPCFaction
Definition: Zone.cs:464