Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
LayerFactions.cs
Go to the documentation of this file.
1using UnityEngine;
2
3public class LayerFactions : ELayer
4{
6
8
9 public Sprite spriteFaction;
10
11 public Sprite spriteFaith;
12
13 public override bool HeaderIsListOf(int id)
14 {
15 return true;
16 }
17
18 public override void OnSwitchContent(Window window)
19 {
20 if (window.windowIndex == 1)
21 {
22 if (window.idTab == 2)
23 {
25 }
26 else
27 {
29 }
30 }
31 }
32
33 public void RefreshFactions()
34 {
35 UIList uIList = listFaction;
36 uIList.Clear();
37 uIList.callbacks = new UIList.Callback<Faction, ItemGeneral>
38 {
39 onClick = delegate(Faction a, ItemGeneral b)
40 {
42 },
43 onInstantiate = delegate(Faction a, ItemGeneral b)
44 {
45 b.SetSound();
46 b.SetMainText(a.name, (windows[1].idTab == 0) ? spriteFaction : spriteFaith);
47 b.SetSubText(a.TextType, 260, FontColor.Default, TextAnchor.MiddleRight);
49 b.Build();
50 }
51 };
52 if (windows[1].idTab == 0)
53 {
54 foreach (Faction value in ELayer.game.factions.dictAll.Values)
55 {
56 uIList.Add(value);
57 }
58 }
59 else
60 {
61 foreach (Religion value2 in ELayer.game.religions.dictAll.Values)
62 {
63 uIList.Add(value2);
64 }
65 }
66 uIList.Refresh();
67 }
68
69 public void RefreshZones()
70 {
71 UIList uIList = listFaction;
72 uIList.Clear();
73 uIList.callbacks = new UIList.Callback<Spatial, ItemGeneral>
74 {
75 onClick = delegate(Spatial a, ItemGeneral b)
76 {
77 if (a is Zone)
78 {
79 info.SetZone(a as Zone);
80 }
81 },
82 onInstantiate = delegate(Spatial a, ItemGeneral b)
83 {
84 b.SetSound();
85 b.SetMainText(a.Name);
86 b.Build();
87 }
88 };
89 foreach (Spatial value in ELayer.game.spatials.map.Values)
90 {
91 if (value is Zone && value.parent == ELayer.pc.currentZone.Region)
92 {
93 uIList.Add(value);
94 }
95 }
96 uIList.Refresh();
97 }
98}
FontColor
Definition: FontColor.cs:2
Zone currentZone
Definition: Chara.cs:240
Definition: ELayer.cs:4
static Chara pc
Definition: ELayer.cs:15
static Game game
Definition: ELayer.cs:9
Dictionary< string, Faction > dictAll
void SetTextHostility(UIText text)
virtual string TextType
Definition: FACTION.cs:152
string name
Definition: FACTION.cs:133
FactionRelation relation
Definition: FACTION.cs:124
ReligionManager religions
Definition: Game.cs:158
SpatialManager spatials
Definition: Game.cs:152
FactionManager factions
Definition: Game.cs:161
void Build()
Definition: ItemGeneral.cs:161
void SetMainText(string lang, Sprite sprite=null, bool disableMask=true)
Definition: ItemGeneral.cs:101
void SetSound(SoundData data=null)
Definition: ItemGeneral.cs:142
UIButton SetSubText(string lang, int x, FontColor c=FontColor.Default, TextAnchor align=TextAnchor.MiddleLeft)
Definition: ItemGeneral.cs:119
override bool HeaderIsListOf(int id)
void RefreshFactions()
Sprite spriteFaith
UIList listFaction
Definition: LayerFactions.cs:5
void RefreshZones()
UIFactionInfo info
Definition: LayerFactions.cs:7
override void OnSwitchContent(Window window)
Sprite spriteFaction
Definition: LayerFactions.cs:9
List< Window > windows
Definition: Layer.cs:116
Dictionary< string, Religion > dictAll
GlobalSpatialList map
Spatial parent
Definition: Spatial.cs:10
virtual string Name
Definition: Spatial.cs:495
UIText subText
Definition: UIButton.cs:104
void SetFaction(Faction f)
void SetZone(Zone _zone)
UIButton button1
Definition: UIItem.cs:18
Definition: UIList.cs:9
override void Clear()
Definition: UIList.cs:349
override void Add(object item)
Definition: UIList.cs:302
virtual void Refresh(bool highlightLast=false)
Definition: UIList.cs:424
Definition: Window.cs:13
int windowIndex
Definition: Window.cs:697
int idTab
Definition: Window.cs:694
Definition: Zone.cs:12
Region Region
Definition: Zone.cs:160