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;
92 EClass.pc.SetAI(new AI_Goto(room.GetRandomFreePos(), 1));
98 t.
note.
AddHeader(
"infoHome".lang((room !=
null) ? room.Name :
"none".lang()));
99 t.
note.
AddTopic(
"TopicLeft",
"infoBed".lang(), (
bed !=
null) ?
bed.Name.ToTitleCase() :
"none".lang());
108 uIButton.
icon.SetAlpha((
bed !=
null) ? 1f : 0.4f);
109 uIButton.SetActive(enable:
true);
125 SE.Play(
"pop_paper");
129 },
"charaInfo",
null,
"sheet");
133 b.gameObject.AddComponent<CanvasGroup>().alpha = 0.6f;
141 foreach (
Hobby item in a.ListWorks().Concat(a.ListHobbies()))
143 if (
item.GetEfficiency(a) <= 0)
151 if (roomWork == null)
157 EClass.pc.SetAI(new AI_Goto(roomWork.GetRandomFreePos(), 1));
162 WriteHobbies(t, a, roomWork);
164 uIButton.
icon.SetAlpha(flag ? 1f : 0.4f);
165 uIButton.SetActive(enable:
true);
171 t.
note.
AddHeader(
"infoWork".lang((roomWork !=
null) ? roomWork.
Name :
"none".lang()));
174 AddText(
item,
"work", a.source.works.Contains(
item.source.alias));
176 foreach (
Hobby item2
in a.ListHobbies())
178 AddText(item2,
"hobby", a.
source.hobbies.Contains(item2.
source.alias));
183 t.note.AddText(
"workNotActive_party".lang(),
FontColor.Warning);
185 if (a.IsPCFactionOrMinion && !a.trait.IsCountAsResident)
187 t.note.AddText(
"notCountResident".lang(),
FontColor.Good);
190 void AddText(
Hobby h,
string lang,
bool fix)
193 string text = h.
Name;
200 string text2 = array[Mathf.Clamp(efficiency / 50, (efficiency != 0) ? 1 : 0, array.Length - 1)];
201 t.note.AddTopic(
"TopicLeft", lang.lang(), text +
" (" + text2 +
")");
202 if (!h.
source.destTrait.IsEmpty())
208 t.note.AddText(
"NoteText_small",
"・ " +
"workDestTrait".lang(cardRow.
GetName().ToTitleCase().TagColor(flag ?
FontColor.Good :
FontColor.Warning)));
212 t.note.AddText(
"NoteText_small",
"・ " +
"workNotActive".lang());
216 for (
int i = 0; i < h.
source.things.Length; i += 2)
218 float num = Mathf.Max(1f, (
long)h.
source.things[i + 1].ToInt() * (
long)efficiency * a.homeBranch.GetProductBonus(a) / 100 / 1000);
219 string text3 = h.
source.things[i];
221 if (h.
source.alias ==
"Breeding")
223 num = a.race.breeder * 100 / 2500;
224 num = num * (float)((!(text3 ==
"_egg")) ? 1 : 2) / 3f;
225 if (a.race.breeder > 0 && num <= 0f)
230 num = (float)Math.Round(num, 1);
231 t.note.AddText(
"NoteText_small",
"・ " +
"work_produce".lang(s.ToTitleCase(), num.ToString() ??
""));
233 if (!h.
source.elements.IsEmpty())
235 for (
int j = 0; j < h.
source.elements.Length; j += 2)
238 int num2 = h.
source.elements[j + 1];
239 float num3 = ((num2 < 0 || row.id == 2115 || row.id == 2207) ? ((
float)(num2 / 10)) : Mathf.Max((h.
GetEfficiency(a) > 0) ? 1 : 0, (
long)num2 * (long)h.
GetEfficiency(a) * a.homeBranch.efficiency / 100 / 1000));
240 t.note.AddText(
"NoteText_small",
"・ " +
"workBonus_skill".lang(row.
GetName().ToTitleCase(), ((num2 > 0) ?
"+" :
"") + num3) + ((row.
id == 2115 || row.
id == 2207) ? (
" " +
"fixedFactionSkill".lang()) :
""), (num2 >= 0) ?
FontColor.Default :
FontColor.Bad);
243 string[] array2 = h.
source.GetDetail().SplitNewline();
244 foreach (
string text4
in array2)
246 if (!text4.IsEmpty())
248 t.note.AddText(
"NoteText_small",
"・ " + text4);
264 b.
SetSubText(a.
job.GetName().ToTitleCase(wholeText:
true), 300);
289 uIContextMenu.
AddButton(
"findMember", delegate
299 uIContextMenu.
AddButton(
"findMember", delegate
305 uIContextMenu.
AddButton(
"changeName", delegate
313 text = NameGen.getRandomName();
326 uIContextMenu.
AddButton(
"editPCC", delegate
332 uIContextMenu.
AddButton(
"editSkin", delegate
342 uIContextMenu.
AddButton(
"togglePCC", delegate
365 uIContextMenu.
AddButton(
"editPCC", delegate
369 uIContextMenu.
AddButton(
"togglePCC", delegate
391 uIContextMenu.
AddButton(
"makeMaid", delegate
395 EClass.Branch.uidMaid = 0;
399 EClass.Branch.uidMaid = c.
uid;
412 if (isLivestockTimerOn)
450 uIContextMenu.
Show();
475 if (member2.
memberType == memberType && !list.Contains(member2))
490 menuLeft.
AddButton2Line(
"sort", () => list.sortMode.ToString(), delegate
499 layer.showMode = layer.showMode.NextEnum();
int GetInt(int id, int? defaultInt=null)
void SetInt(int id, int value=0)
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)
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)