Elin Modding Docs Doc
Loading...
Searching...
No Matches
ContentFaction.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5// Token: 0x02000584 RID: 1412
6public class ContentFaction : EContent
7{
8 // Token: 0x060026EE RID: 9966 RVA: 0x000DCA8C File Offset: 0x000DAC8C
9 public override void OnSwitchContent(int idTab)
10 {
11 if (idTab == 2)
12 {
13 this.RefreshZones();
14 }
15 else
16 {
17 this.RefreshFactions(idTab == 4);
18 }
19 LayerJournal componentInParent = base.GetComponentInParent<LayerJournal>();
20 this.textHeader.SetText(componentInParent.GetTextHeader(componentInParent.windows[0]));
21 }
22
23 // Token: 0x060026EF RID: 9967 RVA: 0x000DCAD4 File Offset: 0x000DACD4
24 public void RefreshFactions(bool religion)
25 {
26 UIList uilist = this.listFaction;
27 uilist.Clear();
28 if (religion)
29 {
30 uilist.callbacks = new UIList.Callback<Religion, ItemGeneral>
31 {
32 onClick = delegate(Religion a, ItemGeneral b)
33 {
34 this.info.SetReligion(a);
35 },
36 onInstantiate = delegate(Religion a, ItemGeneral b)
37 {
38 b.SetSound(null);
39 b.SetMainText(a.Name, this.spriteFaith, true);
40 b.SetSubText(a.TextType, 260, FontColor.Default, TextAnchor.MiddleRight);
41 a.SetTextRelation(b.button1.subText);
42 b.Build();
43 b.button1.refStr = a.id;
44 }
45 };
46 using (Dictionary<string, Religion>.ValueCollection.Enumerator enumerator = EClass.game.religions.dictAll.Values.GetEnumerator())
47 {
48 while (enumerator.MoveNext())
49 {
50 Religion religion2 = enumerator.Current;
51 if (!religion2.IsMinorGod)
52 {
53 uilist.Add(religion2);
54 }
55 }
56 goto IL_103;
57 }
58 }
59 uilist.callbacks = new UIList.Callback<Faction, ItemGeneral>
60 {
61 onClick = delegate(Faction a, ItemGeneral b)
62 {
63 this.info.SetFaction(a);
64 },
65 onInstantiate = delegate(Faction a, ItemGeneral b)
66 {
67 b.SetSound(null);
68 b.SetMainText(a.name, this.spriteFaction, true);
69 b.SetSubText(a.TextType, 260, FontColor.Default, TextAnchor.MiddleRight);
70 a.relation.SetTextHostility(b.button1.subText);
71 b.Build();
72 b.button1.refStr = a.id;
73 }
74 };
75 foreach (Faction o in EClass.game.factions.dictAll.Values)
76 {
77 uilist.Add(o);
78 }
79 IL_103:
80 uilist.Refresh(false);
81 }
82
83 // Token: 0x060026F0 RID: 9968 RVA: 0x000DCC08 File Offset: 0x000DAE08
84 public void RefreshZones()
85 {
86 UIList uilist = this.listFaction;
87 uilist.Clear();
88 BaseList baseList = uilist;
89 UIList.Callback<Spatial, ItemGeneral> callback = new UIList.Callback<Spatial, ItemGeneral>();
90 callback.onClick = delegate(Spatial a, ItemGeneral b)
91 {
92 if (!(a is Zone))
93 {
94 return;
95 }
96 this.info.SetZone(a as Zone);
97 };
98 callback.onInstantiate = delegate(Spatial a, ItemGeneral b)
99 {
100 b.SetSound(null);
101 b.SetMainText(a.Name, null, true);
102 b.Build();
103 };
104 baseList.callbacks = callback;
105 foreach (Spatial spatial in EClass.game.spatials.map.Values)
106 {
107 if (spatial is Zone && spatial.parent == EClass.pc.currentZone.Region && spatial.mainFaction == EClass.pc.faction)
108 {
109 uilist.Add(spatial);
110 }
111 }
112 uilist.Refresh(false);
113 if (uilist.items.Count == 0)
114 {
115 this.info.Clear();
116 }
117 }
118
119 // Token: 0x04001577 RID: 5495
120 public UIList listFaction;
121
122 // Token: 0x04001578 RID: 5496
123 public UIFactionInfo info;
124
125 // Token: 0x04001579 RID: 5497
126 public Sprite spriteFaction;
127
128 // Token: 0x0400157A RID: 5498
129 public Sprite spriteFaith;
130
131 // Token: 0x0400157B RID: 5499
132 public UIText textHeader;
133}
Definition Zone.cs:14