Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ContentHomeRanking Class Reference
Inheritance diagram for ContentHomeRanking:
EContent UIContent UINote

Public Member Functions

override void OnSwitchContent (int idTab)
 
void Refresh ()
 
- Public Member Functions inherited from UIContent
virtual void OnSwitchContent (int idTab)
 
virtual void OnInstantiate ()
 
- Public Member Functions inherited from UINote
void Clear ()
 
void Build ()
 
void Space (int sizeY=0, int sizeX=1)
 
UINote AddNote (string id)
 
UIItem AddHeader (string text, Sprite sprite=null)
 
UIItem AddHeaderCard (string text, Sprite sprite=null)
 
UIItem AddHeaderTopic (string text, Sprite sprite=null)
 
UIItem AddHeader (string id, string text, Sprite sprite=null)
 
UIItem AddText (string text, FontColor color=FontColor.DontChange)
 
UIItem AddText (string id, string text, FontColor color=FontColor.DontChange)
 
UIItem AddText (string id, string text, Color color)
 
UIItem AddItem (string id)
 
UIItem AddTopic (string id, string text, string value=null)
 
UIItem AddTopic (string text, string value=null)
 
void AddImage (Sprite sprite)
 
void AddImage (string idFile)
 
UIButton AddButton (string text, Action onClick)
 
UIButton AddButtonLink (string text, string url)
 
UIDropdown AddDropdown (string id="DropdownDefault")
 
UIButton AddToggle (string idLang="", bool isOn=false, Action< bool > action=null)
 
Transform AddPrefab (string path)
 
AddExtra< T > (string path)
 

Public Attributes

UIDynamicList listRanking
 
Color[] colors
 
- Public Attributes inherited from UINote
RectTransform target
 
UINoteProfile prof
 
SkinType skinType
 
string idDefaultText
 
LayoutGroup layout
 
RectTransform cur
 
bool extraRebuild
 

Detailed Description

Definition at line 4 of file ContentHomeRanking.cs.

Member Function Documentation

◆ OnSwitchContent()

override void ContentHomeRanking.OnSwitchContent ( int  idTab)
inlinevirtual

Reimplemented from UIContent.

Definition at line 10 of file ContentHomeRanking.cs.

11 {
12 Refresh();
13 }

References Refresh().

◆ Refresh()

void ContentHomeRanking.Refresh ( )
inline

Definition at line 15 of file ContentHomeRanking.cs.

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 }
UIDynamicList listRanking
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()
List< object > objects
override void Add(object o)
DynamicScrollView dsv
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

References $, EClass._zone, UIDynamicList.Add(), UIDynamicList.Clear(), colors, EClass.game, RankedZone.GetFactionName(), RankedZoneManager.GetList(), RankedZone.GetSprite(), UIItem.image1, UIItem.image2, Zone.IsPCFaction, item, UIDynamicList.List(), listRanking, RankedZone.Name, RankedZone.rank, SpatialManager.ranks, Game.spatials, and RankedZone.z.

Referenced by OnSwitchContent().

Member Data Documentation

◆ colors

Color [] ContentHomeRanking.colors

Definition at line 8 of file ContentHomeRanking.cs.

Referenced by Refresh().

◆ listRanking

UIDynamicList ContentHomeRanking.listRanking

Definition at line 6 of file ContentHomeRanking.cs.

Referenced by Refresh().


The documentation for this class was generated from the following file: