2using System.Collections.Generic;
35 public override void List()
73 Util.Instantiate<
UIItem>(
"UI/Element/Grid/Attach/affinity", b).image1.sprite = icon;
89 EClass.pc.SetAI(new AI_Goto(room.GetRandomFreePos(), 1));
96 t.
note.
AddTopic(
"TopicLeft",
"infoBed".lang(), (
bed !=
null) ?
bed.Name.ToTitleCase() :
"none".lang());
104 }).icon.SetAlpha((
bed !=
null) ? 1f : 0.4f);
111 SE.Play(
"pop_paper");
119 b.gameObject.AddComponent<CanvasGroup>().alpha = 0.6f;
127 foreach (
Hobby item in a.ListWorks().Concat(a.ListHobbies()))
129 if (
item.GetEfficiency(a) <= 0)
137 if (roomWork == null)
143 EClass.pc.SetAI(new AI_Goto(roomWork.GetRandomFreePos(), 1));
148 WriteHobbies(t, a, roomWork);
149 }).icon.SetAlpha(flag ? 1f : 0.4f);
155 t.
note.
AddHeader(
"infoWork".lang((roomWork !=
null) ? roomWork.
Name :
"none".lang()));
158 AddText(
item,
"work", a.source.works.Contains(
item.source.alias));
160 foreach (
Hobby item2
in a.ListHobbies())
162 AddText(item2,
"hobby", a.
source.hobbies.Contains(item2.
source.alias));
167 t.note.AddText(
"workNotActive_party".lang(),
FontColor.Warning);
170 void AddText(
Hobby h,
string lang,
bool fix)
173 string text = h.
Name;
180 string text2 = array[Mathf.Clamp(efficiency / 50, (efficiency != 0) ? 1 : 0, array.Length - 1)];
181 t.note.AddTopic(
"TopicLeft", lang.lang(), text +
" (" + text2 +
")");
182 if (!h.
source.destTrait.IsEmpty())
188 t.note.AddText(
"NoteText_small",
"・ " +
"workDestTrait".lang(cardRow.
GetName().ToTitleCase().TagColor(flag ?
FontColor.Good :
FontColor.Warning)));
192 t.note.AddText(
"NoteText_small",
"・ " +
"workNotActive".lang());
196 for (
int i = 0; i < h.
source.things.Length; i += 2)
198 int num = Mathf.Max(1, h.
source.things[i + 1].ToInt() * efficiency * a.homeBranch.GetProductBonus(a) / 100 / 1000);
199 string text3 = h.
source.things[i];
201 if (h.
source.alias ==
"Breeding")
203 num = a.race.breeder * 100 / 2500;
204 num = num * ((!(text3 ==
"_egg")) ? 1 : 2) / 3;
205 if (a.race.breeder > 0 && num <= 0)
210 t.note.AddText(
"NoteText_small",
"・ " +
"work_produce".lang(s.ToTitleCase(), num.ToString() ??
""));
212 if (!h.
source.elements.IsEmpty())
214 for (
int j = 0; j < h.
source.elements.Length; j += 2)
217 int num2 = h.
source.elements[j + 1];
218 int num3 = ((num2 < 0 || row.id == 2115 || row.id == 2207) ? (num2 / 10) : Mathf.Max(0, num2 * h.
GetEfficiency(a) * a.homeBranch.efficiency / 100 / 1000));
219 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);
222 string[] array2 = h.
source.GetDetail().SplitNewline();
223 foreach (
string text4
in array2)
225 if (!text4.IsEmpty())
227 t.note.AddText(
"NoteText_small",
"・ " + text4);
243 b.
SetSubText(a.
job.GetName().ToTitleCase(wholeText:
true), 300);
268 uIContextMenu.
AddButton(
"findMember", delegate
278 uIContextMenu.
AddButton(
"findMember", delegate
284 uIContextMenu.
AddButton(
"changeName", delegate
292 text = NameGen.getRandomName();
305 uIContextMenu.
AddButton(
"editPCC", delegate
309 uIContextMenu.
AddButton(
"togglePCC", delegate
331 uIContextMenu.
AddButton(
"editPCC", delegate
335 uIContextMenu.
AddButton(
"togglePCC", delegate
354 uIContextMenu.
AddButton(
"makeMaid", delegate
358 EClass.Branch.uidMaid = 0;
362 EClass.Branch.uidMaid = c.
uid;
374 if (isLivestockTimerOn)
412 uIContextMenu.
Show();
445 menuLeft.
AddButton2Line(
"sort", () => list.sortMode.ToString(), delegate
454 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)
UIButton SetSubText(string lang, int x, FontColor c=FontColor.Default, TextAnchor align=TextAnchor.MiddleLeft)
static string[] GetList(string id)
LayerChara SetChara(Chara c)
override void OnSwitchContent(Window window)
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)