20 public override string IdHeaderRow
24 return "HeaderRowPeople";
30 public virtual bool ShowCharaSheet
40 public virtual bool ShowShowMode
50 public virtual bool ShowGoto
60 public virtual bool ShowHome
69 public virtual bool IsDisabled(
Chara c)
71 return !c.isDead && c.memberType != FactionMemberType.Guest && !c.IsInHomeZone();
75 public override void List()
77 BaseList list = this.list;
82 this.OnInstantiate(a, b);
89 callback.onSort = delegate(
Chara a, UIList.SortMode m)
91 a.SetSortVal(m, CurrencyType.Money);
94 callback.onList = delegate(UIList.SortMode m)
98 callback.onRefresh =
null;
99 list.callbacks = callback;
100 this.list.List(
false);
107 CS$<>8__locals1.<>4__this =
this;
108 CS$<>8__locals1.a = a;
109 this.SetSubText(CS$<>8__locals1.a, b);
114 foreach (
Hobby hobby
in CS$<>8__locals1.a.ListWorks(
true))
116 AIWork ai = hobby.GetAI(CS$<>8__locals1.a);
117 flag = ai.SetDestination();
120 if (ai.destArea !=
null)
122 roomWork = ai.destArea;
125 if (ai.destThing !=
null)
127 roomWork = ai.destThing.pos.cell.room;
133 b.AddSubButton(
EClass.core.refs.icons.work, delegate
135 if (roomWork == null)
140 EClass.pc.SetAI(
new AI_Goto(roomWork.GetRandomFreePos(), 1,
false,
false));
141 CS$<>8__locals1.<>4__this.layer.Close();
142 },
null, delegate(UITooltip t)
145 CS$<>8__locals3.t = t;
146 CS$<>8__locals3.t.note.Clear();
148 CS$<>8__locals3.t.note.AddHeader(
"infoWork".lang((roomWork !=
null) ? roomWork.Name :
"none".lang(),
null,
null,
null,
null),
null);
149 foreach (
Hobby h
in CS$<>8__locals1.a.ListWorks(
true))
151 CS$<>8__locals1.<OnInstantiate>g__AddText|5(h,
"work", ref CS$<>8__locals3);
153 foreach (
Hobby h2
in CS$<>8__locals1.a.ListHobbies(
true))
155 CS$<>8__locals1.<OnInstantiate>g__AddText|5(h2,
"hobby", ref CS$<>8__locals3);
157 CS$<>8__locals3.t.note.Build();
159 }).icon.SetAlpha(flag ? 1f : 0.4f);
160 Room room = CS$<>8__locals1.a.FindRoom();
161 TraitBed bed = CS$<>8__locals1.a.FindBed();
162 if (CS$<>8__locals1.a.memberType == FactionMemberType.Default)
164 b.AddSubButton(
EClass.core.refs.icons.home, delegate
171 EClass.pc.SetAI(
new AI_Goto(room.GetRandomFreePos(), 1,
false,
false));
172 CS$<>8__locals1.<>4__this.layer.Close();
173 },
null, delegate(UITooltip t)
176 t.note.AddHeader(
"infoHome".lang((room !=
null) ? room.Name :
"none".lang(),
null,
null,
null,
null),
null);
177 t.note.AddTopic(
"TopicLeft",
"infoBed".lang(), (bed !=
null) ? bed.Name.ToTitleCase(
false) :
"none".lang());
181 EClass.core.actionsNextFrame.Add(delegate
185 }).icon.SetAlpha((room !=
null) ? 1f : 0.4f);
188 if (this.ShowCharaSheet &&
EClass.debug.showExtra)
190 b.AddSubButton(
EClass.core.refs.icons.inspect, delegate
192 SE.Play(
"pop_paper");
193 LayerChara layerChara = EClass.ui.AddLayerDontCloseOthers<LayerChara>();
194 layerChara.windows[0].SetRect(EClass.core.refs.rects.center, false);
195 layerChara.SetChara(CS$<>8__locals1.a);
196 },
"charaInfo",
null);
198 if (this.IsDisabled(CS$<>8__locals1.a))
200 b.gameObject.AddComponent<CanvasGroup>().alpha = 0.6f;
207 switch (this.layer.showMode)
210 b.SetSubText(a.job.GetName().ToTitleCase(
true), 300, FontColor.Default, TextAnchor.MiddleLeft);
213 b.SetSubText(a.race.GetName().ToTitleCase(
true), 300, FontColor.Default, TextAnchor.MiddleLeft);
217 string lang = a.GetTextWork(
true) +
"," + a.GetTextHobby(
true);
218 b.SetSubText(lang, 300, FontColor.Default, TextAnchor.MiddleLeft);
229 if (!c.IsAliveInCurrentZone)
234 UIContextMenu uicontextMenu =
EClass.ui.CreateContextMenuInteraction().SetHighlightTarget(i);
237 uicontextMenu.AddButton(
"findMember", delegate()
243 else if (c.IsHomeMember())
247 uicontextMenu.AddButton(
"findMember", delegate()
253 Action<bool, string> <>9__4;
254 uicontextMenu.AddButton(
"changeName", delegate()
256 string langDetail =
"dialogChangeName";
257 string text2 = c.c_altName.IsEmpty(c.NameSimple);
258 Action<bool, string> onClose;
259 if ((onClose = <>9__4) ==
null)
261 onClose = (<>9__4 = delegate(
bool cancel,
string text)
267 text = NameGen.getRandomName();
270 this.layer.OnSwitchContent(this.layer.windows[0]);
274 Dialog.InputName(langDetail, text2, onClose,
Dialog.InputType.Default);
278 uicontextMenu.AddButton(
"changeTitle", delegate()
280 EClass.ui.AddLayer<
LayerList>().SetStringList(() => WordGen.GetList(
"title"), delegate(
int a,
string b)
282 EClass.player.title = b;
283 },
true).SetSize(400f, -1f);
288 if (c.sourceCard.idActor.IsEmpty() && c.host ==
null)
290 if (c.pccData ==
null)
292 uicontextMenu.AddButton(
"togglePCC", delegate()
294 bool isSynced = c.isSynced;
295 c.pccData = PCCData.Create(c.IDPCCBodySet);
296 c.pccData.Randomize(c.IDPCCBodySet,
null,
true);
299 c.renderer.OnLeaveScreen();
301 EClass.scene.syncList.Remove(c.renderer);
305 EClass.scene.syncList.Add(c.renderer);
306 c.renderer.OnEnterScreen();
308 this.list.Refresh(
false);
314 uicontextMenu.AddButton(
"editPCC", delegate()
318 uicontextMenu.AddButton(
"togglePCC", delegate()
320 bool isSynced = c.isSynced;
323 c.renderer.OnLeaveScreen();
325 EClass.scene.syncList.Remove(c.renderer);
330 EClass.scene.syncList.Add(c.renderer);
331 c.renderer.OnEnterScreen();
333 this.list.Refresh(
false);
337 uicontextMenu.AddButton(
"makeMaid", delegate()
339 if (
EClass.Branch.uidMaid == c.uid)
341 EClass.Branch.uidMaid = 0;
345 EClass.Branch.uidMaid = c.uid;
347 this.list.Refresh(
false);
350 int @
int = c.GetInt(36,
null);
351 bool isLivestockTimerOn = this.memberType == FactionMemberType.Default && !
EClass.world.date.IsExpired(@
int);
352 int remainingHours =
EClass.world.date.GetRemainingHours(@
int);
353 uicontextMenu.AddButton((c.memberType == FactionMemberType.Livestock) ?
"daMakeResident" : (isLivestockTimerOn ?
"daMakeLivestock2".lang(
Date.GetText(remainingHours),
null,
null,
null,
null) :
"daMakeLivestock"), delegate()
355 if (isLivestockTimerOn)
360 if (c.memberType == FactionMemberType.Livestock)
362 c.SetInt(36,
EClass.world.date.GetRaw(0) + 14400);
364 EClass.Branch.ChangeMemberType(c, (c.memberType == FactionMemberType.Livestock) ? FactionMemberType.Default : FactionMemberType.Livestock);
368 uicontextMenu.AddButton(
"addToReserve", delegate()
370 if (
EClass.Home.listReserve.Count >=
EClass.Home.maxReserve)
373 Msg.Say(
"reserveLimit");
377 EClass.Home.AddReserve(c);
378 this.list.List(
false);
382 uicontextMenu.Show();
386 public override void OnList()
388 if (this.memberType == FactionMemberType.Guest)
390 using (List<Chara>.Enumerator enumerator =
EClass._map.charas.GetEnumerator())
392 while (enumerator.MoveNext())
394 Chara chara = enumerator.Current;
397 this.list.Add(chara);
405 if (chara2.memberType ==
this.memberType && !chara2.IsPCParty && !chara2.isSummon)
407 this.list.Add(chara2);
413 public override void OnRefreshMenu()
415 WindowMenu menuLeft = this.window.menuLeft;
421 menuLeft.AddButton2Line(
"sort", () => this.list.sortMode.ToString(), delegate(UIButton b)
423 this.list.NextSort();
425 if (this.ShowShowMode)
427 Lang.GetList(
"info_people");
428 menuLeft.AddButton2Line(
"info", () =>
"show" + this.layer.showMode.ToString(), delegate(UIButton b)
430 this.layer.showMode = this.layer.showMode.NextEnum<
LayerPeople.ShowMode>();
440 public FactionMemberType memberType;