Elin Modding Docs Doc
All Classes Namespaces
UIFactionInfo.cs
1using System;
2using System.Collections.Generic;
3using DG.Tweening;
4using UnityEngine;
5using UnityEngine.UI;
6
7// Token: 0x0200050E RID: 1294
8public class UIFactionInfo : EMono
9{
10 // Token: 0x17000B0D RID: 2829
11 // (get) Token: 0x060022AD RID: 8877 RVA: 0x000C10B9 File Offset: 0x000BF2B9
12 public EloMap elomap
13 {
14 get
15 {
16 return EMono.scene.elomapActor.elomap;
17 }
18 }
19
20 // Token: 0x17000B0E RID: 2830
21 // (get) Token: 0x060022AE RID: 8878 RVA: 0x000C10CA File Offset: 0x000BF2CA
22 public EloMapActor actor
23 {
24 get
25 {
26 return EMono.scene.elomapActor;
27 }
28 }
29
30 // Token: 0x060022AF RID: 8879 RVA: 0x000C10D6 File Offset: 0x000BF2D6
31 private void Awake()
32 {
33 if (this.imageFull)
34 {
35 this.imageFull.SetAlpha(0f);
36 }
37 }
38
39 // Token: 0x060022B0 RID: 8880 RVA: 0x000C10F8 File Offset: 0x000BF2F8
40 public void SetFaction(Faction f)
41 {
42 this.note.Clear();
43 this.note.AddHeader("HeaderNoteFaction", f.Name, null);
44 this.note.AddTopic("relation", f.relation.GetTextRelation() ?? "");
45 this.note.AddTopic("type", f.TextType ?? "");
46 this.note.Build();
47 if (!this.imageFull)
48 {
49 return;
50 }
51 this.transImage.SetPositionX(this.pivot.position.x);
52 Sprite sprite = Resources.Load<Sprite>("Media/Graphics/Image/Faction/" + f.source.id + "_avatar");
53 TweenUtil.KillTween(ref this.tween, false);
54 if (sprite)
55 {
56 if (sprite != this.imageFull.sprite)
57 {
58 this.imageFull.SetAlpha(0f);
59 }
60 this.imageFull.sprite = sprite;
61 this.imageFull.SetNativeSize();
62 this.tween = this.imageIn.Play(this.imageFull.transform, null, -1f, 0f);
63 return;
64 }
65 this.tween = this.imageOut.Play(this.imageFull.transform, null, -1f, 0f);
66 }
67
68 // Token: 0x060022B1 RID: 8881 RVA: 0x000C1260 File Offset: 0x000BF460
69 public void SetReligion(Religion f)
70 {
71 this.note.Clear();
72 UIItem c = this.note.AddHeader("HeaderFaction", "", f.GetSprite());
73 c.Find("Name", true).SetText(f.Name);
74 c.Find("Topic1", true).SetTopic("relationGod", f.relation.ToString() ?? "");
75 c.Find("Topic2", true).SetTopic("type", f.source.GetText("textType", false) ?? "");
76 c.Find("Topic3", true).SetTopic("avatar", f.source.textAvatar ?? "");
77 string lang = "GSSleep";
78 if (f.id == "harmony")
79 {
80 lang = "GSWithdraw";
81 }
82 if (f.id == "oblivion")
83 {
84 lang = "GSStray";
85 }
86 c.Find("Topic4", true).SetTopic("status", lang);
87 this.note.AddText(f.source.GetDetail(), FontColor.DontChange).Hyphenate();
88 this.note.Build();
89 if (!this.imageFull)
90 {
91 return;
92 }
93 this.transImage.SetPositionX(this.pivot.position.x);
94 Sprite sprite = Resources.Load<Sprite>("Media/Graphics/Image/Faction/" + f.source.id + "_avatar");
95 TweenUtil.KillTween(ref this.tween, false);
96 if (sprite)
97 {
98 if (sprite != this.imageFull.sprite)
99 {
100 this.imageFull.SetAlpha(0f);
101 }
102 this.imageFull.sprite = sprite;
103 this.imageFull.SetNativeSize();
104 this.tween = this.imageIn.Play(this.imageFull.transform, null, -1f, 0f);
105 return;
106 }
107 this.tween = this.imageOut.Play(this.imageFull.transform, null, -1f, 0f);
108 }
109
110 // Token: 0x060022B2 RID: 8882 RVA: 0x000C1488 File Offset: 0x000BF688
111 public void SetZone(Zone _zone)
112 {
113 this.zone = _zone;
114 FactionBranch branch = this.zone.branch;
115 this.gx = this.zone.x;
116 this.gy = this.zone.y;
117 this.note.Clear();
118 this.note.AddHeader("HeaderNoteFaction", this.zone.Name, null);
119 this.note.AddTopic("mainFaction", this.zone.mainFaction.Name ?? "");
120 this.note.AddTopic("branchLv", branch.TextLv);
121 this.note.AddTopic("wealth", branch.resources.worth.value.ToFormat() ?? "");
122 this.note.AddTopic("ranking", EMono.game.spatials.ranks.GetRankText(this.zone) ?? "");
123 this.note.AddTopic("rank_income", "rank_income2".lang(EMono.game.spatials.ranks.GetIncome(this.zone).ToFormat(), null, null, null, null));
124 this.note.Space(0, 1);
125 this.note.AddHeaderTopic("landfeat".lang(), null);
126 List<Element> list = _zone.ListLandFeats();
127 for (int i = 0; i < list.Count; i++)
128 {
129 this.note.AddText(list[i].Name + (((i == 1 && branch.lv < 4) || (i == 2 && branch.lv < 7)) ? "landfeat_locked".lang() : ""), FontColor.DontChange);
130 }
131 this.note.Space(0, 1);
132 this.note.AddHeaderTopic("listRoamers".lang(), null);
133 int num = 0;
134 foreach (Chara chara in EMono.game.cards.globalCharas.Values)
135 {
136 if (chara.homeBranch == branch)
137 {
138 this.note.AddText(chara.Name, FontColor.DontChange);
139 num++;
140 if (num > 5)
141 {
142 break;
143 }
144 }
145 }
146 if (num == 0)
147 {
148 this.note.AddText("????????", FontColor.DontChange);
149 }
150 this.note.Space(0, 1);
151 this.note.AddHeaderTopic("listPolicies".lang(), null);
152 foreach (Element element in branch.elements.dict.Values)
153 {
154 if (element.source.category == "policy")
155 {
156 this.note.AddText(element.Name, FontColor.DontChange);
157 }
158 }
159 this.note.Build();
160 }
161
162 // Token: 0x060022B3 RID: 8883 RVA: 0x000C17B0 File Offset: 0x000BF9B0
163 public void Clear()
164 {
165 this.note.Clear();
166 this.note.Build();
167 }
168
169 // Token: 0x040011F7 RID: 4599
170 public UINote note;
171
172 // Token: 0x040011F8 RID: 4600
173 public Image imageFull;
174
175 // Token: 0x040011F9 RID: 4601
176 public Anime imageIn;
177
178 // Token: 0x040011FA RID: 4602
179 public Anime imageOut;
180
181 // Token: 0x040011FB RID: 4603
182 public Tween tween;
183
184 // Token: 0x040011FC RID: 4604
185 public Transform transImage;
186
187 // Token: 0x040011FD RID: 4605
188 public Transform pivot;
189
190 // Token: 0x040011FE RID: 4606
191 public UIButton buttonBuy;
192
193 // Token: 0x040011FF RID: 4607
194 public UIButton buttonVisit;
195
196 // Token: 0x04001200 RID: 4608
197 public UIButton buttonExplore;
198
199 // Token: 0x04001201 RID: 4609
200 public int gx;
201
202 // Token: 0x04001202 RID: 4610
203 public int gy;
204
205 // Token: 0x04001203 RID: 4611
206 public Zone zone;
207
208 // Token: 0x04001204 RID: 4612
209 public LayoutGroup layoutButtons;
210}
Definition Chara.cs:12
Definition EMono.cs:6
Definition Zone.cs:14