Elin Decompiled Documentation EA 23.270 Nightly Patch 1
Loading...
Searching...
No Matches
WindowChara.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
5using UnityEngine;
6using UnityEngine.UI;
7
9{
10 public static WindowChara Instance;
11
12 public Chara chara;
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
80 public UINote note;
81
83
85
87
89
91
93
95
96 public UIText textDV;
97
99
100 public LayoutGroup layoutNeeds;
101
102 public LayoutGroup layoutStatus;
103
104 public GridLayoutGroup gridEquip;
105
107
109
111
113
115
117
119
121
123
125
127
129
131
133
134 public Transform contentList;
135
136 public RectTransform rectEquip;
137
139
141
142 public Image imageView;
143
144 public Sprite mask;
145
146 public Sprite maskResist;
147
149
151
152 public Vector2 equipPos;
153
154 public bool featMode;
155
156 public float barColor1;
157
158 public float barColor2;
159
161
163
164 public void SetChara(Chara c)
165 {
166 Instance = this;
167 chara = c;
168 portrait.interactable = chara.IsPC;
170 if (window.setting.tabs.Count > 6)
171 {
172 window.setting.tabs[6].button.SetActive(chara.IsPC);
173 }
174 if (window.idTab == 6 && !chara.IsPC)
175 {
177 }
178 }
179
180 private void Update()
181 {
182 rectEquip.anchoredPosition = new Vector2(scrollSkill.content.anchoredPosition.x + equipPos.x, equipPos.y);
183 }
184
185 public override void OnSwitchContent(Window window)
186 {
187 if (chara != null)
188 {
190 int idTab = window.idTab;
191 if (idTab == 0)
192 {
193 RefreshInfo();
195 }
196 else
197 {
198 RefreshSkill(idTab);
199 }
200 bool flag = idTab == 3 || idTab == 4;
201 scrollSkill.horizontal = flag;
202 scrollSkill.content.anchoredPosition = new Vector2(0f, 0f);
203 imageView.sprite = (flag ? maskResist : mask);
204 if (flag)
205 {
207 }
208 listEquipment2.transform.parent.SetActive(flag);
209 buttonFeatMode.SetActive(idTab == 2 && chara.IsPC);
210 buttonFeatOption.SetActive(idTab == 2 && chara.IsPC && featMode);
211 }
212 }
213
214 public void SetPortraitBG(int a)
215 {
216 string currentId = chara.GetStr(23) ?? "BG_1";
217 currentId = Portrait.modPortraitBGs.GetNextID(currentId, a);
218 if (currentId == "BG_1")
219 {
220 currentId = null;
221 }
222 chara.SetStr(23, currentId);
224 }
225
226 public void SetPortraitFrame(int a)
227 {
228 string currentId = chara.GetStr(24) ?? "BGF_1";
229 currentId = Portrait.modPortraitBGFs.GetNextID(currentId, a);
230 if (currentId == "BGF_1")
231 {
232 currentId = null;
233 }
234 chara.SetStr(24, currentId);
236 }
237
238 public void ToggleFeatMode()
239 {
242 buttonFeatOption.SetActive(featMode);
244 {
245 EClass.game.config.showAllFeat = a;
247 });
248 }
249
250 public void RefreshFeatMode()
251 {
252 buttonFeatMode.mainText.text = "featMode".lang(EClass.pc.feat.ToString() ?? "");
253 ColorBlock colors = buttonFeatMode.colors;
254 colors.normalColor = colors.normalColor.SetAlpha(featMode ? 1 : 0);
255 buttonFeatMode.colors = colors;
256 }
257
258 public void Refresh()
259 {
261 }
262
263 public void RefreshStatic()
264 {
265 textHealth.text = chara.hp + "/" + chara.MaxHP;
266 textMood.text = chara.mana.value + "/" + chara.mana.max;
268 Sprite @object = Portrait.modPortraitBGs.GetItem(chara.GetStr(23) ?? "BG_1").GetObject();
269 @object.texture.filterMode = FilterMode.Bilinear;
270 portrait.image.sprite = @object;
271 @object = Portrait.modPortraitBGFs.GetItem(chara.GetStr(24) ?? "BGF_1").GetObject();
272 @object.texture.filterMode = FilterMode.Bilinear;
273 portrait.imageFrame.sprite = @object;
276 listAttaribute.callbacks = new UIList.Callback<Element, ButtonElement>
277 {
278 onClick = delegate(Element a, ButtonElement b)
279 {
282 },
283 onInstantiate = delegate(Element a, ButtonElement b)
284 {
285 b.SetElement(a, chara.elements, ButtonElement.Mode.Attribute);
286 }
287 };
288 List<Element> list = chara.elements.ListElements((Element a) => a.HasTag("primary"));
289 list.Sort((Element a, Element b) => a.source.sort - b.source.sort);
290 foreach (Element item in list)
291 {
293 }
295 }
296
297 public void RefreshStatus()
298 {
299 layoutStatus.DestroyChildren();
300 foreach (Stats item in new List<Stats> { chara.hunger, chara.burden, chara.stamina, chara.depression, chara.bladder, chara.hygiene })
301 {
303 }
304 foreach (Condition condition in chara.conditions)
305 {
306 AddStatus(condition);
307 }
308 if (layoutStatus.transform.childCount == 1)
309 {
310 AddStatus(null);
311 }
312 layoutStatus.RebuildLayout();
313 }
314
315 public void AddNeeds(Stats st)
316 {
317 UIItem uIItem = Util.Instantiate(moldNeeds, layoutNeeds);
318 uIItem.text1.SetText(st.source.GetName());
319 if (st.GetText().IsEmpty())
320 {
321 uIItem.text2.SetActive(enable: false);
322 }
323 else
324 {
325 st.SetText(uIItem.text2);
326 }
327 UIBar componentInChildren = uIItem.GetComponentInChildren<UIBar>();
328 componentInChildren.Refresh(st.value, st.max);
329 componentInChildren.image.color = st.GetColor().Multiply(barColor1, barColor2);
330 }
331
332 public void AddStatus(BaseStats st)
333 {
334 string text = st?.GetText() ?? "noItem".lang();
335 if (text.IsEmpty())
336 {
337 return;
338 }
339 UIItem uIItem = Util.Instantiate(moldStats, layoutStatus);
340 if (st == null)
341 {
342 uIItem.text1.SetText(text, FontColor.Passive);
343 uIItem.button1.interactable = false;
344 }
345 else if (text.IsEmpty())
346 {
347 uIItem.text1.SetText(st.source.GetName());
348 }
349 else
350 {
351 st.SetText(uIItem.text1);
352 uIItem.image1.sprite = st.GetSprite();
353 uIItem.image1.SetNativeSize();
354 }
355 if (st != null)
356 {
357 uIItem.button1.SetTooltip(delegate(UITooltip t)
358 {
359 st.WriteNote(t.note);
360 });
361 }
362 }
363
364 public void RefreshProfile()
365 {
367 textName.text = chara.NameSimple;
368 textAlias.text = chara.Aka;
369 textTitle.text = (chara.IsPC ? EClass.player.title : "-");
370 textCurrentZone.text = ((chara.currentZone == null) ? "???" : chara.currentZone.Name);
371 textHomeZone.text = ((chara.homeZone == null) ? "???" : chara.homeZone.Name);
372 textBio.text = chara.job.GetText().ToTitleCase();
373 textBio2.text = bio.TextBio(chara);
374 textBio3.text = bio.TextBio2(chara);
375 textDV.text = "_DV".lang(chara.DV.ToString() ?? "", chara.PV.ToString() ?? "");
376 textStyle.text = "_style".lang(Lang._weight(chara.body.GetWeight(armorOnly: true)) ?? "", chara.elements.GetOrCreateElement(chara.GetArmorSkill()).Name, ("style" + chara.body.GetAttackStyle()).lang());
377 textKarma.text = (chara.IsPC ? (EClass.player.karma.ToString() ?? "") : "???");
378 textSAN.text = chara.SAN.value.ToString() ?? "";
379 textFame.text = (chara.IsPC ? (EClass.player.fame.ToFormat() ?? "") : "???");
380 textMoney.text = Lang._currency(chara.GetCurrency(), showUnit: true);
381 textDeposit.text = Lang._currency(chara.IsPC ? EClass.game.cards.container_deposit.GetCurrency() : chara.c_allowance, showUnit: true);
382 string text = "deepestLv2".lang((chara.IsPCFaction ? EClass.player.stats.deepest : chara.LV).ToString() ?? "");
383 if (chara.IsPCFaction && EClass.player.CountKeyItem("license_void") > 0)
384 {
385 text = text + " " + "deepestLv3".lang(EClass.player.stats.deepestVoid.ToString() ?? "");
386 }
387 textDeepest.text = text;
388 textAssets.text = (chara.IsPC ? "tGameTime".lang(EClass.player.stats.days.ToFormat(), EClass.player.stats.turns.ToFormat()) : "???");
389 textTerritory.text = (chara.IsPC ? (EClass.pc.faction.CountTerritories().ToString() ?? "") : "???");
395 }
396
397 public void RefreshEquipment(UIList list, bool sort = true)
398 {
399 string text = chara.GetFavWeaponSkill()?.Name ?? Element.Get(100).GetText();
400 text = text + "/" + (chara.GetFavArmorSkill()?.Name ?? Element.Get(120).GetText());
401 textFavArmor.SetText(text);
402 list.Clear();
403 list.callbacks = new UIList.Callback<BodySlot, UIItem>
404 {
405 onClick = delegate
406 {
407 },
408 onInstantiate = delegate(BodySlot a, UIItem b)
409 {
410 if (a.elementId == 0)
411 {
412 b.button1.interactable = false;
413 }
414 else
415 {
416 Thing thing = (Thing)(b.refObj = a.thing);
417 if (thing != null)
418 {
419 b.button1.icon.material = matItem;
420 thing.SetImage(b.button1.icon);
421 }
422 else
423 {
424 b.button1.icon.material = null;
425 b.button1.icon.sprite = SpriteSheet.Get("Media/Graphics/Icon/Element/", "eq_" + a.element.alias);
426 b.button1.icon.color = colorUnequipped;
427 b.button1.icon.SetNativeSize();
428 }
429 b.button1.SetTooltip(delegate(UITooltip tt)
430 {
431 if (a.thing != null)
432 {
433 a.thing.WriteNote(tt.note);
434 }
435 else
436 {
437 tt.note.Clear();
438 tt.note.AddHeader(a.name);
439 tt.note.AddText("noEQ".lang());
440 if (a.elementId == 35)
441 {
443 }
444 }
445 tt.note.Build();
446 });
447 }
448 },
449 onSort = (BodySlot a, UIList.SortMode m) => (a.element.id != 0) ? chara.body.GetSortVal(a) : (-99999)
450 };
451 foreach (BodySlot slot in chara.body.slots)
452 {
453 if (slot.elementId != 44)
454 {
455 list.Add(slot);
456 }
457 }
458 if (list.items.Count < 12)
459 {
460 int num = 12 - list.items.Count;
461 for (int i = 0; i < num; i++)
462 {
463 list.Add(new BodySlot());
464 }
465 }
466 if (list.items.Count > 18)
467 {
468 gridEquip.cellSize = new Vector2(52f, 44f);
469 gridEquip.spacing = new Vector2(-6f, -12f);
470 }
471 if (sort)
472 {
473 list.Sort();
474 }
475 list.Refresh();
476 }
477
478 public void RefreshInfo()
479 {
480 textBirthday.text = bio.TextBirthDate(chara);
481 textMom.text = chara.bio.nameMom.ToTitleCase();
482 textDad.text = chara.bio.nameDad.ToTitleCase();
483 textBirthplace.text = chara.bio.nameBirthplace.ToTitleCase();
484 textLike.text = EClass.sources.cards.map.TryGetValue(bio.idLike, EClass.sources.cards.map["ash"]).GetName();
485 textHobby.text = EClass.sources.elements.map[bio.idHobby].GetText();
486 textFaction.text = ((chara.faction == null) ? "???" : chara.faction.name.ToTitleCase());
487 textFaith.text = chara.faith.Name.ToTitleCase();
488 }
489
490 public void OnClickPortrait()
491 {
492 if (chara.IsPC)
493 {
494 EClass.ui.AddLayer<LayerEditPCC>().Activate(chara, UIPCC.Mode.Body, null, delegate
495 {
497 });
498 }
499 else
500 {
501 SE.Beep();
502 }
503 }
504
505 public void RefreshSkill(int idTab)
506 {
507 contentList.DestroyChildren();
508 note.Clear();
509 note.RebuildLayout();
510 UIList list = default(UIList);
511 if (idTab == 1)
512 {
513 List("skillsGeneral", "general");
514 List("skillsCraft", "craft");
515 List("skillsCombat", "combat");
516 List("skillsWeapon", "weapon");
517 }
518 else if (idTab == 2)
519 {
520 RefreshFeatMode();
521 if (featMode)
522 {
523 List("availableFeats", "general");
524 List("availableFeats_special", "special");
525 List("availableFeats_skill", "skill");
526 List("availableFeats_attribute", "attribute");
527 return;
528 }
529 if (chara.IsPC && chara.HasElement(1274) && chara.c_genes != null && chara.c_genes.items.Count > 0)
530 {
531 Header("genes", null);
532 ListFeat();
533 list.callbacks = new UIList.Callback<DNA, ButtonElement>
534 {
535 onClick = delegate
536 {
537 SE.Beep();
538 },
539 onInstantiate = delegate(DNA a, ButtonElement b)
540 {
541 b.mainText.SetText(a.GetText());
542 b.SetTooltip(delegate(UITooltip t)
543 {
544 UINote uINote = t.note;
545 uINote.Clear();
546 uINote.AddHeader(a.GetText());
547 a.WriteNote(uINote);
548 t.note.Build();
549 });
550 b.subText.text = "(+" + a.slot + ")";
551 b.subText.SetActive(enable: true);
552 b.imagePotential.SetActive(enable: false);
553 },
554 onList = delegate
555 {
556 foreach (DNA item in chara.c_genes.items)
557 {
558 list.Add(item);
559 }
560 }
561 };
562 list.List();
563 }
564 Header("mutation", null);
565 ListFeat();
566 list.callbacks = new UIList.Callback<Feat, ButtonElement>
567 {
568 onClick = delegate(Feat a, ButtonElement b)
569 {
571 b.SetElement(a, chara.elements, ButtonElement.Mode.Feat);
572 },
573 onInstantiate = delegate(Feat a, ButtonElement b)
574 {
575 b.SetElement(a, chara.elements, ButtonElement.Mode.Feat);
576 },
577 onList = delegate
578 {
579 foreach (Element item2 in chara.elements.ListElements((Element a) => a.source.category == "mutation" && a.Value != 0))
580 {
581 list.Add(item2);
582 }
583 }
584 };
585 list.List();
586 if (list.items.Count == 0)
587 {
588 _header.SetActive(enable: false);
589 list.SetActive(enable: false);
590 }
591 Header("etherDisease", null);
592 ListFeat();
593 list.callbacks = new UIList.Callback<Feat, ButtonElement>
594 {
595 onClick = delegate(Feat a, ButtonElement b)
596 {
598 b.SetElement(a, chara.elements, ButtonElement.Mode.Feat);
599 },
600 onInstantiate = delegate(Feat a, ButtonElement b)
601 {
602 b.SetElement(a, chara.elements, ButtonElement.Mode.Feat);
603 },
604 onList = delegate
605 {
606 foreach (Element item3 in chara.elements.ListElements((Element a) => a.source.category == "ether" && a.Value != 0))
607 {
608 list.Add(item3);
609 }
610 }
611 };
612 list.List();
613 if (list.items.Count == 0)
614 {
615 _header.SetActive(enable: false);
616 list.SetActive(enable: false);
617 }
618 Header("innateFeats", null);
619 ListFeat();
620 list.callbacks = new UIList.Callback<Feat, ButtonElement>
621 {
622 onClick = delegate(Feat a, ButtonElement b)
623 {
625 b.SetElement(a, chara.elements, ButtonElement.Mode.Feat);
626 },
627 onInstantiate = delegate(Feat a, ButtonElement b)
628 {
629 b.SetElement(a, chara.elements, ButtonElement.Mode.Feat);
630 },
631 onList = delegate
632 {
633 foreach (Element item4 in chara.elements.ListElements((Element a) => a.source.category == "feat" && a.HasTag("innate") && a.Value != 0))
634 {
635 list.Add(item4);
636 }
637 }
638 };
639 list.List();
640 Header("feats", null);
641 ListFeat();
642 list.callbacks = new UIList.Callback<Feat, ButtonElement>
643 {
644 onClick = delegate(Feat a, ButtonElement b)
645 {
647 b.SetElement(a, chara.elements, ButtonElement.Mode.Feat);
648 },
649 onInstantiate = delegate(Feat a, ButtonElement b)
650 {
651 b.SetElement(a, chara.elements, ButtonElement.Mode.Feat);
652 },
653 onList = delegate
654 {
655 foreach (Element item5 in chara.elements.ListElements((Element a) => a.source.category == "feat" && !a.HasTag("innate") && a.Value != 0))
656 {
657 list.Add(item5);
658 }
659 },
660 onSort = (Feat a, UIList.SortMode m) => a.GetSortVal(m)
661 };
662 list.ChangeSort(UIList.SortMode.ByID);
663 list.List();
664 }
665 else if (idTab == 3)
666 {
667 Header("resistance", null);
668 headerEquip.SetText("resistance".lang());
669 ListResist();
670 list.callbacks = new UIList.Callback<Element, ButtonElement>
671 {
672 onInstantiate = delegate(Element a, ButtonElement b)
673 {
674 b.SetGrid(a, chara);
675 },
676 onList = delegate
677 {
678 foreach (SourceElement.Row item6 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)))
679 {
680 list.Add(chara.elements.GetOrCreateElement(item6.id));
681 }
682 }
683 };
684 list.List();
685 }
686 else if (idTab == 4)
687 {
689 List<Element> eles = chara.elements.ListElements(delegate(Element a)
690 {
691 if (a.source.tag.Contains("godAbility") || a.source.categorySub == "god")
692 {
693 return false;
694 }
695 if (a.IsFlag)
696 {
697 if (a.Value == 0)
698 {
699 return false;
700 }
701 }
702 else
703 {
704 if (a.vSource != 0)
705 {
706 if (a.source.IsWeaponEnc)
707 {
708 return true;
709 }
710 int id = a.id;
711 if ((uint)(id - 55) <= 2u || id == 68 || id == 93)
712 {
713 return true;
714 }
715 if (a.source.category == "enchant")
716 {
717 return true;
718 }
719 }
720 if ((a.owner == chara.elements && a.vLink == 0 && !a.IsFactionElement(chara)) || a.source.category == "resist")
721 {
722 return false;
723 }
724 }
725 return true;
726 });
727 eles.Sort((Element a, Element b) => a.SortVal(charaSheet: true) - b.SortVal(charaSheet: true));
728 string[] skillCats = new string[7] { "general", "labor", "mind", "stealth", "combat", "craft", "weapon" };
729 Header("enchant", null);
730 headerEquip.SetText("enchant".lang());
731 ListResist();
732 list.callbacks = new UIList.Callback<Element, ButtonElement>
733 {
734 onInstantiate = delegate(Element a, ButtonElement b)
735 {
736 b.SetGrid(a, chara);
737 },
738 onList = delegate
739 {
740 foreach (Element item7 in eles)
741 {
742 if (!skillCats.Contains(item7.source.categorySub))
743 {
744 list.Add(item7);
745 }
746 }
747 }
748 };
749 list.List();
750 Header("skill", null);
751 ListResist();
752 list.callbacks = new UIList.Callback<Element, ButtonElement>
753 {
754 onInstantiate = delegate(Element a, ButtonElement b)
755 {
756 b.SetGrid(a, chara);
757 },
758 onList = delegate
759 {
760 foreach (Element item8 in eles)
761 {
762 if (skillCats.Contains(item8.source.categorySub))
763 {
764 list.Add(item8);
765 }
766 }
767 }
768 };
769 list.List();
770 }
771 else if (idTab == 5)
772 {
773 Header("note", null);
774 note.transform.SetAsLastSibling();
775 RefreshNote(chara, note);
776 }
777 void Header(string lang, string lang2)
778 {
779 _header = Util.Instantiate(moldHeader, contentList);
780 _header.SetText(lang);
781 if (lang2 != null)
782 {
783 Util.Instantiate(moldHeader2, contentList).SetText(lang2);
784 }
785 }
786 void List(string lang, string idSubCat)
787 {
788 List<string> cats = new List<string>();
789 cats.Add(idSubCat);
790 if (idSubCat == "general")
791 {
792 cats.Add("labor");
793 cats.Add("mind");
794 cats.Add("stealth");
795 }
796 Header(lang, null);
797 ListSkill();
798 list.callbacks = new UIList.Callback<Element, ButtonElement>
799 {
800 onClick = delegate(Element a, ButtonElement b)
801 {
803 b.SetElement(a, chara.elements);
804 },
805 onInstantiate = delegate(Element a, ButtonElement b)
806 {
807 b.SetElement(a, chara.elements);
808 },
809 onList = delegate
810 {
811 foreach (Element item9 in chara.elements.ListElements((Element a) => (a.Value != 0 || a.ValueWithoutLink != 0 || a.vSource > 0) && a.source.category == "skill" && cats.Contains(a.source.categorySub)))
812 {
813 list.Add(item9);
814 }
815 },
816 onSort = (Element c, UIList.SortMode m) => EClass.sources.elements.alias[c.source.aliasParent].id * -10000 - c.id
817 };
818 list.List(UIList.SortMode.ByElementParent);
819 }
820 void List(string lang, string idSubCat)
821 {
822 Header(lang, "cost");
823 ListFeatPurchase();
824 UIList _list = list;
825 _list.callbacks = new UIList.Callback<Element, ButtonElement>
826 {
827 onClick = delegate(Element a, ButtonElement b)
828 {
830 {
831 SE.BeepSmall();
832 }
833 else if (EClass.pc.feat < a.CostLearn)
834 {
835 SE.BeepSmall();
836 Msg.Say("notEnoughFeatPoint");
837 }
838 else
839 {
840 Dialog.YesNo("dialogBuyFeat".lang(a.CostLearn.ToString() ?? "", a.FullName), delegate
841 {
842 EClass.pc.feat -= a.CostLearn;
843 EClass.pc.SetFeat(a.id, a.Value, msg: true);
844 RefreshSkill(idTab);
845 RefreshFeatMode();
846 RefreshStatic();
847 this.RebuildLayout(recursive: true);
848 });
849 }
850 },
851 onInstantiate = delegate(Element a, ButtonElement b)
852 {
853 b.SetElement(a, chara.elements, ButtonElement.Mode.FeatPurchase);
854 },
855 onList = delegate
856 {
857 foreach (Element item10 in chara.ListAvailabeFeats(pet: false, EClass.game.config.showAllFeat))
858 {
859 if (item10.source.categorySub == idSubCat)
860 {
861 _list.Add(item10);
862 }
863 }
864 }
865 };
866 _list.List();
867 }
868 void ListFeat()
869 {
870 list = Util.Instantiate(moldListFeat, contentList);
871 }
872 void ListFeatPurchase()
873 {
874 list = Util.Instantiate(moldListFeatPurchase, contentList);
875 }
876 void ListResist()
877 {
878 list = Util.Instantiate(moldListResist, contentList);
879 }
880 void ListSkill()
881 {
882 list = Util.Instantiate(moldListSkill, contentList);
883 }
884 }
885
886 private void OnApplicationFocus(bool focus)
887 {
888 if (focus && window.idTab == 5)
889 {
890 RefreshNote(chara, note);
891 }
892 }
893
894 public static void RefreshNote(Chara chara, UINote n, bool shortMode = false)
895 {
896 n.Clear();
897 Biography biography = chara.bio;
898 if (shortMode)
899 {
900 n.AddText(biography.TextBio(chara) + " " + biography.TextBio2(chara));
901 n.Space();
902 }
903 else
904 {
905 UIItem uIItem = n.AddItem("ItemBackground");
906 if (chara.IsPC)
907 {
909 uIItem.button1.SetOnClick(delegate
910 {
912 });
913 }
914 else
915 {
916 uIItem.text1.SetText("???");
917 uIItem.button1.SetActive(enable: false);
918 }
919 n.Space(16);
920 n.AddTopic("TopicDomain", "profile".lang(), biography.TextBio(chara) + " " + biography.TextBio2(chara));
921 }
922 string text = "";
923 ElementContainer elementContainer = (chara.IsPC ? EClass.player.GetDomains() : new ElementContainer().ImportElementMap(chara.job.domain));
924 foreach (Element value in elementContainer.dict.Values)
925 {
926 text = text + ((value == elementContainer.dict.Values.First()) ? "" : ", ") + value.Name;
927 }
928 n.AddTopic("TopicDomain", "domain".lang(), text).button1.SetActive(enable: false);
929 string text2 = chara.GetFavCat().GetName();
930 string @ref = chara.GetFavFood().GetName();
931 Add("favgift".lang(text2.ToLower().ToTitleCase(), @ref));
932 Add(chara.GetTextHobby());
933 Add(chara.GetTextWork());
934 if (chara.IsPC)
935 {
936 n.AddTopic("TopicDomain", "totalFeat".lang(), EClass.player.totalFeat.ToString() ?? "");
937 }
938 text = chara.GetFavWeaponSkill()?.Name ?? Element.Get(100).GetText();
939 text = text + " / " + ("style" + chara.GetFavAttackStyle()).lang();
940 n.AddTopic("TopicDomain", "attackStyle".lang(), text);
941 n.AddTopic("TopicDomain", "armorStyle".lang(), chara.GetFavArmorSkill()?.Name ?? Element.Get(120).GetText());
942 if (chara.IsPC && EClass.pc.c_daysWithGod > 0)
943 {
944 AddText("info_daysWithGod".lang(EClass.pc.c_daysWithGod.ToString() ?? "", EClass.pc.faith.Name));
945 }
946 if (chara.ride != null)
947 {
948 AddText("info_ride".lang(chara.ride.NameBraced));
949 }
950 if (chara.parasite != null)
951 {
952 AddText("info_parasite".lang(chara.parasite.NameBraced));
953 }
955 {
956 AddText("info_criminal".lang());
957 }
958 if (!chara.IsPC)
959 {
960 int num = chara.GetAffinityExpBonus() - 100;
961 if (num != 0)
962 {
963 AddText("affinity_exp_bonus".lang(chara.affinity.Name, ((num > 0) ? "+" : "") + num));
964 }
965 if (chara.c_daysWithPC > 0)
966 {
967 num = chara.GetDaysTogetherBonus() - 100;
968 AddText("info_daysWithPC".lang(chara.c_daysWithPC.ToString() ?? "") + Environment.NewLine + "daystogether_bonus".lang(((num > 0) ? "+" : "") + num));
969 }
970 }
972 {
973 n.AddText("LV:" + chara.LV + " exp:" + chara.exp + " next:" + chara.ExpToNext);
974 n.AddText("Luck:" + chara.Evalue(78));
975 }
976 n.Build();
977 void Add(string s)
978 {
979 string[] array = s.Split(':');
980 n.AddTopic("TopicDomain", array[0], (array.Length >= 2) ? array[1].TrimStart(' ') : "").button1.SetActive(enable: false);
981 }
982 void AddText(string s)
983 {
984 n.AddText(" ・ " + s);
985 }
986 }
987}
FontColor
Definition: FontColor.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
list. Add(item3)
string Name
Definition: Affinity.cs:34
void SetStr(int id, string value=null)
Definition: BaseCard.cs:63
string GetStr(int id, string defaultStr=null)
Definition: BaseCard.cs:54
virtual Sprite GetSprite()
Definition: BaseStats.cs:62
virtual void SetText(UIText t, SkinColorProfile cols=null)
Definition: BaseStats.cs:67
virtual void WriteNote(UINote n, Action< UINote > onWriteNote=null)
Definition: BaseStats.cs:98
SourceStat.Row source
Definition: BaseStats.cs:15
virtual string GetText()
Definition: BaseStats.cs:42
string TextBio(Chara c)
Definition: Biography.cs:505
string nameBirthplace
Definition: Biography.cs:264
string nameDad
Definition: Biography.cs:260
string TextBirthDate(Chara c, bool _age=false)
Definition: Biography.cs:520
string TextBio2(Chara c)
Definition: Biography.cs:510
string nameMom
Definition: Biography.cs:262
string idLike
Definition: Biography.cs:17
int idHobby
Definition: Biography.cs:173
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
Image imagePotential
void SetElement(Element _e, ElementContainer _owner, Mode _mode=Mode.Skill)
void SetGrid(Element e, Chara c)
Thing container_deposit
Definition: CardManager.cs:58
ElementContainerCard elements
Definition: Card.cs:42
int ExpToNext
Definition: Card.cs:2009
int GetAffinityExpBonus()
Definition: Card.cs:3002
Biography bio
Definition: Card.cs:45
int GetCurrency(string id="money")
Definition: Card.cs:4000
int c_daysWithGod
Definition: Card.cs:1474
int c_allowance
Definition: Card.cs:1318
int exp
Definition: Card.cs:399
CharaGenes c_genes
Definition: Card.cs:1846
int feat
Definition: Card.cs:375
int c_daysWithPC
Definition: Card.cs:1486
string NameSimple
Definition: Card.cs:2142
int GetDaysTogetherBonus()
Definition: Card.cs:3007
int Evalue(int ele)
Definition: Card.cs:2574
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6255
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6061
int LV
Definition: Card.cs:387
List< BodySlot > slots
Definition: CharaBody.cs:8
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:464
int GetSortVal(BodySlot slot)
Definition: CharaBody.cs:507
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:421
List< DNA > items
Definition: CharaGenes.cs:7
Definition: Chara.cs:10
SourceCategory.Row GetFavCat()
Definition: Chara.cs:8069
Stats depression
Definition: Chara.cs:1162
CharaBody body
Definition: Chara.cs:94
Faction faction
Definition: Chara.cs:429
override bool IsPC
Definition: Chara.cs:614
override int GetArmorSkill()
Definition: Chara.cs:7880
SourceJob.Row job
Definition: Chara.cs:468
List< Condition > conditions
Definition: Chara.cs:213
Stats hunger
Definition: Chara.cs:1156
override bool IsPCFaction
Definition: Chara.cs:673
string NameBraced
Definition: Chara.cs:516
override int DV
Definition: Chara.cs:731
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:9887
override int MaxHP
Definition: Chara.cs:710
Zone currentZone
Definition: Chara.cs:257
string Aka
Definition: Chara.cs:218
Stats bladder
Definition: Chara.cs:1164
Stats SAN
Definition: Chara.cs:1172
Stats mana
Definition: Chara.cs:1168
override int PV
Definition: Chara.cs:760
Stats stamina
Definition: Chara.cs:1160
Stats burden
Definition: Chara.cs:1158
SourceThing.Row GetFavFood()
Definition: Chara.cs:8049
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
Zone homeZone
Definition: Chara.cs:269
Affinity affinity
Definition: Chara.cs:316
Religion faith
Definition: Chara.cs:441
Element GetFavWeaponSkill()
Definition: Chara.cs:4689
Element GetFavArmorSkill()
Definition: Chara.cs:4694
string GetTextWork(bool simple=false)
Definition: Chara.cs:9083
string GetTextHobby(bool simple=false)
Definition: Chara.cs:9073
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4669
bool showExtra
Definition: CoreDebug.cs:168
bool enable
Definition: CoreDebug.cs:286
Definition: DNA.cs:8
void WriteNote(UINote n, Chara tg=null)
Definition: DNA.cs:567
string GetText()
Definition: DNA.cs:557
Definition: Dialog.cs:7
static Dialog YesNo(string langDetail, Action actionYes, Action actionNo=null, string langYes="yes", string langNo="no")
Definition: Dialog.cs:244
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
static SourceManager sources
Definition: EClass.cs:43
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
static CoreDebug debug
Definition: EClass.cs:49
static UI ui
Definition: EClass.cs:17
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
void ImportElementMap(Dictionary< int, int > map)
Element GetOrCreateElement(Element ele)
bool IsFactionElement(Chara c)
Definition: ELEMENT.cs:498
int ValueWithoutLink
Definition: ELEMENT.cs:299
int id
Definition: ELEMENT.cs:255
SourceElement.Row source
Definition: ELEMENT.cs:278
virtual bool IsPurchaseFeatReqMet(ElementContainer owner, int lv=-1)
Definition: ELEMENT.cs:1102
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:406
ElementContainer owner
Definition: ELEMENT.cs:271
bool HasTag(string tag)
Definition: ELEMENT.cs:478
virtual string FullName
Definition: ELEMENT.cs:311
int GetSortVal(UIList.SortMode m)
Definition: ELEMENT.cs:1018
int Value
Definition: ELEMENT.cs:297
virtual string Name
Definition: ELEMENT.cs:309
int vLink
Definition: ELEMENT.cs:265
int vSource
Definition: ELEMENT.cs:267
virtual int CostLearn
Definition: ELEMENT.cs:319
bool IsFlag
Definition: ELEMENT.cs:307
int SortVal(bool charaSheet=false)
Definition: ELEMENT.cs:467
string name
Definition: FACTION.cs:135
int CountTerritories()
Definition: FACTION.cs:229
Definition: FEAT.cs:310
bool showAllFeat
Definition: Game.cs:58
CardManager cards
Definition: Game.cs:156
Config config
Definition: Game.cs:219
Definition: Lang.cs:6
static string _weight(int a, int b, bool showUnit=true, int unitSize=0)
Definition: Lang.cs:172
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:162
string GetNextID(string currentId, int a, bool ignoreCategory=true)
Definition: ModItemList.cs:35
ModItem< T > GetItem(string id, bool returnNull=false)
Definition: ModItemList.cs:61
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
int deepest
Definition: Player.cs:114
int turns
Definition: Player.cs:84
int deepestVoid
Definition: Player.cs:117
int days
Definition: Player.cs:75
bool IsCriminal
Definition: Player.cs:1339
int karma
Definition: Player.cs:878
Stats stats
Definition: Player.cs:1016
ElementContainer GetDomains()
Definition: Player.cs:1533
int totalFeat
Definition: Player.cs:905
int CountKeyItem(string alias)
Definition: Player.cs:2170
int fame
Definition: Player.cs:881
string GetBackgroundText()
Definition: Player.cs:1624
void EditBackgroundText()
Definition: Player.cs:1645
static ModItemList< Sprite > modPortraitBGFs
Definition: Portrait.cs:8
static ModItemList< Sprite > modPortraitBGs
Definition: Portrait.cs:10
void SetChara(Chara c, PCCData pccData=null)
Definition: Portrait.cs:138
string Name
Definition: Religion.cs:30
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
SourceCard cards
SourceElement elements
virtual string Name
Definition: Spatial.cs:509
static Sprite Get(string id)
Definition: SpriteSheet.cs:28
Definition: Stats.cs:5
override string GetText()
Definition: Stats.cs:94
override Color GetColor(Gradient g)
Definition: Stats.cs:104
virtual int value
Definition: Stats.cs:56
virtual int max
Definition: Stats.cs:68
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:1469
Definition: UIBar.cs:5
void Refresh(float current, float max)
Definition: UIBar.cs:12
UIText subText
Definition: UIButton.cs:104
Image icon
Definition: UIButton.cs:110
UIText mainText
Definition: UIButton.cs:102
void SetTooltip(Action< UITooltip > onShowTooltip=null, bool enable=true)
Definition: UIButton.cs:361
void SetToggle(bool isOn, Action< bool > onToggle=null)
Definition: UIButton.cs:341
void SetText(string s)
Definition: UIHeader.cs:24
Definition: UIItem.cs:5
UIButton button1
Definition: UIItem.cs:18
Image image1
Definition: UIItem.cs:14
UIText text2
Definition: UIItem.cs:8
UIText text1
Definition: UIItem.cs:6
object refObj
Definition: UIItem.cs:30
Definition: UIList.cs:9
List< object > items
Definition: UIList.cs:272
override void Clear()
Definition: UIList.cs:400
UIList parent
Definition: UIList.cs:292
SortMode
Definition: UIList.cs:27
override void Add(object item)
Definition: UIList.cs:353
virtual void Refresh(bool highlightLast=false)
Definition: UIList.cs:475
void ChangeSort(SortMode m)
Definition: UIList.cs:756
override void List()
Definition: UIList.cs:768
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
UIItem AddTopic(string id, string text, string value=null)
Definition: UINote.cs:144
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
Definition: UIText.cs:6
void SetText(string s)
Definition: UIText.cs:159
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)
Sprite maskResist
Definition: WindowChara.cs:146
void OnApplicationFocus(bool focus)
Definition: WindowChara.cs:886
LayoutGroup layoutStatus
Definition: WindowChara.cs:102
UIText textFaith
Definition: WindowChara.cs:36
void RefreshProfile()
Definition: WindowChara.cs:364
void SetChara(Chara c)
Definition: WindowChara.cs:164
GridLayoutGroup gridEquip
Definition: WindowChara.cs:104
Biography bio
Definition: WindowChara.cs:162
void AddStatus(BaseStats st)
Definition: WindowChara.cs:332
Chara chara
Definition: WindowChara.cs:12
ButtonElement buttonVigor
Definition: WindowChara.cs:112
UIText textStability
Definition: WindowChara.cs:84
UIList moldListFeatPurchase
Definition: WindowChara.cs:132
ButtonElement buttonMana
Definition: WindowChara.cs:108
void SetPortraitBG(int a)
Definition: WindowChara.cs:214
Sprite mask
Definition: WindowChara.cs:144
UIText textTerritory
Definition: WindowChara.cs:60
UIText textHealth
Definition: WindowChara.cs:18
UIText textLike
Definition: WindowChara.cs:46
UIItem moldStats
Definition: WindowChara.cs:116
UIButton buttonFeatOption
Definition: WindowChara.cs:140
ButtonElement buttonLife
Definition: WindowChara.cs:110
void RefreshStatus()
Definition: WindowChara.cs:297
UIList listEquipment2
Definition: WindowChara.cs:78
void ToggleFeatMode()
Definition: WindowChara.cs:238
UIText textName
Definition: WindowChara.cs:20
RectTransform rectEquip
Definition: WindowChara.cs:136
UIText textDad
Definition: WindowChara.cs:42
Image imageView
Definition: WindowChara.cs:142
UIText textTitle
Definition: WindowChara.cs:24
UIText textSAN
Definition: WindowChara.cs:52
UIList listEquipment
Definition: WindowChara.cs:76
override void OnSwitchContent(Window window)
Definition: WindowChara.cs:185
UIText textStyle
Definition: WindowChara.cs:98
static void RefreshNote(Chara chara, UINote n, bool shortMode=false)
Definition: WindowChara.cs:894
void OnClickPortrait()
Definition: WindowChara.cs:490
UIText textBio2
Definition: WindowChara.cs:28
UIText textAlias
Definition: WindowChara.cs:22
UIText textHobby
Definition: WindowChara.cs:48
UIItem moldNeeds
Definition: WindowChara.cs:118
UIText textKarma
Definition: WindowChara.cs:50
UIText textDV
Definition: WindowChara.cs:96
UIText textBirthday
Definition: WindowChara.cs:32
UIText textFaction
Definition: WindowChara.cs:34
float barColor1
Definition: WindowChara.cs:156
UIText textDeepest
Definition: WindowChara.cs:68
void Update()
Definition: WindowChara.cs:180
LayoutGroup layoutNeeds
Definition: WindowChara.cs:100
Vector2 equipPos
Definition: WindowChara.cs:152
UIText textMoney
Definition: WindowChara.cs:56
UIText textAssets
Definition: WindowChara.cs:64
UIText textFame
Definition: WindowChara.cs:54
UIList listAttaribute
Definition: WindowChara.cs:74
UIHeader moldHeader
Definition: WindowChara.cs:120
UIText textFavArmor
Definition: WindowChara.cs:94
UIList moldListResist
Definition: WindowChara.cs:128
void SetPortraitFrame(int a)
Definition: WindowChara.cs:226
void RefreshStatic()
Definition: WindowChara.cs:263
UIText textDeposit
Definition: WindowChara.cs:66
void AddNeeds(Stats st)
Definition: WindowChara.cs:315
Transform contentList
Definition: WindowChara.cs:134
UIText textDominance
Definition: WindowChara.cs:90
UIScrollView scrollSkill
Definition: WindowChara.cs:106
UIHeader _header
Definition: WindowChara.cs:160
Color colorUnequipped
Definition: WindowChara.cs:150
UIText textTax
Definition: WindowChara.cs:58
UIHeader moldHeader2
Definition: WindowChara.cs:122
void RefreshEquipment(UIList list, bool sort=true)
Definition: WindowChara.cs:397
Portrait portrait
Definition: WindowChara.cs:14
UIText textHomeZone
Definition: WindowChara.cs:72
UIText textBirthplace
Definition: WindowChara.cs:44
static WindowChara Instance
Definition: WindowChara.cs:10
PUIExampleRPGStats graph
Definition: WindowChara.cs:82
UIList moldListFeat
Definition: WindowChara.cs:130
UIHeader headerEquip
Definition: WindowChara.cs:124
float barColor2
Definition: WindowChara.cs:158
ButtonElement buttonSpeed
Definition: WindowChara.cs:114
UIText textBio3
Definition: WindowChara.cs:30
UIText textBio
Definition: WindowChara.cs:26
UIText textExtroversion
Definition: WindowChara.cs:92
UIText textCurrentZone
Definition: WindowChara.cs:70
UIText textHome
Definition: WindowChara.cs:38
UIText textIncome
Definition: WindowChara.cs:62
void RefreshSkill(int idTab)
Definition: WindowChara.cs:505
void RefreshFeatMode()
Definition: WindowChara.cs:250
UIText textLaw
Definition: WindowChara.cs:86
UIText textAffection
Definition: WindowChara.cs:88
void RefreshInfo()
Definition: WindowChara.cs:478
UIText textMood
Definition: WindowChara.cs:16
UINote note
Definition: WindowChara.cs:80
UIList moldListSkill
Definition: WindowChara.cs:126
Material matItem
Definition: WindowChara.cs:148
UIText textMom
Definition: WindowChara.cs:40
void Refresh()
Definition: WindowChara.cs:258
UIButton buttonFeatMode
Definition: WindowChara.cs:138
List< Tab > tabs
Definition: Window.cs:81
Definition: Window.cs:13
void SwitchContent(UIContent content)
Definition: Window.cs:1198
void SetCaption(string text)
Definition: Window.cs:1289
Setting setting
Definition: Window.cs:606
int idTab
Definition: Window.cs:694