Elin Modding Docs Doc
Loading...
Searching...
No Matches
WindowChara.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Runtime.CompilerServices;
5using PrimitiveUI.Examples;
6using UnityEngine;
7using UnityEngine.UI;
8
9// Token: 0x02000652 RID: 1618
10public class WindowChara : WindowController
11{
12 // Token: 0x17000CED RID: 3309
13 // (get) Token: 0x06002D79 RID: 11641 RVA: 0x000FD23D File Offset: 0x000FB43D
14 public Biography bio
15 {
16 get
17 {
18 return this.chara.bio;
19 }
20 }
21
22 // Token: 0x06002D7A RID: 11642 RVA: 0x000FD24C File Offset: 0x000FB44C
23 public void SetChara(Chara c)
24 {
25 this.chara = c;
26 this.portrait.interactable = this.chara.IsPC;
27 this.OnSwitchContent(this.window);
28 if (this.window.setting.tabs.Count > 6)
29 {
30 this.window.setting.tabs[6].button.SetActive(this.chara.IsPC);
31 }
32 if (this.window.idTab == 6 && !this.chara.IsPC)
33 {
34 this.window.SwitchContent(0);
35 }
36 WindowChara.Instance = this;
37 }
38
39 // Token: 0x06002D7B RID: 11643 RVA: 0x000FD2F3 File Offset: 0x000FB4F3
40 private void Update()
41 {
42 this.rectEquip.anchoredPosition = new Vector2(this.scrollSkill.content.anchoredPosition.x + this.equipPos.x, this.equipPos.y);
43 }
44
45 // Token: 0x06002D7C RID: 11644 RVA: 0x000FD334 File Offset: 0x000FB534
46 public override void OnSwitchContent(Window window)
47 {
48 if (this.chara == null)
49 {
50 return;
51 }
52 this.RefreshStatic();
53 int idTab = window.idTab;
54 if (idTab == 0)
55 {
56 this.RefreshInfo();
57 this.RefreshProfile();
58 }
59 else
60 {
61 this.RefreshSkill(idTab);
62 }
63 bool flag = idTab == 3 || idTab == 4;
64 this.scrollSkill.horizontal = flag;
65 this.scrollSkill.content.anchoredPosition = new Vector2(0f, 0f);
66 this.imageView.sprite = (flag ? this.maskResist : this.mask);
67 if (flag)
68 {
69 this.RefreshEquipment(this.listEquipment2);
70 }
71 this.listEquipment2.transform.parent.SetActive(flag);
72 this.buttonFeatMode.SetActive(idTab == 2 && this.chara.IsPC);
73 }
74
75 // Token: 0x06002D7D RID: 11645 RVA: 0x000FD404 File Offset: 0x000FB604
76 public void SetPortraitBG(int a)
77 {
78 string text = this.chara.GetStr(23, null) ?? "BG_1";
79 text = Portrait.modPortraitBGs.GetNextID(text, a, true);
80 if (text == "BG_1")
81 {
82 text = null;
83 }
84 this.chara.SetStr(23, text);
85 this.RefreshStatic();
86 }
87
88 // Token: 0x06002D7E RID: 11646 RVA: 0x000FD45C File Offset: 0x000FB65C
89 public void SetPortraitFrame(int a)
90 {
91 string text = this.chara.GetStr(24, null) ?? "BGF_1";
92 text = Portrait.modPortraitBGFs.GetNextID(text, a, true);
93 if (text == "BGF_1")
94 {
95 text = null;
96 }
97 this.chara.SetStr(24, text);
98 this.RefreshStatic();
99 }
100
101 // Token: 0x06002D7F RID: 11647 RVA: 0x000FD4B2 File Offset: 0x000FB6B2
102 public void ToggleFeatMode()
103 {
104 this.featMode = !this.featMode;
105 this.RefreshSkill(this.window.idTab);
106 }
107
108 // Token: 0x06002D80 RID: 11648 RVA: 0x000FD4D4 File Offset: 0x000FB6D4
109 public void RefreshFeatMode()
110 {
111 this.buttonFeatMode.mainText.text = "featMode".lang(EClass.pc.feat.ToString() ?? "", null, null, null, null);
112 ColorBlock colors = this.buttonFeatMode.colors;
113 colors.normalColor = colors.normalColor.SetAlpha((float)(this.featMode ? 1 : 0));
114 this.buttonFeatMode.colors = colors;
115 }
116
117 // Token: 0x06002D81 RID: 11649 RVA: 0x000FD552 File Offset: 0x000FB752
118 public void Refresh()
119 {
120 this.OnSwitchContent(this.window);
121 }
122
123 // Token: 0x06002D82 RID: 11650 RVA: 0x000FD560 File Offset: 0x000FB760
124 public void RefreshStatic()
125 {
126 this.textHealth.text = this.chara.hp.ToString() + "/" + this.chara.MaxHP.ToString();
127 this.textMood.text = this.chara.mana.value.ToString() + "/" + this.chara.mana.max.ToString();
128 this.portrait.SetChara(this.chara, null);
129 Sprite @object = Portrait.modPortraitBGs.GetItem(this.chara.GetStr(23, null) ?? "BG_1", false).GetObject(null);
130 @object.texture.filterMode = FilterMode.Bilinear;
131 this.portrait.image.sprite = @object;
132 @object = Portrait.modPortraitBGFs.GetItem(this.chara.GetStr(24, null) ?? "BGF_1", false).GetObject(null);
133 @object.texture.filterMode = FilterMode.Bilinear;
134 this.portrait.imageFrame.sprite = @object;
135 string text = Lang.GetList("difficulties_title")[EClass.game.idDifficulty];
136 this.window.SetCaption(((text.IsEmpty() || !this.chara.IsPC) ? "" : (text + " - ")) + this.chara.NameBraced);
137 this.listAttaribute.Clear();
138 this.listAttaribute.callbacks = new UIList.Callback<Element, ButtonElement>
139 {
140 onClick = delegate(Element a, ButtonElement b)
141 {
142 WidgetTracker.Toggle(a);
143 this.RefreshStatic();
144 },
145 onInstantiate = delegate(Element a, ButtonElement b)
146 {
147 b.SetElement(a, this.chara.elements, ButtonElement.Mode.Attribute);
148 }
149 };
150 List<Element> list = this.chara.elements.ListElements((Element a) => a.HasTag("primary"), null);
151 list.Sort((Element a, Element b) => a.source.sort - b.source.sort);
152 foreach (Element o in list)
153 {
154 this.listAttaribute.Add(o);
155 }
156 this.listAttaribute.Refresh(false);
157 }
158
159 // Token: 0x06002D83 RID: 11651 RVA: 0x000FD7CC File Offset: 0x000FB9CC
160 public void RefreshStatus()
161 {
162 this.layoutStatus.DestroyChildren(false, true);
163 foreach (Stats st in new List<Stats>
164 {
165 this.chara.hunger,
166 this.chara.burden,
167 this.chara.stamina,
168 this.chara.depression,
169 this.chara.bladder,
170 this.chara.hygiene
171 })
172 {
173 this.AddStatus(st);
174 }
175 foreach (Condition st2 in this.chara.conditions)
176 {
177 this.AddStatus(st2);
178 }
179 if (this.layoutStatus.transform.childCount == 1)
180 {
181 this.AddStatus(null);
182 }
183 this.layoutStatus.RebuildLayout(false);
184 }
185
186 // Token: 0x06002D84 RID: 11652 RVA: 0x000FD900 File Offset: 0x000FBB00
187 public void AddNeeds(Stats st)
188 {
189 UIItem uiitem = Util.Instantiate<UIItem>(this.moldNeeds, this.layoutNeeds);
190 uiitem.text1.SetText(st.source.GetName());
191 if (st.GetText().IsEmpty())
192 {
193 uiitem.text2.SetActive(false);
194 }
195 else
196 {
197 st.SetText(uiitem.text2, null);
198 }
199 UIBar componentInChildren = uiitem.GetComponentInChildren<UIBar>();
200 componentInChildren.Refresh((float)st.value, (float)st.max);
201 componentInChildren.image.color = st.GetColor().Multiply(this.barColor1, this.barColor2);
202 }
203
204 // Token: 0x06002D85 RID: 11653 RVA: 0x000FD998 File Offset: 0x000FBB98
205 public void AddStatus(BaseStats st)
206 {
207 BaseStats st2 = st;
208 string text = ((st2 != null) ? st2.GetText() : null) ?? "noItem".lang();
209 if (text.IsEmpty())
210 {
211 return;
212 }
213 UIItem uiitem = Util.Instantiate<UIItem>(this.moldStats, this.layoutStatus);
214 if (st == null)
215 {
216 uiitem.text1.SetText(text, FontColor.Passive);
217 uiitem.button1.interactable = false;
218 }
219 else if (text.IsEmpty())
220 {
221 uiitem.text1.SetText(st.source.GetName());
222 }
223 else
224 {
225 st.SetText(uiitem.text1, null);
226 uiitem.image1.sprite = st.GetSprite();
227 uiitem.image1.SetNativeSize();
228 }
229 if (st != null)
230 {
231 uiitem.button1.SetTooltip(delegate(UITooltip t)
232 {
233 st.WriteNote(t.note, null);
234 }, true);
235 }
236 }
237
238 // Token: 0x06002D86 RID: 11654 RVA: 0x000FDA8C File Offset: 0x000FBC8C
239 public void RefreshProfile()
240 {
241 this.RefreshStatus();
242 this.textName.text = this.chara.NameSimple;
243 this.textAlias.text = this.chara.Aka;
244 this.textTitle.text = (this.chara.IsPC ? EClass.player.title : "-");
245 this.textCurrentZone.text = ((this.chara.currentZone == null) ? "???" : this.chara.currentZone.Name);
246 this.textHomeZone.text = ((this.chara.homeZone == null) ? "???" : this.chara.homeZone.Name);
247 this.textBio.text = this.chara.job.GetText("name", false).ToTitleCase(false);
248 this.textBio2.text = this.bio.TextBio(this.chara);
249 this.textBio3.text = this.bio.TextBio2(this.chara);
250 this.textDV.text = "_DV".lang(this.chara.DV.ToString() ?? "", this.chara.PV.ToString() ?? "", null, null, null);
251 this.textStyle.text = "_style".lang(Lang._weight(this.chara.body.GetWeight(true), true, 0) ?? "", this.chara.elements.GetOrCreateElement(this.chara.GetArmorSkill()).Name, ("style" + this.chara.body.GetAttackStyle().ToString()).lang(), null, null);
252 this.textKarma.text = (this.chara.IsPC ? (EClass.player.karma.ToString() ?? "") : "???");
253 this.textSAN.text = (this.chara.SAN.value.ToString() ?? "");
254 this.textFame.text = (this.chara.IsPC ? (EClass.player.fame.ToString() ?? "") : "???");
255 this.textMoney.text = Lang._currency(this.chara.GetCurrency("money"), true, 14);
256 this.textDeposit.text = (this.chara.IsPC ? Lang._currency(EClass.game.cards.container_deposit.GetCurrency("money"), true, 14) : "???");
257 string text = "deepestLv2".lang((this.chara.IsPCFaction ? EClass.player.stats.deepest : this.chara.LV).ToString() ?? "", null, null, null, null);
258 if (this.chara.IsPCFaction && EClass.player.CountKeyItem("license_void") > 0)
259 {
260 text = text + " " + "deepestLv3".lang(Mathf.Abs(EClass.game.spatials.Find("void").GetDeepestLv()).ToString() ?? "", null, null, null, null);
261 }
262 this.textDeepest.text = text;
263 this.textAssets.text = (this.chara.IsPC ? "tGameTime".lang(EClass.player.stats.days.ToFormat(), EClass.player.stats.turns.ToFormat(), null, null, null) : "???");
264 this.textTerritory.text = (this.chara.IsPC ? (EClass.pc.faction.CountTerritories().ToString() ?? "") : "???");
265 this.buttonLife.SetElement(this.chara.elements.GetOrCreateElement(60), this.chara.elements, ButtonElement.Mode.OnlyValue);
266 this.buttonMana.SetElement(this.chara.elements.GetOrCreateElement(61), this.chara.elements, ButtonElement.Mode.OnlyValue);
267 this.buttonVigor.SetElement(this.chara.elements.GetOrCreateElement(62), this.chara.elements, ButtonElement.Mode.OnlyValue);
268 this.buttonSpeed.SetElement(this.chara.elements.GetOrCreateElement(79), this.chara.elements, ButtonElement.Mode.OnlyValue);
269 this.RefreshEquipment(this.listEquipment);
270 }
271
272 // Token: 0x06002D87 RID: 11655 RVA: 0x000FDF84 File Offset: 0x000FC184
273 public void RefreshEquipment(UIList list)
274 {
275 Element favWeaponSkill = this.chara.GetFavWeaponSkill();
276 string text = ((favWeaponSkill != null) ? favWeaponSkill.Name : null) ?? Element.Get(100).GetText("name", false);
277 string str = text;
278 string str2 = "/";
279 Element favArmorSkill = this.chara.GetFavArmorSkill();
280 text = str + str2 + (((favArmorSkill != null) ? favArmorSkill.Name : null) ?? Element.Get(120).GetText("name", false));
281 this.textFavArmor.SetText(text);
282 list.Clear();
283 UIList.Callback<BodySlot, UIItem> callback = new UIList.Callback<BodySlot, UIItem>();
284 callback.onClick = delegate(BodySlot a, UIItem b)
285 {
286 };
287 callback.onInstantiate = delegate(BodySlot a, UIItem b)
288 {
289 if (a.elementId == 0)
290 {
291 b.button1.interactable = false;
292 return;
293 }
294 Thing thing = a.thing;
295 b.refObj = thing;
296 if (thing != null)
297 {
298 b.button1.icon.material = this.matItem;
299 thing.SetImage(b.button1.icon);
300 }
301 else
302 {
303 b.button1.icon.material = null;
304 b.button1.icon.sprite = SpriteSheet.Get("Media/Graphics/Icon/Element/", "eq_" + a.element.alias);
305 b.button1.icon.color = this.colorUnequipped;
306 b.button1.icon.SetNativeSize();
307 }
308 b.button1.SetTooltip(delegate(UITooltip tt)
309 {
310 if (a.thing != null)
311 {
312 a.thing.WriteNote(tt.note, null, IInspect.NoteMode.Default, null);
313 }
314 else
315 {
316 tt.note.Clear();
317 tt.note.AddHeader(a.name, null);
318 tt.note.AddText("noEQ".lang(), FontColor.DontChange);
319 if (a.elementId == 35)
320 {
321 Thing.AddAttackEvaluation(tt.note, this.chara, null);
322 }
323 }
324 tt.note.Build();
325 }, true);
326 };
327 list.callbacks = callback;
328 foreach (BodySlot bodySlot in this.chara.body.slots)
329 {
330 if (bodySlot.elementId != 44)
331 {
332 list.Add(bodySlot);
333 }
334 }
335 if (list.items.Count < 12)
336 {
337 int num = 12 - list.items.Count;
338 for (int i = 0; i < num; i++)
339 {
340 list.Add(new BodySlot());
341 }
342 }
343 if (list.items.Count > 18)
344 {
345 this.gridEquip.cellSize = new Vector2(52f, 44f);
346 this.gridEquip.spacing = new Vector2(-6f, -12f);
347 }
348 list.Refresh(false);
349 }
350
351 // Token: 0x06002D88 RID: 11656 RVA: 0x000FE12C File Offset: 0x000FC32C
352 public void RefreshInfo()
353 {
354 this.textBirthday.text = this.bio.TextBirthDate(this.chara, false);
355 this.textMom.text = this.chara.bio.nameMom.ToTitleCase(false);
356 this.textDad.text = this.chara.bio.nameDad.ToTitleCase(false);
357 this.textBirthplace.text = this.chara.bio.nameBirthplace.ToTitleCase(false);
358 this.textLike.text = EClass.sources.cards.map[this.bio.idLike].GetName();
359 this.textHobby.text = EClass.sources.elements.map[this.bio.idHobby].GetText("name", false);
360 this.textFaction.text = ((this.chara.faction == null) ? "???" : this.chara.faction.name.ToTitleCase(false));
361 this.textFaith.text = this.chara.faith.Name.ToTitleCase(false);
362 }
363
364 // Token: 0x06002D89 RID: 11657 RVA: 0x000FE273 File Offset: 0x000FC473
365 public void OnClickPortrait()
366 {
367 if (this.chara.IsPC)
368 {
369 EClass.ui.AddLayer<LayerEditPCC>().Activate(this.chara, UIPCC.Mode.Body, null, delegate
370 {
371 this.portrait.SetChara(this.chara, null);
372 });
373 return;
374 }
375 SE.Beep();
376 }
377
378 // Token: 0x06002D8A RID: 11658 RVA: 0x000FE2AC File Offset: 0x000FC4AC
379 public void RefreshSkill(int idTab)
380 {
381 WindowChara.<>c__DisplayClass93_0 CS$<>8__locals1 = new WindowChara.<>c__DisplayClass93_0();
382 CS$<>8__locals1.<>4__this = this;
383 CS$<>8__locals1.idTab = idTab;
384 this.contentList.DestroyChildren(false, true);
385 this.note.Clear();
386 this.note.RebuildLayout(false);
387 if (CS$<>8__locals1.idTab == 1)
388 {
389 CS$<>8__locals1.<RefreshSkill>g__List|5("skillsGeneral", "general");
390 CS$<>8__locals1.<RefreshSkill>g__List|5("skillsCraft", "craft");
391 CS$<>8__locals1.<RefreshSkill>g__List|5("skillsCombat", "combat");
392 CS$<>8__locals1.<RefreshSkill>g__List|5("skillsWeapon", "weapon");
393 return;
394 }
395 if (CS$<>8__locals1.idTab == 2)
396 {
397 this.RefreshFeatMode();
398 if (this.featMode)
399 {
400 CS$<>8__locals1.<RefreshSkill>g__List|6("availableFeats", "general");
401 CS$<>8__locals1.<RefreshSkill>g__List|6("availableFeats_special", "special");
402 CS$<>8__locals1.<RefreshSkill>g__List|6("availableFeats_skill", "skill");
403 CS$<>8__locals1.<RefreshSkill>g__List|6("availableFeats_attribute", "attribute");
404 return;
405 }
406 CS$<>8__locals1.<RefreshSkill>g__Header|0("mutation", null);
407 CS$<>8__locals1.<RefreshSkill>g__ListFeat|3();
408 CS$<>8__locals1.list.callbacks = new UIList.Callback<Feat, ButtonElement>
409 {
410 onClick = delegate(Feat a, ButtonElement b)
411 {
412 WidgetTracker.Toggle(a);
413 b.SetElement(a, CS$<>8__locals1.<>4__this.chara.elements, ButtonElement.Mode.Feat);
414 },
415 onInstantiate = delegate(Feat a, ButtonElement b)
416 {
417 b.SetElement(a, CS$<>8__locals1.<>4__this.chara.elements, ButtonElement.Mode.Feat);
418 },
419 onList = delegate(UIList.SortMode m)
420 {
421 foreach (Element o in CS$<>8__locals1.<>4__this.chara.elements.ListElements((Element a) => a.source.category == "mutation" && a.Value != 0, null))
422 {
423 CS$<>8__locals1.list.Add(o);
424 }
425 }
426 };
427 CS$<>8__locals1.list.List(false);
428 if (CS$<>8__locals1.list.items.Count == 0)
429 {
430 this._header.SetActive(false);
431 CS$<>8__locals1.list.SetActive(false);
432 }
433 CS$<>8__locals1.<RefreshSkill>g__Header|0("etherDisease", null);
434 CS$<>8__locals1.<RefreshSkill>g__ListFeat|3();
435 CS$<>8__locals1.list.callbacks = new UIList.Callback<Feat, ButtonElement>
436 {
437 onClick = delegate(Feat a, ButtonElement b)
438 {
439 WidgetTracker.Toggle(a);
440 b.SetElement(a, CS$<>8__locals1.<>4__this.chara.elements, ButtonElement.Mode.Feat);
441 },
442 onInstantiate = delegate(Feat a, ButtonElement b)
443 {
444 b.SetElement(a, CS$<>8__locals1.<>4__this.chara.elements, ButtonElement.Mode.Feat);
445 },
446 onList = delegate(UIList.SortMode m)
447 {
448 foreach (Element o in CS$<>8__locals1.<>4__this.chara.elements.ListElements((Element a) => a.source.category == "ether" && a.Value != 0, null))
449 {
450 CS$<>8__locals1.list.Add(o);
451 }
452 }
453 };
454 CS$<>8__locals1.list.List(false);
455 if (CS$<>8__locals1.list.items.Count == 0)
456 {
457 this._header.SetActive(false);
458 CS$<>8__locals1.list.SetActive(false);
459 }
460 CS$<>8__locals1.<RefreshSkill>g__Header|0("innateFeats", null);
461 CS$<>8__locals1.<RefreshSkill>g__ListFeat|3();
462 CS$<>8__locals1.list.callbacks = new UIList.Callback<Feat, ButtonElement>
463 {
464 onClick = delegate(Feat a, ButtonElement b)
465 {
466 WidgetTracker.Toggle(a);
467 b.SetElement(a, CS$<>8__locals1.<>4__this.chara.elements, ButtonElement.Mode.Feat);
468 },
469 onInstantiate = delegate(Feat a, ButtonElement b)
470 {
471 b.SetElement(a, CS$<>8__locals1.<>4__this.chara.elements, ButtonElement.Mode.Feat);
472 },
473 onList = delegate(UIList.SortMode m)
474 {
475 foreach (Element o in CS$<>8__locals1.<>4__this.chara.elements.ListElements((Element a) => a.source.category == "feat" && a.HasTag("innate") && a.Value != 0, null))
476 {
477 CS$<>8__locals1.list.Add(o);
478 }
479 }
480 };
481 CS$<>8__locals1.list.List(false);
482 CS$<>8__locals1.<RefreshSkill>g__Header|0("feats", null);
483 CS$<>8__locals1.<RefreshSkill>g__ListFeat|3();
484 BaseList list = CS$<>8__locals1.list;
485 UIList.Callback<Feat, ButtonElement> callback = new UIList.Callback<Feat, ButtonElement>();
486 callback.onClick = delegate(Feat a, ButtonElement b)
487 {
488 WidgetTracker.Toggle(a);
489 b.SetElement(a, CS$<>8__locals1.<>4__this.chara.elements, ButtonElement.Mode.Feat);
490 };
491 callback.onInstantiate = delegate(Feat a, ButtonElement b)
492 {
493 b.SetElement(a, CS$<>8__locals1.<>4__this.chara.elements, ButtonElement.Mode.Feat);
494 };
495 callback.onList = delegate(UIList.SortMode m)
496 {
497 foreach (Element o in CS$<>8__locals1.<>4__this.chara.elements.ListElements((Element a) => a.source.category == "feat" && !a.HasTag("innate") && a.Value != 0, null))
498 {
499 CS$<>8__locals1.list.Add(o);
500 }
501 };
502 callback.onSort = ((Feat a, UIList.SortMode m) => a.GetSortVal(m));
503 list.callbacks = callback;
504 CS$<>8__locals1.list.ChangeSort(UIList.SortMode.ByID);
505 CS$<>8__locals1.list.List(false);
506 return;
507 }
508 else
509 {
510 if (CS$<>8__locals1.idTab == 3)
511 {
512 CS$<>8__locals1.<RefreshSkill>g__Header|0("resistance", null);
513 this.headerEquip.SetText("resistance".lang());
514 CS$<>8__locals1.<RefreshSkill>g__ListResist|2();
515 CS$<>8__locals1.list.callbacks = new UIList.Callback<Element, ButtonElement>
516 {
517 onInstantiate = delegate(Element a, ButtonElement b)
518 {
519 b.SetGrid(a, CS$<>8__locals1.<>4__this.chara);
520 },
521 onList = delegate(UIList.SortMode m)
522 {
523 IEnumerable<SourceElement.Row> rows = EClass.sources.elements.rows;
524 Func<SourceElement.Row, bool> predicate;
525 if ((predicate = CS$<>8__locals1.<>9__35) == null)
526 {
527 predicate = (CS$<>8__locals1.<>9__35 = ((SourceElement.Row a) => a.category == "resist" && ((!a.tag.Contains("hidden") && !a.tag.Contains("high")) || CS$<>8__locals1.<>4__this.chara.Evalue(a.id) != 0)));
528 }
529 foreach (SourceElement.Row row in rows.Where(predicate))
530 {
531 CS$<>8__locals1.list.Add(CS$<>8__locals1.<>4__this.chara.elements.GetOrCreateElement(row.id));
532 }
533 }
534 };
535 CS$<>8__locals1.list.List(false);
536 return;
537 }
538 if (CS$<>8__locals1.idTab == 4)
539 {
540 this.chara.elements.GetOrCreateElement(78);
541 List<Element> eles = this.chara.elements.ListElements(delegate(Element a)
542 {
543 if (a.source.tag.Contains("godAbility") || a.source.categorySub == "god")
544 {
545 return false;
546 }
547 if (a.IsFlag)
548 {
549 if (a.Value == 0)
550 {
551 return false;
552 }
553 }
554 else if ((a.owner == CS$<>8__locals1.<>4__this.chara.elements && a.vLink == 0 && !a.IsFactionElement(CS$<>8__locals1.<>4__this.chara)) || a.source.category == "resist")
555 {
556 return false;
557 }
558 return true;
559 }, null);
560 eles.Sort((Element a, Element b) => a.SortVal(true) - b.SortVal(true));
561 string[] skillCats = new string[]
562 {
563 "general",
564 "labor",
565 "mind",
566 "stealth",
567 "combat",
568 "craft",
569 "weapon"
570 };
571 CS$<>8__locals1.<RefreshSkill>g__Header|0("enchant", null);
572 this.headerEquip.SetText("enchant".lang());
573 CS$<>8__locals1.<RefreshSkill>g__ListResist|2();
574 CS$<>8__locals1.list.callbacks = new UIList.Callback<Element, ButtonElement>
575 {
576 onInstantiate = delegate(Element a, ButtonElement b)
577 {
578 b.SetGrid(a, CS$<>8__locals1.<>4__this.chara);
579 },
580 onList = delegate(UIList.SortMode m)
581 {
582 foreach (Element element in eles)
583 {
584 if (!skillCats.Contains(element.source.categorySub))
585 {
586 CS$<>8__locals1.list.Add(element);
587 }
588 }
589 }
590 };
591 CS$<>8__locals1.list.List(false);
592 CS$<>8__locals1.<RefreshSkill>g__Header|0("skill", null);
593 CS$<>8__locals1.<RefreshSkill>g__ListResist|2();
594 CS$<>8__locals1.list.callbacks = new UIList.Callback<Element, ButtonElement>
595 {
596 onInstantiate = delegate(Element a, ButtonElement b)
597 {
598 b.SetGrid(a, CS$<>8__locals1.<>4__this.chara);
599 },
600 onList = delegate(UIList.SortMode m)
601 {
602 foreach (Element element in eles)
603 {
604 if (skillCats.Contains(element.source.categorySub))
605 {
606 CS$<>8__locals1.list.Add(element);
607 }
608 }
609 }
610 };
611 CS$<>8__locals1.list.List(false);
612 return;
613 }
614 if (CS$<>8__locals1.idTab == 5)
615 {
616 CS$<>8__locals1.<RefreshSkill>g__Header|0("note", null);
617 this.note.transform.SetAsLastSibling();
618 WindowChara.RefreshNote(this.chara, this.note, false);
619 }
620 return;
621 }
622 }
623
624 // Token: 0x06002D8B RID: 11659 RVA: 0x000FE803 File Offset: 0x000FCA03
625 private void OnApplicationFocus(bool focus)
626 {
627 if (this.window.idTab == 5)
628 {
629 WindowChara.RefreshNote(this.chara, this.note, false);
630 }
631 }
632
633 // Token: 0x06002D8C RID: 11660 RVA: 0x000FE828 File Offset: 0x000FCA28
634 public static void RefreshNote(Chara chara, UINote n, bool shortMode = false)
635 {
636 WindowChara.<>c__DisplayClass95_0 CS$<>8__locals1;
637 CS$<>8__locals1.n = n;
638 CS$<>8__locals1.n.Clear();
639 Biography bio = chara.bio;
640 if (shortMode)
641 {
642 CS$<>8__locals1.n.AddText(bio.TextBio(chara) + " " + bio.TextBio2(chara), FontColor.DontChange);
643 CS$<>8__locals1.n.Space(0, 1);
644 }
645 else
646 {
647 UIItem uiitem = CS$<>8__locals1.n.AddItem("ItemBackground");
648 if (chara.IsPC)
649 {
650 uiitem.text1.SetText(EClass.player.GetBackgroundText());
651 uiitem.button1.SetOnClick(delegate
652 {
653 EClass.player.EditBackgroundText();
654 });
655 }
656 else
657 {
658 uiitem.text1.SetText("???");
659 uiitem.button1.SetActive(false);
660 }
661 CS$<>8__locals1.n.Space(16, 1);
662 CS$<>8__locals1.n.AddTopic("TopicDomain", "profile".lang(), bio.TextBio(chara) + " " + bio.TextBio2(chara));
663 }
664 string text = "";
665 ElementContainer elementContainer = chara.IsPC ? EClass.player.GetDomains() : new ElementContainer().ImportElementMap(chara.job.domain);
666 foreach (Element element in elementContainer.dict.Values)
667 {
668 text = text + ((element == elementContainer.dict.Values.First<Element>()) ? "" : ", ") + element.Name;
669 }
670 CS$<>8__locals1.n.AddTopic("TopicDomain", "domain".lang(), text).button1.SetActive(false);
671 string name = chara.GetFavCat().GetName();
672 string name2 = chara.GetFavFood().GetName();
673 WindowChara.<RefreshNote>g__Add|95_0("favgift".lang(name.ToLower().ToTitleCase(false), name2, null, null, null), ref CS$<>8__locals1);
674 WindowChara.<RefreshNote>g__Add|95_0(chara.GetTextHobby(false), ref CS$<>8__locals1);
675 WindowChara.<RefreshNote>g__Add|95_0(chara.GetTextWork(false), ref CS$<>8__locals1);
676 if (chara.IsPC)
677 {
678 CS$<>8__locals1.n.AddTopic("TopicDomain", "totalFeat".lang(), EClass.player.totalFeat.ToString() ?? "");
679 }
680 if (chara.IsPC && EClass.pc.c_daysWithGod > 0)
681 {
682 WindowChara.<RefreshNote>g__AddText|95_1("info_daysWithGod".lang(EClass.pc.c_daysWithGod.ToString() ?? "", EClass.pc.faith.Name, null, null, null), ref CS$<>8__locals1);
683 }
684 if (chara.ride != null)
685 {
686 WindowChara.<RefreshNote>g__AddText|95_1("info_ride".lang(chara.ride.NameBraced, null, null, null, null), ref CS$<>8__locals1);
687 }
688 if (chara.parasite != null)
689 {
690 WindowChara.<RefreshNote>g__AddText|95_1("info_parasite".lang(chara.parasite.NameBraced, null, null, null, null), ref CS$<>8__locals1);
691 }
692 if (EClass.player.IsCriminal)
693 {
694 WindowChara.<RefreshNote>g__AddText|95_1("info_criminal".lang(), ref CS$<>8__locals1);
695 }
696 Element favWeaponSkill = chara.GetFavWeaponSkill();
697 text = (((favWeaponSkill != null) ? favWeaponSkill.Name : null) ?? Element.Get(100).GetText("name", false));
698 text = text + " / " + ("style" + chara.GetFavAttackStyle().ToString()).lang();
699 CS$<>8__locals1.n.AddTopic("TopicDomain", "attackStyle".lang(), text);
700 UINote n2 = CS$<>8__locals1.n;
701 string id = "TopicDomain";
702 string text2 = "armorStyle".lang();
703 Element favArmorSkill = chara.GetFavArmorSkill();
704 n2.AddTopic(id, text2, ((favArmorSkill != null) ? favArmorSkill.Name : null) ?? Element.Get(120).GetText("name", false));
705 if (EClass.debug.showExtra)
706 {
707 CS$<>8__locals1.n.AddText(string.Concat(new string[]
708 {
709 "LV:",
710 chara.LV.ToString(),
711 " exp:",
712 chara.exp.ToString(),
713 " next:",
714 chara.ExpToNext.ToString()
715 }), FontColor.DontChange);
716 CS$<>8__locals1.n.AddText("Luck:" + chara.Evalue(78).ToString(), FontColor.DontChange);
717 }
718 CS$<>8__locals1.n.Build();
719 }
720
721 // Token: 0x06002D92 RID: 11666 RVA: 0x000FEE04 File Offset: 0x000FD004
722 [CompilerGenerated]
723 internal static void <RefreshNote>g__Add|95_0(string s, ref WindowChara.<>c__DisplayClass95_0 A_1)
724 {
725 string[] array = s.Split(':', StringSplitOptions.None);
726 A_1.n.AddTopic("TopicDomain", array[0], (array.Length >= 2) ? array[1].TrimStart(' ') : "").button1.SetActive(false);
727 }
728
729 // Token: 0x06002D93 RID: 11667 RVA: 0x000FEE50 File Offset: 0x000FD050
730 [CompilerGenerated]
731 internal static void <RefreshNote>g__AddText|95_1(string s, ref WindowChara.<>c__DisplayClass95_0 A_1)
732 {
733 A_1.n.AddText(" ・ " + s, FontColor.DontChange);
734 }
735
736 // Token: 0x0400194E RID: 6478
737 public static WindowChara Instance;
738
739 // Token: 0x0400194F RID: 6479
740 public Chara chara;
741
742 // Token: 0x04001950 RID: 6480
743 public Portrait portrait;
744
745 // Token: 0x04001951 RID: 6481
746 public UIText textMood;
747
748 // Token: 0x04001952 RID: 6482
749 public UIText textHealth;
750
751 // Token: 0x04001953 RID: 6483
752 public UIText textName;
753
754 // Token: 0x04001954 RID: 6484
755 public UIText textAlias;
756
757 // Token: 0x04001955 RID: 6485
758 public UIText textTitle;
759
760 // Token: 0x04001956 RID: 6486
761 public UIText textBio;
762
763 // Token: 0x04001957 RID: 6487
764 public UIText textBio2;
765
766 // Token: 0x04001958 RID: 6488
767 public UIText textBio3;
768
769 // Token: 0x04001959 RID: 6489
770 public UIText textBirthday;
771
772 // Token: 0x0400195A RID: 6490
773 public UIText textFaction;
774
775 // Token: 0x0400195B RID: 6491
776 public UIText textFaith;
777
778 // Token: 0x0400195C RID: 6492
779 public UIText textHome;
780
781 // Token: 0x0400195D RID: 6493
782 public UIText textMom;
783
784 // Token: 0x0400195E RID: 6494
785 public UIText textDad;
786
787 // Token: 0x0400195F RID: 6495
788 public UIText textBirthplace;
789
790 // Token: 0x04001960 RID: 6496
791 public UIText textLike;
792
793 // Token: 0x04001961 RID: 6497
794 public UIText textHobby;
795
796 // Token: 0x04001962 RID: 6498
797 public UIText textKarma;
798
799 // Token: 0x04001963 RID: 6499
800 public UIText textSAN;
801
802 // Token: 0x04001964 RID: 6500
803 public UIText textFame;
804
805 // Token: 0x04001965 RID: 6501
806 public UIText textMoney;
807
808 // Token: 0x04001966 RID: 6502
809 public UIText textTax;
810
811 // Token: 0x04001967 RID: 6503
812 public UIText textTerritory;
813
814 // Token: 0x04001968 RID: 6504
815 public UIText textIncome;
816
817 // Token: 0x04001969 RID: 6505
818 public UIText textAssets;
819
820 // Token: 0x0400196A RID: 6506
821 public UIText textDeposit;
822
823 // Token: 0x0400196B RID: 6507
824 public UIText textDeepest;
825
826 // Token: 0x0400196C RID: 6508
827 public UIText textCurrentZone;
828
829 // Token: 0x0400196D RID: 6509
830 public UIText textHomeZone;
831
832 // Token: 0x0400196E RID: 6510
833 public UIList listAttaribute;
834
835 // Token: 0x0400196F RID: 6511
836 public UIList listEquipment;
837
838 // Token: 0x04001970 RID: 6512
839 public UIList listEquipment2;
840
841 // Token: 0x04001971 RID: 6513
842 public UINote note;
843
844 // Token: 0x04001972 RID: 6514
845 public PUIExampleRPGStats graph;
846
847 // Token: 0x04001973 RID: 6515
848 public UIText textStability;
849
850 // Token: 0x04001974 RID: 6516
851 public UIText textLaw;
852
853 // Token: 0x04001975 RID: 6517
854 public UIText textAffection;
855
856 // Token: 0x04001976 RID: 6518
857 public UIText textDominance;
858
859 // Token: 0x04001977 RID: 6519
860 public UIText textExtroversion;
861
862 // Token: 0x04001978 RID: 6520
863 public UIText textFavArmor;
864
865 // Token: 0x04001979 RID: 6521
866 public UIText textDV;
867
868 // Token: 0x0400197A RID: 6522
869 public UIText textStyle;
870
871 // Token: 0x0400197B RID: 6523
872 public LayoutGroup layoutNeeds;
873
874 // Token: 0x0400197C RID: 6524
875 public LayoutGroup layoutStatus;
876
877 // Token: 0x0400197D RID: 6525
878 public GridLayoutGroup gridEquip;
879
880 // Token: 0x0400197E RID: 6526
881 public UIScrollView scrollSkill;
882
883 // Token: 0x0400197F RID: 6527
884 public ButtonElement buttonMana;
885
886 // Token: 0x04001980 RID: 6528
887 public ButtonElement buttonLife;
888
889 // Token: 0x04001981 RID: 6529
890 public ButtonElement buttonVigor;
891
892 // Token: 0x04001982 RID: 6530
893 public ButtonElement buttonSpeed;
894
895 // Token: 0x04001983 RID: 6531
896 public UIItem moldStats;
897
898 // Token: 0x04001984 RID: 6532
899 public UIItem moldNeeds;
900
901 // Token: 0x04001985 RID: 6533
902 public UIHeader moldHeader;
903
904 // Token: 0x04001986 RID: 6534
905 public UIHeader moldHeader2;
906
907 // Token: 0x04001987 RID: 6535
908 public UIHeader headerEquip;
909
910 // Token: 0x04001988 RID: 6536
911 public UIList moldListSkill;
912
913 // Token: 0x04001989 RID: 6537
914 public UIList moldListResist;
915
916 // Token: 0x0400198A RID: 6538
917 public UIList moldListFeat;
918
919 // Token: 0x0400198B RID: 6539
920 public UIList moldListFeatPurchase;
921
922 // Token: 0x0400198C RID: 6540
923 public Transform contentList;
924
925 // Token: 0x0400198D RID: 6541
926 public RectTransform rectEquip;
927
928 // Token: 0x0400198E RID: 6542
929 public UIButton buttonFeatMode;
930
931 // Token: 0x0400198F RID: 6543
932 public Image imageView;
933
934 // Token: 0x04001990 RID: 6544
935 public Sprite mask;
936
937 // Token: 0x04001991 RID: 6545
938 public Sprite maskResist;
939
940 // Token: 0x04001992 RID: 6546
941 public Material matItem;
942
943 // Token: 0x04001993 RID: 6547
944 public Color colorUnequipped;
945
946 // Token: 0x04001994 RID: 6548
947 public Vector2 equipPos;
948
949 // Token: 0x04001995 RID: 6549
950 public bool featMode;
951
952 // Token: 0x04001996 RID: 6550
953 public float barColor1;
954
955 // Token: 0x04001997 RID: 6551
956 public float barColor2;
957
958 // Token: 0x04001998 RID: 6552
959 private UIHeader _header;
960}
Definition Chara.cs:12
Definition Feat.2.cs:8
Definition Stats.cs:6
Definition Thing.cs:10