Elin Modding Docs Doc
Loading...
Searching...
No Matches
LayerFactions.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5// Token: 0x02000544 RID: 1348
6public class LayerFactions : ELayer
7{
8 // Token: 0x0600249E RID: 9374 RVA: 0x000CE60A File Offset: 0x000CC80A
9 public override bool HeaderIsListOf(int id)
10 {
11 return true;
12 }
13
14 // Token: 0x0600249F RID: 9375 RVA: 0x000CE60D File Offset: 0x000CC80D
15 public override void OnSwitchContent(Window window)
16 {
17 if (window.windowIndex != 1)
18 {
19 return;
20 }
21 if (window.idTab == 2)
22 {
23 this.RefreshZones();
24 return;
25 }
26 this.RefreshFactions();
27 }
28
29 // Token: 0x060024A0 RID: 9376 RVA: 0x000CE630 File Offset: 0x000CC830
30 public void RefreshFactions()
31 {
32 UIList uilist = this.listFaction;
33 uilist.Clear();
34 uilist.callbacks = new UIList.Callback<Faction, ItemGeneral>
35 {
36 onClick = delegate(Faction a, ItemGeneral b)
37 {
38 this.info.SetFaction(a);
39 },
40 onInstantiate = delegate(Faction a, ItemGeneral b)
41 {
42 b.SetSound(null);
43 b.SetMainText(a.name, (this.windows[1].idTab == 0) ? this.spriteFaction : this.spriteFaith, true);
44 b.SetSubText(a.TextType, 260, FontColor.Default, TextAnchor.MiddleRight);
45 a.relation.SetTextHostility(b.button1.subText);
46 b.Build();
47 }
48 };
49 if (this.windows[1].idTab == 0)
50 {
51 using (Dictionary<string, Faction>.ValueCollection.Enumerator enumerator = ELayer.game.factions.dictAll.Values.GetEnumerator())
52 {
53 while (enumerator.MoveNext())
54 {
55 Faction o = enumerator.Current;
56 uilist.Add(o);
57 }
58 goto IL_D9;
59 }
60 }
61 foreach (Religion o2 in ELayer.game.religions.dictAll.Values)
62 {
63 uilist.Add(o2);
64 }
65 IL_D9:
66 uilist.Refresh(false);
67 }
68
69 // Token: 0x060024A1 RID: 9377 RVA: 0x000CE73C File Offset: 0x000CC93C
70 public void RefreshZones()
71 {
72 UIList uilist = this.listFaction;
73 uilist.Clear();
74 BaseList baseList = uilist;
75 UIList.Callback<Spatial, ItemGeneral> callback = new UIList.Callback<Spatial, ItemGeneral>();
76 callback.onClick = delegate(Spatial a, ItemGeneral b)
77 {
78 if (!(a is Zone))
79 {
80 return;
81 }
82 this.info.SetZone(a as Zone);
83 };
84 callback.onInstantiate = delegate(Spatial a, ItemGeneral b)
85 {
86 b.SetSound(null);
87 b.SetMainText(a.Name, null, true);
88 b.Build();
89 };
90 baseList.callbacks = callback;
91 foreach (Spatial spatial in ELayer.game.spatials.map.Values)
92 {
93 if (spatial is Zone && spatial.parent == ELayer.pc.currentZone.Region)
94 {
95 uilist.Add(spatial);
96 }
97 }
98 uilist.Refresh(false);
99 }
100
101 // Token: 0x04001415 RID: 5141
102 public UIList listFaction;
103
104 // Token: 0x04001416 RID: 5142
105 public UIFactionInfo info;
106
107 // Token: 0x04001417 RID: 5143
108 public Sprite spriteFaction;
109
110 // Token: 0x04001418 RID: 5144
111 public Sprite spriteFaith;
112}
Definition Zone.cs:14