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);
113 sub2.
icon.SetAlpha((a.
GetInt(113) == 1) ? 0.4f : 1f);
118 t.
note.
AddHeader(
"infoSharedEquip".lang((a.GetInt(113) == 1) ?
"none".lang() :
"infoSharedEquip_on".lang()));
121 sub2.
icon.SetAlpha((a.GetInt(113) == 1) ? 0.4f : 1f);
122 sub2.SetActive(enable:
true);
134 SE.Play(
"pop_paper");
138 },
"charaInfo",
null,
"sheet");
142 b.gameObject.AddComponent<CanvasGroup>().alpha = 0.6f;
150 foreach (
Hobby item in a.ListWorks().Concat(a.ListHobbies()))
152 if (
item.GetEfficiency(a) <= 0)
160 if (roomWork == null)
166 EClass.pc.SetAI(new AI_Goto(roomWork.GetRandomFreePos(), 1));
171 WriteHobbies(t, a, roomWork);
173 uIButton.
icon.SetAlpha(flag ? 1f : 0.4f);
174 uIButton.SetActive(enable:
true);
180 t.
note.
AddHeader(
"infoWork".lang((roomWork !=
null) ? roomWork.
Name :
"none".lang()));
183 AddText(
item,
"work", a.source.works.Contains(
item.source.alias));
185 foreach (
Hobby item2
in a.ListHobbies())
187 AddText(item2,
"hobby", a.
source.hobbies.Contains(item2.
source.alias));
194 if (a.IsPCFactionOrMinion && !a.trait.IsCountAsResident)
199 void AddText(
Hobby h,
string lang,
bool fix)
202 string text = h.
Name;
209 string text2 = array[Mathf.Clamp(efficiency / 50, (efficiency != 0) ? 1 : 0, array.Length - 1)];
210 t.
note.
AddTopic(
"TopicLeft", lang.lang(), text +
" (" + text2 +
")");
211 if (!h.
source.destTrait.IsEmpty())
217 t.note.AddText(
"NoteText_small",
"・ " +
"workDestTrait".lang(cardRow.
GetName().ToTitleCase().TagColor(flag ?
FontColor.Good :
FontColor.Warning)));
221 t.
note.
AddText(
"NoteText_small",
"・ " +
"workNotActive".lang());
225 for (
int i = 0; i < h.
source.things.Length; i += 2)
227 float num = Mathf.Max(1f, (
long)h.
source.things[i + 1].ToInt() * (
long)efficiency * a.homeBranch.GetProductBonus(a) / 100 / 1000);
228 string text3 = h.
source.things[i];
230 if (h.
source.alias ==
"Breeding")
232 num = a.race.breeder * 100 / 2500;
233 num = num * (float)((!(text3 ==
"_egg")) ? 1 : 2) / 3f;
234 if (a.race.breeder > 0 && num <= 0f)
239 num = (float)Math.Round(num, 1);
240 t.
note.
AddText(
"NoteText_small",
"・ " +
"work_produce".lang(s.ToTitleCase(), num.ToString() ??
""));
242 if (!h.
source.elements.IsEmpty())
244 for (
int j = 0; j < h.
source.elements.Length; j += 2)
247 int num2 = h.
source.elements[j + 1];
248 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));
249 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);
252 string[] array2 = h.
source.GetDetail().SplitNewline();
253 foreach (
string text4
in array2)
255 if (!text4.IsEmpty())
273 b.
SetSubText(a.
job.GetName().ToTitleCase(wholeText:
true), 300);
298 uIContextMenu.
AddButton(
"findMember", delegate
308 uIContextMenu.
AddButton(
"findMember", delegate
314 uIContextMenu.
AddButton(
"changeName", delegate
322 text = NameGen.getRandomName();
335 uIContextMenu.
AddButton(
"editPCC", delegate
341 uIContextMenu.
AddButton(
"editSkin", delegate
351 uIContextMenu.
AddButton(
"togglePCC", delegate
374 uIContextMenu.
AddButton(
"editPCC", delegate
378 uIContextMenu.
AddButton(
"togglePCC", delegate
400 uIContextMenu.
AddButton(
"makeMaid", delegate
404 EClass.Branch.uidMaid = 0;
408 EClass.Branch.uidMaid = c.
uid;
421 if (isLivestockTimerOn)
459 uIContextMenu.
Show();
484 if (member2.
memberType == memberType && !list.Contains(member2))
499 menuLeft.
AddButton2Line(
"sort", () => list.sortMode.ToString(), delegate
508 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)
UIItem AddText(string text, FontColor color=FontColor.DontChange)
void Space(int sizeY=0, int sizeX=1)