Elin Decompiled Documentation EA 23.287 Stable Patch 3
Loading...
Searching...
No Matches
WindowCharaMini Class Reference
Inheritance diagram for WindowCharaMini:
WindowController

Public Member Functions

void SetChara (Chara c)
 
override void OnSwitchContent (Window window)
 
void Refresh (int idTab)
 
void RefreshEquipment ()
 
virtual void OnSwitchContent (Window window)
 

Public Attributes

Chara chara
 
UIHeader moldHeader
 
UIHeader moldHeader2
 
UIText textName
 
UIText textInfo1
 
UIText textInfo2
 
UIList moldListResist
 
UIList moldListFeat
 
Transform contentList
 
UINote note
 
UIList listEq
 
Material matItem
 
Color colorUnequipped
 
- Public Attributes inherited from WindowController
Window window
 

Private Attributes

UIHeader _header
 

Detailed Description

Definition at line 5 of file WindowCharaMini.cs.

Member Function Documentation

◆ OnSwitchContent()

override void WindowCharaMini.OnSwitchContent ( Window  window)
inlinevirtual

Reimplemented from WindowController.

Definition at line 41 of file WindowCharaMini.cs.

42 {
43 if (chara != null)
44 {
46 }
47 }
list. Refresh()
int idTab
Definition: Window.cs:694

References chara, Window.idTab, Refresh(), and WindowController.window.

◆ Refresh()

void WindowCharaMini.Refresh ( int  idTab)
inline

Definition at line 49 of file WindowCharaMini.cs.

50 {
51 if (chara == null)
52 {
53 return;
54 }
55 contentList.DestroyChildren();
56 note.Clear();
57 note.SetActive(enable: false);
59 textInfo1.text = "_DV".lang(chara.DV.ToString() ?? "", chara.PV.ToString() ?? "");
60 textInfo2.text = "_style".lang(Lang._weight(chara.body.GetWeight(armorOnly: true)) ?? "", chara.elements.GetOrCreateElement(chara.GetArmorSkill()).Name, ("style" + chara.body.GetAttackStyle()).lang());
61 UIList list = default(UIList);
62 if (idTab == 0)
63 {
64 Header("resistance", null);
65 ListResist();
66 list.callbacks = new UIList.Callback<Element, ButtonElement>
67 {
68 onInstantiate = delegate(Element a, ButtonElement b)
69 {
70 b.SetGrid(a, chara);
71 },
72 onList = delegate
73 {
74 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == "resist" && ((!a.tag.Contains("hidden") && !a.tag.Contains("high")) || chara.Evalue(a.id) != 0)))
75 {
77 }
78 }
79 };
80 list.List();
81 }
82 else if (idTab == 1)
83 {
84 Header("mutation", null);
85 ListFeat();
86 list.callbacks = new UIList.Callback<Feat, ButtonElement>
87 {
88 onClick = delegate(Feat a, ButtonElement b)
89 {
91 },
92 onInstantiate = delegate(Feat a, ButtonElement b)
93 {
95 },
96 onList = delegate
97 {
98 foreach (Element item2 in chara.elements.ListElements((Element a) => a.source.category == "mutation" && a.Value != 0))
99 {
100 list.Add(item2);
101 }
102 }
103 };
104 list.List();
105 if (list.items.Count == 0)
106 {
107 _header.SetActive(enable: false);
108 list.SetActive(enable: false);
109 }
110 Header("etherDisease", null);
111 ListFeat();
112 list.callbacks = new UIList.Callback<Feat, ButtonElement>
113 {
114 onClick = delegate(Feat a, ButtonElement b)
115 {
117 },
118 onInstantiate = delegate(Feat a, ButtonElement b)
119 {
121 },
122 onList = delegate
123 {
124 foreach (Element item3 in chara.elements.ListElements((Element a) => a.source.category == "ether" && a.Value != 0))
125 {
126 list.Add(item3);
127 }
128 }
129 };
130 list.List();
131 if (list.items.Count == 0)
132 {
133 _header.SetActive(enable: false);
134 list.SetActive(enable: false);
135 }
136 Header("innateFeats", null);
137 ListFeat();
138 list.callbacks = new UIList.Callback<Feat, ButtonElement>
139 {
140 onClick = delegate(Feat a, ButtonElement b)
141 {
143 },
144 onInstantiate = delegate(Feat a, ButtonElement b)
145 {
147 },
148 onList = delegate
149 {
150 foreach (Element item4 in chara.elements.ListElements((Element a) => a.source.category == "feat" && a.HasTag("innate") && a.Value != 0))
151 {
152 list.Add(item4);
153 }
154 }
155 };
156 list.List();
157 Header("feats", null);
158 ListFeat();
159 list.callbacks = new UIList.Callback<Feat, ButtonElement>
160 {
161 onClick = delegate(Feat a, ButtonElement b)
162 {
164 },
165 onInstantiate = delegate(Feat a, ButtonElement b)
166 {
168 },
169 onList = delegate
170 {
171 foreach (Element item5 in chara.elements.ListElements((Element a) => a.source.category == "feat" && !a.HasTag("innate") && a.Value != 0))
172 {
173 list.Add(item5);
174 }
175 },
176 onSort = (Feat a, UIList.SortMode m) => a.GetSortVal(m)
177 };
178 list.ChangeSort(UIList.SortMode.ByID);
179 list.List();
180 }
181 else if (idTab == 2)
182 {
183 if (chara.c_upgrades == null)
184 {
185 chara.c_upgrades = new CharaUpgrade();
186 }
187 CharaUpgrade upgrades = chara.c_upgrades;
188 CharaGenes genes = chara.c_genes;
189 int num = upgrades.spent;
190 if (genes != null)
191 {
192 num += genes.GetTotalCost();
193 }
194 note.SetActive(enable: true);
195 note.AddText("feat_pet".lang(chara.feat.ToString() ?? "", num.ToString() ?? ""));
196 note.AddText("feat_inferior".lang(chara.CurrentGeneSlot.ToString() ?? "", chara.MaxGeneSlot.ToString() ?? "", ((genes != null) ? genes.inferior : 0).ToString() ?? ""));
197 HintIcon componentInChildren = note.AddText("NoteText_with_hint", (chara.isScaled ? "feat_pet_type2" : "feat_pet_type1").lang()).GetComponentInChildren<HintIcon>();
198 string text = (chara.isScaled ? "feat_pet_type2_hint" : "feat_pet_type1_hint").lang();
199 if (!chara.isScaled && !chara.HasElement(1273))
200 {
201 text = text + Environment.NewLine + (chara.CanBloom() ? "petawaken2" : "petawaken1").lang();
202 }
203 componentInChildren.tooltip.lang = text;
204 note.Space(8);
205 foreach (CharaUpgrade.Item item6 in upgrades.items)
206 {
207 if (!Element.List_MainAttributesMajor.Contains(item6.idEle))
208 {
209 Element element = Element.Create(item6.idEle, item6.value);
210 note.AddText("upgraded".lang(element.Name.ToTitleCase(), item6.value.ToString() ?? "", item6.cost.ToString() ?? ""));
211 }
212 }
213 if (chara.c_genes != null)
214 {
215 foreach (DNA g in genes.items)
216 {
217 UIItem uIItem = note.AddItem("ItemGene");
218 uIItem.button1.mainText.SetText(g.GetText());
219 uIItem.button1.SetTooltip(delegate(UITooltip t)
220 {
221 UINote uINote = t.note;
222 uINote.Clear();
223 uINote.AddHeader(g.GetText());
224 g.WriteNote(uINote);
225 t.note.Build();
226 });
227 uIItem.button2.SetOnClick(delegate
228 {
229 if (!g.CanRemove(chara))
230 {
231 SE.Beep();
232 }
233 else
234 {
235 Dialog.YesNo("dialog_removeGene", delegate
236 {
237 genes.inferior--;
238 SE.Trash();
239 CharaGenes.Remove(chara, g);
240 Refresh(idTab);
241 });
242 }
243 });
244 uIItem.button2.SetActive(genes != null && genes.inferior > 0);
245 }
246 }
247 if (EClass.debug.enable)
248 {
249 note.AddButton("add 20".lang(), delegate
250 {
251 chara.feat += 20;
252 Refresh(idTab);
253 });
254 note.AddButton("grow 100".lang(), delegate
255 {
256 chara.feat += 100;
258 Refresh(idTab);
259 });
260 }
261 if (upgrades.count > 0)
262 {
263 note.AddButton("feat_reset".lang(), delegate
264 {
265 upgrades.Reset(chara);
266 SE.Trash();
267 Refresh(idTab);
268 });
269 }
270 note.Build();
271 }
272 else if (idTab == 3)
273 {
274 note.SetActive(enable: true);
275 WindowChara.RefreshNote(chara, note, shortMode: true);
276 }
278 void Header(string lang, string lang2)
279 {
281 _header.SetText(lang);
282 if (lang2 != null)
283 {
284 Util.Instantiate(moldHeader2, contentList).SetText(lang2);
285 }
286 }
287 void ListFeat()
288 {
290 }
291 void ListResist()
292 {
294 }
295 }
void SetElement(Element _e, ElementContainer _owner, Mode _mode=Mode.Skill)
void SetGrid(Element e, Chara c)
ElementContainerCard elements
Definition: Card.cs:42
CharaUpgrade c_upgrades
Definition: Card.cs:1859
CharaGenes c_genes
Definition: Card.cs:1883
int feat
Definition: Card.cs:375
string NameSimple
Definition: Card.cs:2179
int Evalue(int ele)
Definition: Card.cs:2611
bool isScaled
Definition: Card.cs:915
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6122
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:479
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:436
int inferior
Definition: CharaGenes.cs:10
int GetTotalCost()
Definition: CharaGenes.cs:25
List< DNA > items
Definition: CharaGenes.cs:7
void Reset(Chara c)
Definition: CharaUpgrade.cs:75
List< Item > items
Definition: CharaUpgrade.cs:61
CharaBody body
Definition: Chara.cs:94
override int GetArmorSkill()
Definition: Chara.cs:8044
int MaxGeneSlot
Definition: Chara.cs:1082
int CurrentGeneSlot
Definition: Chara.cs:1097
void TryUpgrade(bool msg=true)
Definition: Chara.cs:8752
override int DV
Definition: Chara.cs:743
override int PV
Definition: Chara.cs:772
bool CanBloom()
Definition: Chara.cs:8845
bool enable
Definition: CoreDebug.cs:286
Definition: DNA.cs:8
bool CanRemove(Chara c)
Definition: DNA.cs:251
void WriteNote(UINote n, Chara tg=null)
Definition: DNA.cs:575
string GetText()
Definition: DNA.cs:565
Definition: EClass.cs:6
static SourceManager sources
Definition: EClass.cs:43
static CoreDebug debug
Definition: EClass.cs:49
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
Element GetOrCreateElement(Element ele)
int id
Definition: ELEMENT.cs:255
SourceElement.Row source
Definition: ELEMENT.cs:278
bool HasTag(string tag)
Definition: ELEMENT.cs:478
int GetSortVal(UIList.SortMode m)
Definition: ELEMENT.cs:1022
int Value
Definition: ELEMENT.cs:297
virtual string Name
Definition: ELEMENT.cs:309
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1115
static int[] List_MainAttributesMajor
Definition: ELEMENT.cs:247
Definition: FEAT.cs:316
Definition: Lang.cs:7
static string _weight(int a, int b, bool showUnit=true, int unitSize=0)
Definition: Lang.cs:175
SourceElement elements
UIText mainText
Definition: UIButton.cs:102
void SetTooltip(Action< UITooltip > onShowTooltip=null, bool enable=true)
Definition: UIButton.cs:361
void SetText(string s)
Definition: UIHeader.cs:24
Definition: UIItem.cs:5
UIButton button1
Definition: UIItem.cs:18
UIButton button2
Definition: UIItem.cs:20
Definition: UIList.cs:9
List< object > items
Definition: UIList.cs:273
SortMode
Definition: UIList.cs:27
override void Add(object item)
Definition: UIList.cs:354
void ChangeSort(SortMode m)
Definition: UIList.cs:757
override void List()
Definition: UIList.cs:769
Definition: UINote.cs:6
void Clear()
Definition: UINote.cs:35
UIItem AddItem(string id)
Definition: UINote.cs:139
UIItem AddHeader(string text, Sprite sprite=null)
Definition: UINote.cs:79
UIButton AddButton(string text, Action onClick)
Definition: UINote.cs:182
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Space(int sizeY=0, int sizeX=1)
Definition: UINote.cs:62
void Build()
Definition: UINote.cs:49
void SetText(string s)
Definition: UIText.cs:163
UINote note
Definition: UITooltip.cs:21
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67
static void Toggle(Element e)
Transform contentList
UIHeader moldHeader2
UIHeader moldHeader
static void RefreshNote(Chara chara, UINote n, bool shortMode=false)
Definition: WindowChara.cs:894

References _header, Lang._weight(), UIList.Add(), UINote.AddButton(), UINote.AddHeader(), UINote.AddItem(), UINote.AddText(), Chara.body, UINote.Build(), UIItem.button1, UIItem.button2, Card.c_genes, Card.c_upgrades, Chara.CanBloom(), DNA.CanRemove(), UIList.ChangeSort(), chara, UINote.Clear(), contentList, Element.Create(), Chara.CurrentGeneSlot, EClass.debug, Chara.DV, Card.elements, SourceManager.elements, CoreDebug.enable, Card.Evalue(), Card.feat, Chara.GetArmorSkill(), CharaBody.GetAttackStyle(), ElementContainer.GetOrCreateElement(), Element.GetSortVal(), DNA.GetText(), CharaGenes.GetTotalCost(), CharaBody.GetWeight(), Card.HasElement(), Element.HasTag(), Header, Element.id, CharaGenes.inferior, Card.isScaled, item, CharaGenes.items, CharaUpgrade.items, UIList.items, UIList.List(), Element.List_MainAttributesMajor, ElementContainer.ListElements(), UIButton.mainText, Chara.MaxGeneSlot, Element.Name, Card.NameSimple, UITooltip.note, note, Chara.PV, Refresh(), ButtonElement.SetElement(), ButtonElement.SetGrid(), UIText.SetText(), UIButton.SetTooltip(), Element.source, EClass.sources, UINote.Space(), CharaUpgrade.spent, textName, WidgetTracker.Toggle(), Chara.TryUpgrade(), Element.Value, and DNA.WriteNote().

◆ RefreshEquipment()

void WindowCharaMini.RefreshEquipment ( )
inline

Definition at line 297 of file WindowCharaMini.cs.

298 {
299 UIList uIList = listEq;
300 uIList.Clear();
301 uIList.callbacks = new UIList.Callback<BodySlot, UIItem>
302 {
303 onClick = delegate
304 {
305 },
306 onInstantiate = delegate(BodySlot a, UIItem b)
307 {
308 if (a.elementId == 0)
309 {
310 b.button1.interactable = false;
311 }
312 else
313 {
314 Thing thing = (Thing)(b.refObj = a.thing);
315 if (thing != null)
316 {
317 b.button1.icon.material = matItem;
318 thing.SetImage(b.button1.icon);
319 }
320 else
321 {
322 b.button1.icon.material = null;
323 b.button1.icon.sprite = SpriteSheet.Get("Media/Graphics/Icon/Element/", "eq_" + a.element.alias);
324 b.button1.icon.color = colorUnequipped;
325 b.button1.icon.SetNativeSize();
326 }
327 b.button1.SetTooltip(delegate(UITooltip tt)
328 {
329 if (a.thing != null)
330 {
331 a.thing.WriteNote(tt.note);
332 }
333 else
334 {
335 tt.note.Clear();
336 tt.note.AddHeader(a.name);
337 tt.note.AddText("noEQ".lang());
338 if (a.elementId == 35)
339 {
341 }
342 }
343 tt.note.Build();
344 });
345 }
346 },
347 onSort = (BodySlot a, UIList.SortMode m) => -a.element.sort
348 };
349 foreach (BodySlot slot in chara.body.slots)
350 {
351 if (slot.elementId != 44)
352 {
353 uIList.Add(slot);
354 }
355 }
356 uIList.Sort();
357 uIList.Refresh();
358 }
string name
Definition: BodySlot.cs:14
int elementId
Definition: BodySlot.cs:6
Thing thing
Definition: BodySlot.cs:8
SourceElement.Row element
Definition: BodySlot.cs:16
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6316
List< BodySlot > slots
Definition: CharaBody.cs:8
static Sprite Get(string id)
Definition: SpriteSheet.cs:28
Definition: Thing.cs:8
override void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
Definition: Thing.cs:882
static void AddAttackEvaluation(UINote n, Chara chara, Thing current=null)
Definition: Thing.cs:1478
Image icon
Definition: UIButton.cs:110
object refObj
Definition: UIItem.cs:30
override void Clear()
Definition: UIList.cs:401
virtual void Refresh(bool highlightLast=false)
Definition: UIList.cs:476
void Sort()
Definition: UIList.cs:749

References Thing.AddAttackEvaluation(), UINote.AddHeader(), UINote.AddText(), Chara.body, UINote.Build(), UIItem.button1, UIList.Clear(), UINote.Clear(), BodySlot.element, BodySlot.elementId, SpriteSheet.Get(), UIButton.icon, BodySlot.name, UITooltip.note, UIItem.refObj, Card.SetImage(), UIButton.SetTooltip(), CharaBody.slots, BodySlot.thing, and Thing.WriteNote().

◆ SetChara()

void WindowCharaMini.SetChara ( Chara  c)
inline

Definition at line 35 of file WindowCharaMini.cs.

36 {
37 chara = c;
38 Refresh(0);
39 }

References chara, and Refresh().

Member Data Documentation

◆ _header

UIHeader WindowCharaMini._header
private

Definition at line 33 of file WindowCharaMini.cs.

Referenced by Refresh().

◆ chara

Chara WindowCharaMini.chara

Definition at line 7 of file WindowCharaMini.cs.

Referenced by OnSwitchContent(), Refresh(), and SetChara().

◆ colorUnequipped

Color WindowCharaMini.colorUnequipped

Definition at line 31 of file WindowCharaMini.cs.

◆ contentList

Transform WindowCharaMini.contentList

Definition at line 23 of file WindowCharaMini.cs.

Referenced by Refresh().

◆ listEq

UIList WindowCharaMini.listEq

Definition at line 27 of file WindowCharaMini.cs.

◆ matItem

Material WindowCharaMini.matItem

Definition at line 29 of file WindowCharaMini.cs.

◆ moldHeader

UIHeader WindowCharaMini.moldHeader

Definition at line 9 of file WindowCharaMini.cs.

◆ moldHeader2

UIHeader WindowCharaMini.moldHeader2

Definition at line 11 of file WindowCharaMini.cs.

◆ moldListFeat

UIList WindowCharaMini.moldListFeat

Definition at line 21 of file WindowCharaMini.cs.

◆ moldListResist

UIList WindowCharaMini.moldListResist

Definition at line 19 of file WindowCharaMini.cs.

◆ note

UINote WindowCharaMini.note

Definition at line 25 of file WindowCharaMini.cs.

Referenced by Refresh().

◆ textInfo1

UIText WindowCharaMini.textInfo1

Definition at line 15 of file WindowCharaMini.cs.

◆ textInfo2

UIText WindowCharaMini.textInfo2

Definition at line 17 of file WindowCharaMini.cs.

◆ textName

UIText WindowCharaMini.textName

Definition at line 13 of file WindowCharaMini.cs.

Referenced by Refresh().


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