17 return this.chara.bio;
23 public string TextUnknown
27 return "lore_unknown".lang();
32 public void SetChara(
Chara c)
34 this.listMode = Lang.GetList(
"startMode");
35 this.listDifficulties = Lang.GetList(
"difficulties");
36 this.textMode.SetText(this.listMode[
EMono.game.idPrologue]);
37 this.textDifficulty.SetText(this.listDifficulties[
EMono.game.idDifficulty]);
40 this.SetPortraitSlider();
42 this.toggleExtra.SetToggle(this.extraRace, delegate(
bool a)
51 public void BuildRaces()
55 bool flag =
EMono.core.config.test.extraRace;
58 if (row.playable == 1 || (row.playable <= 6 &&
this.extraRace) || (flag && row.playable != 9))
65 if (row2.playable == 1 || (row2.playable <= 6 &&
this.extraRace) || (flag && row2.playable != 9))
77 this.RefreshPortraitZoom(
false);
81 public void RefreshPortraitZoom(
bool force =
false)
83 if (!this.portraitZoom)
87 List<GameObject> hovered = InputModuleEX.GetPointerEventData(-1).hovered;
89 using (List<GameObject>.Enumerator enumerator = hovered.GetEnumerator())
91 while (enumerator.MoveNext())
93 if (enumerator.Current.transform.IsChildOf(
this.portrait.transform))
100 this.portraitZoom.SetActive(enable);
104 public void Refresh()
106 this.chara.elements.ApplyPotential(0);
108 this.textSign.SetText(
"signDisembark".lang(prologue.month.ToString() ??
"", prologue.day.ToString() ??
"", prologue.year.ToString() ??
"",
null,
null));
109 this.RefreshPortraitZoom(
false);
110 this.inputAlias.text = this.chara.Aka;
111 this.inputName.text = this.chara.c_altName;
112 this.inputRace.text = this.chara.race.GetText(
"name",
false).ToTitleCase(
true);
113 this.inputJob.text = this.chara.job.GetText(
"name",
false).ToTitleCase(
true);
114 this.inputGender.text = Lang._gender(this.chara.bio.gender);
115 this.inputAge.text = Lang.GetList(
"ages")[this.ageIndex];
117 this.note.AddTopic(
"name".lang(),
"nameBio".lang(this.chara.NameSimple,
this.chara.Aka,
null,
null,
null));
118 this.note.AddTopic(
"birthday".lang(), this.bio.TextBirthDate(
this.chara,
true) + ((
this.ageIndex == 0) ?
"" : (
" (" + Lang.GetList(
"ages")[
this.ageIndex] +
")")));
119 this.note.AddTopic(
"appearance".lang(), this.bio.TextAppearance());
120 this.note.AddTopic(
"dad".lang(), this.bio.nameDad.ToTitleCase(
false));
121 this.note.AddTopic(
"mom".lang(), this.bio.nameMom.ToTitleCase(
false));
122 this.note.AddTopic(
"birthLoc".lang(), this.bio.nameBirthplace.ToTitleCase(
false));
124 this.noteRace.Clear();
125 this.noteRace.AddHeaderTopic(
"race".lang() +
": " + this.chara.race.GetText(
"name",
false).ToTitleCase(
true),
null);
126 this.noteRace.Space(8, 1);
127 this.noteRace.AddText(
"NoteText_long", this.chara.race.GetDetail().IsEmpty(
this.TextUnknown), FontColor.DontChange).Hyphenate();
128 this.noteRace.Build();
129 this.noteJob.Clear();
130 this.noteJob.AddHeaderTopic(
"job".lang() +
": " + this.chara.job.GetText(
"name",
false).ToTitleCase(
true),
null);
131 this.noteJob.Space(8, 1);
132 this.noteJob.AddText(
"NoteText_long", this.chara.job.GetDetail().IsEmpty(
this.TextUnknown), FontColor.DontChange).Hyphenate();
133 this.AddDomain(this.noteJob,
EMono.player.GetDomains(),
true);
134 this.noteJob.Build();
136 this.note2.AddHeaderTopic(
"attributes".lang(),
null);
137 this.chara.elements.AddNote(this.note2, (
Element e) => e.HasTag(
"primary"),
null,
ElementContainer.NoteMode.CharaMake,
false,
null,
null);
138 this.note2.Space(0, 1);
139 this.note2.AddHeaderTopic(
"skills".lang(),
null);
140 this.chara.elements.AddNote(this.note2, (
Element e) => e.source.category ==
"skill" && e.ValueWithoutLink > 1 && e.source.categorySub !=
"weapon",
null,
ElementContainer.NoteMode.CharaMake,
false,
null,
null);
141 this.note2.Space(0, 1);
142 this.note2.AddHeaderTopic(
"feats".lang(),
null);
147 foreach (Text text
in this.note2.gameObject.GetComponentsInChildren<Text>())
149 Shadow shadow = text.GetComponent<Shadow>();
152 shadow = text.gameObject.AddComponent<Shadow>();
154 shadow.effectColor = Color.black;
160 public void ListModes()
162 EMono.ui.AddLayer<
LayerList>().SetStringList(() => this.listMode, delegate(
int a,
string b)
164 EMono.game.idPrologue = a;
166 EMono.world.date.year = prologue.year;
167 EMono.world.date.month = prologue.month;
168 EMono.world.date.day = prologue.day;
169 EMono.world.weather._currentCondition = prologue.weather;
170 this.textMode.SetText(this.listMode[
EMono.game.idPrologue]);
172 },
true).SetSize(450f, -1f).SetTitles(
"wStartMode",
null);
176 public void ListDifficulties()
178 TooltipManager.Instance.HideTooltips(
true);
179 TooltipManager.Instance.disableHide =
"note";
183 EMono.game.idDifficulty = a.ID;
184 this.textDifficulty.SetText(this.listDifficulties[
EMono.game.idDifficulty]);
188 UIButton b = item.button1;
189 b.SetTooltip(delegate(UITooltip t)
192 t.note.AddHeader(a.Name,
null);
194 t.note.AddText(
"NoteText_medium",
"vow_" + a.ID.ToString(), FontColor.DontChange).Hyphenate();
200 TooltipManager.Instance.GetComponent<CanvasGroup>().alpha = 0f;
201 TooltipManager.Instance.GetComponent<CanvasGroup>().DOFade(1f, 0.3f);
202 EMono.core.actionsNextFrame.Add(delegate
204 b.ShowTooltipForced(
true);
208 },
true).SetTitles(
"wDifficulty",
null);
209 RectTransform rectTransform =
EMono.ui.GetLayer<
LayerList>(
false).windows[0].Rect();
210 rectTransform.pivot =
new Vector2(0.5f, 0.5f);
211 rectTransform.anchoredPosition = this.posList2;
212 TweenUtil.Tween(0.3f,
null, delegate()
214 UIButton.TryShowTip(
null,
true,
true);
219 public void RerollAlias()
221 this.chara._alias = AliasGen.GetRandomAlias();
226 public void ListAlias()
230 List<string> list =
new List<string>();
231 for (
int i = 0; i < 10; i++)
233 list.Add(AliasGen.GetRandomAlias());
236 }, delegate(
int a,
string b)
238 this.chara._alias = b;
240 },
true).SetSize(450f, -1f).EnableReroll().SetTitles(
"wAlias",
null);
244 public void RerollName()
246 this.chara.c_altName = NameGen.getRandomName();
251 public void EditName()
253 Dialog.InputName(
"dialogChangeName", this.chara.c_altName.IsEmpty(
this.chara.NameSimple), delegate(
bool cancel,
string text)
257 this.chara.c_altName = text;
260 },
Dialog.InputType.Default).SetOnKill(delegate
262 EMono.ui.hud.hint.Show(
"hintEmbarkTop".lang(),
false);
267 public void OnEndEditName()
269 this.chara.c_altName = this.inputName.text;
273 public void RerollRace()
275 this.chara.ChangeRace(this.races.RandomItem(
this.chara.race).id);
276 this.RerollBio(
true);
280 public void ListRace()
282 TooltipManager.Instance.HideTooltips(
true);
283 TooltipManager.Instance.disableHide =
"note";
287 this.chara.ChangeRace(a.id);
288 this.RerollBio(true);
291 UIButton b = item.button1;
292 b.SetTooltip(delegate(UITooltip t)
294 ElementContainer elementContainer = new ElementContainer();
295 elementContainer.ApplyElementMap(EMono.pc.uid, SourceValueType.Chara, a.elementMap, 1, false, false);
296 elementContainer.ApplyPotential(1);
298 t.note.AddHeader(a.GetText(
"name", false).ToTitleCase(true), null);
299 elementContainer.AddNoteAll(t.note);
300 t.note.AddHeader(
"lore", null);
301 t.note.AddText(
"NoteText_long", a.GetDetail().IsEmpty(this.TextUnknown), FontColor.DontChange).Hyphenate();
307 TooltipManager.Instance.GetComponent<CanvasGroup>().alpha = 0f;
308 TooltipManager.Instance.GetComponent<CanvasGroup>().DOFade(1f, 0.3f);
309 EMono.core.actionsNextFrame.Add(delegate
311 b.ShowTooltipForced(
true);
315 },
true).SetTitles(
"wRace",
null);
316 RectTransform rectTransform =
EMono.ui.GetLayer<
LayerList>(
false).windows[0].Rect();
317 rectTransform.pivot =
new Vector2(0.5f, 0.5f);
318 rectTransform.anchoredPosition = this.posList;
319 TweenUtil.Tween(0.3f,
null, delegate()
321 UIButton.TryShowTip(
null,
true,
true);
326 public void RerollJob()
328 this.chara.ChangeJob(this.jobs.RandomItem(
this.chara.job).id);
329 EMono.player.RefreshDomain();
334 public void ListJob()
336 TooltipManager.Instance.HideTooltips(
true);
337 TooltipManager.Instance.disableHide =
"note";
341 this.chara.ChangeJob(a.id);
342 EMono.player.RefreshDomain();
343 this.RerollBio(true);
346 UIButton b = item.button1;
347 b.SetTooltip(delegate(UITooltip t)
349 ElementContainer elementContainer = new ElementContainer();
350 elementContainer.ApplyElementMap(EMono.pc.uid, SourceValueType.Chara, a.elementMap, 1, false, false);
351 elementContainer.ApplyPotential(2);
353 t.note.AddHeader(a.GetText(
"name", false).ToTitleCase(true), null);
354 elementContainer.AddNoteAll(t.note);
355 t.note.AddHeader(
"lore", null);
356 t.note.AddText(
"NoteText_long", a.GetDetail().IsEmpty(this.TextUnknown), FontColor.DontChange).Hyphenate();
357 this.AddDomain(t.note, new ElementContainer().ImportElementMap(a.domain), false);
362 TooltipManager.Instance.GetComponent<CanvasGroup>().alpha = 0f;
363 TooltipManager.Instance.GetComponent<CanvasGroup>().DOFade(1f, 0.3f);
364 EMono.core.actionsNextFrame.Add(delegate
366 b.ShowTooltipForced(
true);
370 },
true).SetTitles(
"wClass",
null);
371 RectTransform rectTransform =
EMono.ui.GetLayer<
LayerList>(
false).windows[0].Rect();
372 rectTransform.pivot =
new Vector2(0.5f, 0.5f);
373 rectTransform.anchoredPosition = this.posList;
374 TweenUtil.Tween(0.3f,
null, delegate()
376 UIButton.TryShowTip(
null,
true,
true);
385 foreach (
Element element
in domains.dict.Values)
387 text = text + ((element == domains.dict.Values.First<
Element>()) ?
"" :
", ") + element.Name;
389 UIItem uiitem = n.AddTopic(
"TopicDomain",
"domain".lang(), text);
390 uiitem.button1.SetActive(button &&
EMono.pc.HasElement(1402, 1));
391 uiitem.button1.SetOnClick(delegate
393 EMono.player.SelectDomain(
new Action(this.Refresh));
398 public void ListGender()
400 EMono.ui.AddLayer<
LayerList>().SetStringList(() => Lang.GetList(
"genders"), delegate(
int a,
string b)
402 if (this.chara.bio.gender != a)
404 this.chara.bio.SetGender(a);
405 this.chara.c_idPortrait =
Portrait.GetRandomPortrait(this.chara.bio.gender,
this.chara.GetIdPortraitCat());
406 this.portrait.SetChara(this.chara,
null);
407 this.portraitZoom.SetChara(this.chara,
null);
409 this.SetPortraitSlider();
411 },
true).SetTitles(
"wGender",
null);
415 public void ListAge()
417 EMono.ui.AddLayer<
LayerList>().SetStringList(() => Lang.GetList(
"ages"), delegate(
int a,
string b)
419 if (this.ageIndex != a)
422 this.RerollBio(
true);
425 },
true).SetTitles(
"wAge",
null);
429 public void SetPortraitSlider()
431 if (!this.sliderPortrait)
435 List<ModItem<Sprite>> list =
Portrait.ListPlayerPortraits(this.chara.bio.gender,
false);
436 this.sliderPortrait.SetList<ModItem<Sprite>>(list.Find((ModItem<Sprite> a) => a.id ==
this.chara.c_idPortrait), list, delegate(
int a, ModItem<Sprite> b)
438 this.chara.c_idPortrait = b.id;
439 this.portrait.SetChara(this.chara,
null);
440 this.portraitZoom.SetChara(this.chara,
null);
441 }, (ModItem<Sprite> a) => a.id);
445 public void RerollPCC()
447 this.chara.pccData.Randomize(
null,
null,
false);
448 this.portrait.SetChara(this.chara,
null);
449 this.portraitZoom.SetChara(this.chara,
null);
453 public void RerollHair()
455 this.chara.pccData.SetRandomColor(
"hair");
456 this.portrait.SetChara(this.chara,
null);
457 this.portraitZoom.SetChara(this.chara,
null);
461 public void RerollBio()
463 this.RerollBio(
false);
467 public void RerollBio(
bool keepParent)
469 this.bio.RerollBio(this.chara, this.ageIndex, keepParent);
474 public void EditPCC()
476 EMono.ui.AddLayer<
LayerEditPCC>().Activate(this.chara, UIPCC.Mode.Body,
null, delegate
478 this.portrait.SetChara(this.chara, null);
479 this.SetPortraitSlider();
493 public InputField inputName;
496 public InputField inputAlias;
499 public InputField inputJob;
502 public InputField inputRace;
505 public InputField inputGender;
508 public InputField inputAge;
511 public UISlider sliderPortrait;
520 public UIButton toggleExtra;
523 public UIButton toggleParentLock;
532 public UINote noteJob;
535 public UINote noteRace;
538 public bool addShadow;
541 public bool extraRace;
544 public UIText textSign;
547 public UIText textMode;
550 public UIText textDifficulty;
556 public Vector2 posList;
559 public Vector2 posList2;
563 public string[] listMode;
567 public string[] listDifficulties;