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

Public Member Functions

override void OnSwitchContent (int idTab)
 
void RefreshFactions (bool religion)
 
void RefreshZones ()
 
- 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

UIList listFaction
 
UIFactionInfo info
 
Sprite spriteFaction
 
Sprite spriteFaith
 
UIText textHeader
 
- Public Attributes inherited from UINote
RectTransform target
 
UINoteProfile prof
 
SkinType skinType
 
string idDefaultText
 
LayoutGroup layout
 
RectTransform cur
 
bool extraRebuild
 

Detailed Description

Definition at line 3 of file ContentFaction.cs.

Member Function Documentation

◆ OnSwitchContent()

override void ContentFaction.OnSwitchContent ( int  idTab)
inlinevirtual

Reimplemented from UIContent.

Definition at line 15 of file ContentFaction.cs.

16 {
17 if (idTab == 2)
18 {
20 }
21 else
22 {
23 RefreshFactions(idTab == 4);
24 }
25 LayerJournal componentInParent = GetComponentInParent<LayerJournal>();
26 textHeader.SetText(componentInParent.GetTextHeader(componentInParent.windows[0]));
27 }
void RefreshFactions(bool religion)
List< Window > windows
Definition: Layer.cs:116
virtual string GetTextHeader(Window window)
Definition: Layer.cs:131
void SetText(string s)
Definition: UIText.cs:159

References Layer.GetTextHeader(), RefreshFactions(), RefreshZones(), UIText.SetText(), textHeader, and Layer.windows.

◆ RefreshFactions()

void ContentFaction.RefreshFactions ( bool  religion)
inline

Definition at line 29 of file ContentFaction.cs.

30 {
31 UIList uIList = listFaction;
32 uIList.Clear();
33 if (religion)
34 {
35 uIList.callbacks = new UIList.Callback<Religion, ItemGeneral>
36 {
37 onClick = delegate(Religion a, ItemGeneral b)
38 {
40 },
41 onInstantiate = delegate(Religion a, ItemGeneral b)
42 {
43 b.SetSound();
45 b.SetSubText(a.TextType, 260, FontColor.Default, TextAnchor.MiddleRight);
47 b.Build();
48 b.button1.refStr = a.id;
49 }
50 };
51 foreach (Religion value in EClass.game.religions.dictAll.Values)
52 {
53 if (!value.IsMinorGod)
54 {
55 uIList.Add(value);
56 }
57 }
58 }
59 else
60 {
61 uIList.callbacks = new UIList.Callback<Faction, ItemGeneral>
62 {
63 onClick = delegate(Faction a, ItemGeneral b)
64 {
66 },
67 onInstantiate = delegate(Faction a, ItemGeneral b)
68 {
69 b.SetSound();
71 b.SetSubText(a.TextType, 260, FontColor.Default, TextAnchor.MiddleRight);
73 b.Build();
74 b.button1.refStr = a.id;
75 }
76 };
77 foreach (Faction value2 in EClass.game.factions.dictAll.Values)
78 {
79 uIList.Add(value2);
80 }
81 }
82 uIList.Refresh();
83 }
FontColor
Definition: FontColor.cs:2
UIList listFaction
UIFactionInfo info
Sprite spriteFaction
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
Dictionary< string, Faction > dictAll
void SetTextHostility(UIText text)
virtual string TextType
Definition: FACTION.cs:152
string name
Definition: FACTION.cs:133
string id
Definition: FACTION.cs:127
FactionRelation relation
Definition: FACTION.cs:124
ReligionManager religions
Definition: Game.cs:158
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
Dictionary< string, Religion > dictAll
string Name
Definition: Religion.cs:30
string TextType
Definition: Religion.cs:38
virtual bool IsMinorGod
Definition: Religion.cs:50
void SetTextRelation(UIText text)
Definition: Religion.cs:77
virtual string id
Definition: Religion.cs:26
UIText subText
Definition: UIButton.cs:104
void SetFaction(Faction f)
void SetReligion(Religion f)
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

References UIList.Add(), ItemGeneral.Build(), UIItem.button1, UIList.Clear(), FactionManager.dictAll, ReligionManager.dictAll, Game.factions, EClass.game, Faction.id, Religion.id, info, Religion.IsMinorGod, listFaction, Faction.name, Religion.Name, UIList.Refresh(), Faction.relation, religion, Game.religions, UIFactionInfo.SetFaction(), ItemGeneral.SetMainText(), UIFactionInfo.SetReligion(), ItemGeneral.SetSound(), ItemGeneral.SetSubText(), FactionRelation.SetTextHostility(), Religion.SetTextRelation(), spriteFaction, spriteFaith, UIButton.subText, Faction.TextType, and Religion.TextType.

Referenced by OnSwitchContent().

◆ RefreshZones()

void ContentFaction.RefreshZones ( )
inline

Definition at line 85 of file ContentFaction.cs.

86 {
87 UIList uIList = listFaction;
88 uIList.Clear();
89 uIList.callbacks = new UIList.Callback<Spatial, ItemGeneral>
90 {
91 onClick = delegate(Spatial a, ItemGeneral b)
92 {
93 if (a is Zone)
94 {
95 info.SetZone(a as Zone);
96 }
97 },
98 onInstantiate = delegate(Spatial a, ItemGeneral b)
99 {
100 b.SetSound();
101 b.SetMainText(a.Name);
102 b.Build();
103 }
104 };
105 foreach (Spatial value in EClass.game.spatials.map.Values)
106 {
107 if (value is Zone && value.parent == EClass.pc.currentZone.Region && value.mainFaction == EClass.pc.faction)
108 {
109 uIList.Add(value);
110 }
111 }
112 uIList.Refresh();
113 if (uIList.items.Count == 0)
114 {
115 info.Clear();
116 }
117 }
Faction faction
Definition: Chara.cs:412
Zone currentZone
Definition: Chara.cs:240
static Chara pc
Definition: EClass.cs:14
SpatialManager spatials
Definition: Game.cs:152
GlobalSpatialList map
Spatial parent
Definition: Spatial.cs:10
virtual string Name
Definition: Spatial.cs:495
Faction mainFaction
Definition: Spatial.cs:430
void SetZone(Zone _zone)
List< object > items
Definition: UIList.cs:241
Definition: Zone.cs:12
Region Region
Definition: Zone.cs:160

References ItemGeneral.Build(), UIList.Clear(), UIFactionInfo.Clear(), Chara.currentZone, Chara.faction, EClass.game, info, listFaction, Spatial.mainFaction, SpatialManager.map, Spatial.Name, Spatial.parent, EClass.pc, Zone.Region, ItemGeneral.SetMainText(), ItemGeneral.SetSound(), UIFactionInfo.SetZone(), and Game.spatials.

Referenced by OnSwitchContent().

Member Data Documentation

◆ info

UIFactionInfo ContentFaction.info

Definition at line 7 of file ContentFaction.cs.

Referenced by RefreshFactions(), and RefreshZones().

◆ listFaction

UIList ContentFaction.listFaction

Definition at line 5 of file ContentFaction.cs.

Referenced by RefreshFactions(), and RefreshZones().

◆ spriteFaction

Sprite ContentFaction.spriteFaction

Definition at line 9 of file ContentFaction.cs.

Referenced by RefreshFactions().

◆ spriteFaith

Sprite ContentFaction.spriteFaith

Definition at line 11 of file ContentFaction.cs.

Referenced by RefreshFactions().

◆ textHeader

UIText ContentFaction.textHeader

Definition at line 13 of file ContentFaction.cs.

Referenced by OnSwitchContent().


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