2using System.Collections.Generic;
35 public override void List()
39 onInstantiate = delegate
76 Util.Instantiate<
UIItem>(
"UI/Element/Grid/Attach/affinity", b).image1.sprite = icon;
90 EClass.pc.SetAI(new AI_Goto(room.GetRandomFreePos(), 1));
96 t.
note.
AddHeader(
"infoHome".lang((room !=
null) ? room.Name :
"none".lang()));
97 t.
note.
AddTopic(
"TopicLeft",
"infoBed".lang(), (
bed !=
null) ?
bed.Name.ToTitleCase() :
"none".lang());
106 uIButton.
icon.SetAlpha((
bed !=
null) ? 1f : 0.4f);
107 uIButton.SetActive(enable:
true);
115 sub2.
icon.SetAlpha((a.
GetInt(113) == 1) ? 0.4f : 1f);
120 t.
note.
AddHeader(
"infoSharedEquip".lang((a.
GetInt(113) == 1) ?
"none".lang() :
"infoSharedEquip_on".lang()));
123 sub2.
icon.SetAlpha((a.
GetInt(113) == 1) ? 0.4f : 1f);
124 sub2.SetActive(enable:
true);
141 SE.Play(
"pop_paper");
145 },
"charaInfo",
null,
"sheet");
149 b.GetOrCreate<CanvasGroup>().alpha = 0.6f;
152 CanvasGroup component = b.GetComponent<CanvasGroup>();
155 component.alpha = 1f;
163 foreach (
Hobby item in a.ListWorks().Concat(a.ListHobbies()))
165 if (
item.GetEfficiency(a) <= 0)
173 if (roomWork == null)
179 EClass.pc.SetAI(new AI_Goto(roomWork.GetRandomFreePos(), 1));
184 WriteHobbies(t, a, roomWork);
186 uIButton.
icon.SetAlpha(flag ? 1f : 0.4f);
187 uIButton.SetActive(enable:
true);
193 t.
note.
AddHeader(
"infoWork".lang((roomWork !=
null) ? roomWork.
Name :
"none".lang()));
196 AddText(
item,
"work", a.source.works.Contains(
item.source.alias));
198 foreach (
Hobby item2
in a.ListHobbies())
200 AddText(item2,
"hobby", a.
source.hobbies.Contains(item2.
source.alias));
205 t.note.AddText(
"workNotActive_party".lang(),
FontColor.Warning);
207 if (a.IsPCFactionOrMinion && !a.trait.IsCountAsResident)
209 t.note.AddText(
"notCountResident".lang(),
FontColor.Good);
212 void AddText(
Hobby h,
string lang,
bool fix)
215 string text = h.
Name;
222 string text2 = array[Mathf.Clamp(efficiency / 50, (efficiency != 0) ? 1 : 0, array.Length - 1)];
223 t.note.AddTopic(
"TopicLeft", lang.lang(), text +
" (" + text2 +
")");
224 if (!h.
source.destTrait.IsEmpty())
230 t.note.AddText(
"NoteText_small",
"・ " +
"workDestTrait".lang(cardRow.
GetName().ToTitleCase().TagColor(flag ?
FontColor.Good :
FontColor.Warning)));
234 t.note.AddText(
"NoteText_small",
"・ " +
"workNotActive".lang());
238 for (
int num = 0; num < h.
source.things.Length; num += 2)
240 float num2 = Mathf.Max(1f, (
long)h.
source.things[num + 1].ToInt() * (
long)efficiency * a.homeBranch.GetProductBonus(a) / 100 / 1000);
241 string text3 = h.
source.things[num];
243 if (h.
source.alias ==
"Breeding")
245 num2 = a.race.breeder * 100 / 2500;
246 num2 = num2 * (float)((!(text3 ==
"_egg")) ? 1 : 2) / 3f;
247 if (a.race.breeder > 0 && num2 <= 0f)
252 num2 = (float)Math.Round(num2, 1);
253 t.note.AddText(
"NoteText_small",
"・ " +
"work_produce".lang(s.ToTitleCase(), num2.ToString() ??
""));
255 if (!h.
source.elements.IsEmpty())
257 for (
int num3 = 0; num3 < h.
source.elements.Length; num3 += 2)
260 int num4 = h.
source.elements[num3 + 1];
261 float num5 = ((num4 < 0 || row.id == 2115 || row.id == 2207) ? ((
float)(num4 / 10)) : Mathf.Max((h.
GetEfficiency(a) > 0) ? 1 : 0, (
long)num4 * (long)h.
GetEfficiency(a) * a.homeBranch.efficiency / 100 / 1000));
262 t.note.AddText(
"NoteText_small",
"・ " +
"workBonus_skill".lang(row.
GetName().ToTitleCase(), ((num4 > 0) ?
"+" :
"") + num5) + ((row.
id == 2115 || row.
id == 2207) ? (
" " +
"fixedFactionSkill".lang()) :
""), (num4 >= 0) ?
FontColor.Default :
FontColor.Bad);
265 string[] array2 = h.
source.GetDetail().SplitNewline();
266 foreach (
string text4
in array2)
268 if (!text4.IsEmpty())
270 t.note.AddText(
"NoteText_small",
"・ " + text4);
286 b.
SetSubText(a.
job.GetName().ToTitleCase(wholeText:
true), 300);
311 uIContextMenu.
AddButton(
"findMember", delegate
321 uIContextMenu.
AddButton(
"findMember", delegate
327 uIContextMenu.
AddButton(
"changeName", delegate
335 text = NameGen.getRandomName();
348 uIContextMenu.
AddButton(
"editPCC", delegate
354 uIContextMenu.
AddButton(
"editSkin", delegate
364 uIContextMenu.
AddButton(
"togglePCC", delegate
387 uIContextMenu.
AddButton(
"editPCC", delegate
391 uIContextMenu.
AddButton(
"togglePCC", delegate
413 uIContextMenu.
AddButton(
"makeMaid", delegate
417 EClass.Branch.uidMaid = 0;
421 EClass.Branch.uidMaid = c.
uid;
434 if (isLivestockTimerOn)
472 uIContextMenu.
Show();
497 if (member2.
memberType == memberType && !list.Contains(member2))
512 menuLeft.
AddButton2Line(
"sort", () => list.sortMode.ToString(), delegate
521 layer.showMode = layer.showMode.NextEnum();
List< Action > actionsNextFrame
void WriteHobbies(UITooltip t, Chara a, BaseArea roomWork)
override void OnClick(Chara c, ItemGeneral i)
override string IdHeaderRow
override void OnRefreshMenu()
virtual bool ShowShowMode
virtual bool IsDisabled(Chara c)
override void OnInstantiate(Chara a, ItemGeneral b)
void AddSubButtonWork(ItemGeneral b, Chara a)
virtual void SetSubText(Chara a, ItemGeneral b)
FactionMemberType memberType
virtual bool ShowCharaSheet
virtual LayerPeople.ShowMode ShowMode
override void OnLeaveScreen()
override void OnEnterScreen()
virtual string GetName(int i)
void SetInt(string id, int value=0)
int GetInt(string id, int? defaultInt=null)
override bool IsAliveInCurrentZone
override void SetSortVal(UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
override CardRenderer _CreateRenderer()
override bool IsPCFaction
FactionMemberType memberType
override CardRow sourceCard
string GetTextWork(bool simple=false)
string GetTextHobby(bool simple=false)
int GetRaw(int offsetHours=0)
string GetText(TextFormat format)
int GetRemainingHours(int rawDeadLine)
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
static SourceManager sources
static FactionBranch Branch
void ChangeMemberType(Chara c, FactionMemberType type)
List< HireInfo > listReserve
int GetEfficiency(Chara c)
UIButton AddSubButton(Sprite sprite, Action action, string lang=null, Action< UITooltip > onTooltip=null, string id=null)
void SetChara(Chara c, BaseListPeople list=null)
UIButton SetSubText(string lang, int x, FontColor c=FontColor.Default, TextAnchor align=TextAnchor.MiddleLeft)
static string[] GetList(string id)
LayerChara SetChara(Chara c)
void Activate(Chara _chara)
override void OnSwitchContent(Window window)
Layer SetOnKill(Action action)
Thing FindThing(Func< Thing, bool > func)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
List< ISyncScreen > syncList
Dictionary< string, CardRow > map
override string GetName()
SourceCategory categories
UIItem AddHeader(string text, Sprite sprite=null)
UIItem AddTopic(string id, string text, string value=null)