10 public void SetChara(
Chara c)
17 public override void OnSwitchContent(Window window)
19 if (this.chara ==
null)
23 this.Refresh(window.idTab);
27 public void Refresh(
int idTab)
30 CS$<>8__locals1.<>4__this =
this;
31 CS$<>8__locals1.idTab = idTab;
32 if (this.chara ==
null)
36 this.contentList.DestroyChildren(
false,
true);
38 this.note.SetActive(
false);
39 this.textName.SetText(this.chara.NameSimple);
40 this.textInfo1.text =
"_DV".lang(this.chara.DV.ToString() ??
"",
this.chara.PV.ToString() ??
"",
null,
null,
null);
41 this.textInfo2.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);
42 if (CS$<>8__locals1.idTab == 0)
44 CS$<>8__locals1.<Refresh>g__Header|0(
"resistance",
null);
45 CS$<>8__locals1.<Refresh>g__ListResist|1();
50 b.SetGrid(a, CS$<>8__locals1.<>4__this.chara);
52 onList = delegate(UIList.SortMode m)
56 if ((predicate = CS$<>8__locals1.<>9__5) ==
null)
58 predicate = (CS$<>8__locals1.<>9__5 = ((
SourceElement.Row a) => a.category ==
"resist" && ((!a.tag.Contains(
"hidden") && !a.tag.Contains(
"high")) || CS$<>8__locals1.<>4__this.chara.Evalue(a.id) != 0)));
62 CS$<>8__locals1.list.Add(CS$<>8__locals1.<>4__this.chara.elements.GetOrCreateElement(row.id));
66 CS$<>8__locals1.list.List(
false);
68 else if (CS$<>8__locals1.idTab == 1)
70 CS$<>8__locals1.<Refresh>g__Header|0(
"mutation",
null);
71 CS$<>8__locals1.<Refresh>g__ListFeat|2();
72 BaseList list = CS$<>8__locals1.list;
80 b.SetElement(a, CS$<>8__locals1.<>4__this.chara.elements,
ButtonElement.Mode.FeatMini);
82 callback.onList = delegate(UIList.SortMode m)
84 foreach (
Element o
in CS$<>8__locals1.<>4__this.chara.elements.ListElements((
Element a) => a.source.category ==
"mutation" && a.Value != 0,
null))
86 CS$<>8__locals1.list.Add(o);
89 list.callbacks = callback;
90 CS$<>8__locals1.list.List(
false);
91 if (CS$<>8__locals1.list.items.Count == 0)
93 this._header.SetActive(
false);
94 CS$<>8__locals1.list.SetActive(
false);
96 CS$<>8__locals1.<Refresh>g__Header|0(
"etherDisease",
null);
97 CS$<>8__locals1.<Refresh>g__ListFeat|2();
98 BaseList list2 = CS$<>8__locals1.list;
106 b.SetElement(a, CS$<>8__locals1.<>4__this.chara.elements,
ButtonElement.Mode.FeatMini);
108 callback2.onList = delegate(UIList.SortMode m)
110 foreach (
Element o
in CS$<>8__locals1.<>4__this.chara.elements.ListElements((
Element a) => a.source.category ==
"ether" && a.Value != 0,
null))
112 CS$<>8__locals1.list.Add(o);
115 list2.callbacks = callback2;
116 CS$<>8__locals1.list.List(
false);
117 if (CS$<>8__locals1.list.items.Count == 0)
119 this._header.SetActive(
false);
120 CS$<>8__locals1.list.SetActive(
false);
122 CS$<>8__locals1.<Refresh>g__Header|0(
"innateFeats",
null);
123 CS$<>8__locals1.<Refresh>g__ListFeat|2();
124 BaseList list3 = CS$<>8__locals1.list;
132 b.SetElement(a, CS$<>8__locals1.<>4__this.chara.elements,
ButtonElement.Mode.FeatMini);
134 callback3.onList = delegate(UIList.SortMode m)
136 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))
138 CS$<>8__locals1.list.Add(o);
141 list3.callbacks = callback3;
142 CS$<>8__locals1.list.List(
false);
143 CS$<>8__locals1.<Refresh>g__Header|0(
"feats",
null);
144 CS$<>8__locals1.<Refresh>g__ListFeat|2();
145 BaseList list4 = CS$<>8__locals1.list;
153 b.SetElement(a, CS$<>8__locals1.<>4__this.chara.elements,
ButtonElement.Mode.FeatMini);
155 callback4.onList = delegate(UIList.SortMode m)
157 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))
159 CS$<>8__locals1.list.Add(o);
162 callback4.onSort = ((
Feat a, UIList.SortMode m) => a.GetSortVal(m));
163 list4.callbacks = callback4;
164 CS$<>8__locals1.list.ChangeSort(UIList.SortMode.ByID);
165 CS$<>8__locals1.list.List(
false);
167 else if (CS$<>8__locals1.idTab == 2)
169 if (this.chara.c_upgrades ==
null)
175 int num = upgrades.spent;
178 num += genes.GetTotalCost();
180 this.note.SetActive(
true);
181 this.note.AddText(
"feat_pet".lang(this.chara.feat.ToString() ??
"", num.ToString() ??
"",
null,
null,
null), FontColor.DontChange);
182 this.note.AddText(
"feat_inferior".lang(((genes ==
null) ? 0 : genes.items.Count).ToString() ??
"",
this.chara.MaxGene.ToString() ??
"", ((genes ==
null) ? 0 : genes.inferior).ToString() ??
"",
null,
null), FontColor.DontChange);
183 this.note.Space(8, 1);
186 if (!
Element.List_MainAttributesMajor.Contains(item.idEle))
189 this.note.AddText(
"upgraded".lang(element.Name.ToTitleCase(
false), item.value.ToString() ??
"", item.cost.ToString() ??
"",
null,
null), FontColor.DontChange);
192 if (this.chara.c_genes !=
null)
194 using (List<DNA>.Enumerator enumerator2 = genes.items.GetEnumerator())
196 while (enumerator2.MoveNext())
198 DNA g = enumerator2.Current;
199 UIItem uiitem = this.note.AddItem(
"ItemGene");
200 uiitem.button1.mainText.SetText(g.GetText());
201 uiitem.button1.SetTooltip(delegate(UITooltip t)
203 UINote uinote = t.note;
205 uinote.AddHeader(g.GetText(),
null);
210 uiitem.button2.SetOnClick(delegate
212 string langDetail =
"dialog_removeGene";
214 if ((actionYes = <>9__28) ==
null)
216 actionYes = (<>9__28 = delegate()
220 genes.Remove(CS$<>8__locals1.<>4__this.chara, g);
221 CS$<>8__locals1.<>4__this.Refresh(CS$<>8__locals1.idTab);
224 Dialog.YesNo(langDetail, actionYes,
null,
"yes",
"no");
226 uiitem.button2.SetActive(genes !=
null && genes.inferior > 0);
232 this.note.AddButton(
"add 20".lang(), delegate
234 CS$<>8__locals1.<>4__this.chara.feat += 20;
235 CS$<>8__locals1.<>4__this.Refresh(CS$<>8__locals1.idTab);
237 this.note.AddButton(
"grow 100".lang(), delegate
239 CS$<>8__locals1.<>4__this.chara.feat += 100;
240 CS$<>8__locals1.<>4__this.chara.TryUpgrade(
true);
241 CS$<>8__locals1.<>4__this.Refresh(CS$<>8__locals1.idTab);
244 if (upgrades.count > 0)
246 this.note.AddButton(
"feat_reset".lang(), delegate
248 upgrades.Reset(CS$<>8__locals1.<>4__this.chara);
250 CS$<>8__locals1.<>4__this.Refresh(CS$<>8__locals1.idTab);
255 else if (CS$<>8__locals1.idTab == 3)
257 this.note.SetActive(
true);
258 WindowChara.RefreshNote(this.chara, this.note,
true);
260 this.RefreshEquipment();
264 public void RefreshEquipment()
266 UIList uilist = this.listEq;
268 BaseList baseList = uilist;
269 UIList.Callback<
BodySlot, UIItem> callback =
new UIList.Callback<
BodySlot, UIItem>();
270 callback.onClick = delegate(
BodySlot a, UIItem b)
273 callback.onInstantiate = delegate(
BodySlot a, UIItem b)
275 if (a.elementId == 0)
277 b.button1.interactable =
false;
280 Thing thing = a.thing;
284 b.button1.icon.material = this.matItem;
285 thing.SetImage(b.button1.icon);
289 b.button1.icon.material =
null;
290 b.button1.icon.sprite = SpriteSheet.Get(
"Media/Graphics/Icon/Element/",
"eq_" + a.element.alias);
291 b.button1.icon.color = this.colorUnequipped;
292 b.button1.icon.SetNativeSize();
294 b.button1.SetTooltip(delegate(UITooltip tt)
298 a.thing.WriteNote(tt.note,
null,
IInspect.NoteMode.Default,
null);
303 tt.note.AddHeader(a.name,
null);
304 tt.note.AddText(
"noEQ".lang(), FontColor.DontChange);
305 if (a.elementId == 35)
307 Thing.AddAttackEvaluation(tt.note,
this.chara,
null);
313 baseList.callbacks = callback;
314 foreach (
BodySlot bodySlot
in this.chara.body.slots)
316 if (bodySlot.elementId != 44)
318 uilist.Add(bodySlot);
321 uilist.Refresh(
false);
328 public UIHeader moldHeader;
331 public UIHeader moldHeader2;
334 public UIText textName;
337 public UIText textInfo1;
340 public UIText textInfo2;
343 public UIList moldListResist;
346 public UIList moldListFeat;
349 public Transform contentList;
355 public UIList listEq;
358 public Material matItem;
361 public Color colorUnequipped;
364 private UIHeader _header;