Elin Decompiled Documentation EA 23.289 Nightly
Loading...
Searching...
No Matches
BaseListPeople Class Reference
Inheritance diagram for BaseListPeople:
ListOwner< Chara, ItemGeneral > EClass ListPeople ListPeopleBuySlave ListPeopleCallReserve ListPeopleParty ListPeopleRevive ListPeopleSelect ListPeopleBed ListPeopleEmbark ListPeopleExpedition

Public Member Functions

virtual bool IsDisabled (Chara c)
 
override void List ()
 
override void OnInstantiate (Chara a, ItemGeneral b)
 
void AddSubButtonWork (ItemGeneral b, Chara a)
 
void WriteHobbies (UITooltip t, Chara a, BaseArea roomWork)
 
virtual void SetSubText (Chara a, ItemGeneral b)
 
override void OnClick (Chara c, ItemGeneral i)
 
override void OnList ()
 
override void OnRefreshMenu ()
 
- Public Member Functions inherited from ListOwner< Chara, ItemGeneral >
virtual void OnClick (T1 a, T2 b)
 
virtual void OnInstantiate (T1 a, T2 b)
 
virtual void OnList ()
 
virtual void List ()
 
virtual void OnCreate ()
 
virtual void OnSwitchContent ()
 
void RefreshCaption ()
 
virtual void OnRefreshMenu ()
 
void RefreshTab ()
 
void MoveToOther (object c)
 
void RefreshAll (bool freeze=true)
 

Public Attributes

Chara owner
 
FactionMemberType memberType
 
- Public Attributes inherited from ListOwner< Chara, ItemGeneral >
Layer layer
 
Window window
 
UIMultiList multi
 
ListOwner other
 
UIDynamicList list
 
WindowMenu menu
 
Window.Setting.Tab tab
 
string textTab
 
string textHeader
 
bool main
 
int index
 
Func< string > funcHeader
 

Properties

new LayerPeople layer [get]
 
override string IdHeaderRow [get]
 
virtual bool ShowCharaSheet [get]
 
virtual bool ShowShowMode [get]
 
virtual LayerPeople.ShowMode ShowMode [get]
 
virtual bool ShowGoto [get]
 
virtual bool ShowHome [get]
 
- Properties inherited from ListOwner< Chara, ItemGeneral >
ListOwner Main [get]
 
virtual string IdTitle [get]
 
virtual string IdHeaderRow [get]
 
virtual string TextTab [get]
 
virtual string TextHeader [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 6 of file BaseListPeople.cs.

Member Function Documentation

◆ AddSubButtonWork()

void BaseListPeople.AddSubButtonWork ( ItemGeneral  b,
Chara  a 
)
inline

Definition at line 137 of file BaseListPeople.cs.

138 {
139 BaseArea roomWork = a.GetRoomWork();
140 bool flag = true;
141 foreach (Hobby item in a.ListWorks().Concat(a.ListHobbies()))
142 {
143 if (item.GetEfficiency(a) <= 0)
144 {
145 flag = false;
146 break;
147 }
148 }
149 UIButton uIButton = b.AddSubButton(EClass.core.refs.icons.work, delegate
150 {
151 if (roomWork == null)
152 {
153 SE.BeepSmall();
154 }
155 else
156 {
157 EClass.pc.SetAI(new AI_Goto(roomWork.GetRandomFreePos(), 1));
158 layer.Close();
159 }
160 }, null, delegate(UITooltip t)
161 {
162 WriteHobbies(t, a, roomWork);
163 }, "room");
164 uIButton.icon.SetAlpha(flag ? 1f : 0.4f);
165 uIButton.SetActive(enable: true);
166 }
void WriteHobbies(UITooltip t, Chara a, BaseArea roomWork)
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:9174
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:9147
BaseArea GetRoomWork()
Definition: Chara.cs:9125
Sprite work
Definition: CoreRef.cs:96
Icons icons
Definition: CoreRef.cs:355
CoreRef refs
Definition: Core.cs:51
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7
Definition: Hobby.cs:5
UIButton AddSubButton(Sprite sprite, Action action, string lang=null, Action< UITooltip > onTooltip=null, string id=null)
Definition: ItemGeneral.cs:97
Image icon
Definition: UIButton.cs:110

References EClass.core, Chara.GetRoomWork(), CoreRef.icons, item, Core.refs, and CoreRef.Icons.work.

Referenced by OnInstantiate().

◆ IsDisabled()

virtual bool BaseListPeople.IsDisabled ( Chara  c)
inlinevirtual

Reimplemented in ListPeopleBuySlave, and ListPeopleRevive.

Definition at line 26 of file BaseListPeople.cs.

27 {
28 if (!c.isDead && c.memberType != FactionMemberType.Guest)
29 {
30 return !c.IsInHomeZone();
31 }
32 return false;
33 }
FactionMemberType
FactionMemberType memberType
Definition: Chara.cs:46
bool IsInHomeZone()
Definition: Chara.cs:6742
bool isDead
Definition: Chara.cs:391

References Chara.isDead, Chara.IsInHomeZone(), and Chara.memberType.

◆ List()

override void BaseListPeople.List ( )
inlinevirtual

Reimplemented from ListOwner< Chara, ItemGeneral >.

Definition at line 35 of file BaseListPeople.cs.

36 {
37 list.callbacks = new UIList.Callback<Chara, ItemGeneral>
38 {
39 onInstantiate = delegate
40 {
41 },
42 onRedraw = delegate(Chara a, ItemGeneral b, int i)
43 {
44 b.SetChara(a, this);
45 OnInstantiate(a, b);
46 b.Build();
47 },
48 onClick = delegate(Chara c, ItemGeneral i)
49 {
50 OnClick(c, i);
51 },
52 onSort = delegate(Chara a, UIList.SortMode m)
53 {
54 a.SetSortVal(m);
55 return -a.sortVal;
56 },
57 onList = delegate
58 {
59 OnList();
60 },
61 onRefresh = null
62 };
63 list.List();
64 }
override void OnClick(Chara c, ItemGeneral i)
override void OnInstantiate(Chara a, ItemGeneral b)
override void OnList()
int sortVal
Definition: Card.cs:102
Definition: Chara.cs:10
override void SetSortVal(UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
Definition: Chara.cs:7452
void Build()
Definition: ItemGeneral.cs:210
void SetChara(Chara c, BaseListPeople list=null)
Definition: ItemGeneral.cs:28
override void List()
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27

References ItemGeneral.Build(), ListOwner< Chara, ItemGeneral >.list, UIDynamicList.List(), OnClick(), OnInstantiate(), OnList(), ItemGeneral.SetChara(), Chara.SetSortVal(), and Card.sortVal.

◆ OnClick()

override void BaseListPeople.OnClick ( Chara  c,
ItemGeneral  i 
)
inline

Definition at line 275 of file BaseListPeople.cs.

276 {
278 {
279 if (c.currentZone != EClass._zone)
280 {
281 Msg.Say("isIn", c, (c.currentZone == null) ? "???" : c.currentZone.Name);
282 }
283 SE.BeepSmall();
284 return;
285 }
286 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction().SetHighlightTarget(i);
287 if (c.IsGuest())
288 {
289 uIContextMenu.AddButton("findMember", delegate
290 {
291 EClass.pc.SetAI(new AI_Goto(c, 1));
292 layer.Close();
293 });
294 }
295 else if (c.IsHomeMember())
296 {
297 if (!c.IsPC)
298 {
299 uIContextMenu.AddButton("findMember", delegate
300 {
301 EClass.pc.SetAI(new AI_Goto(c, 1));
302 layer.Close();
303 });
304 }
305 uIContextMenu.AddButton("changeName", delegate
306 {
307 Dialog.InputName("dialogChangeName", c.c_altName.IsEmpty(c.NameSimple), delegate(bool cancel, string text)
308 {
309 if (!cancel)
310 {
311 if (text == "*r")
312 {
313 text = NameGen.getRandomName();
314 }
315 c.c_altName = text;
317 }
318 });
319 });
320 if (c != EClass.pc)
321 {
322 if (c.sourceCard.idActor.IsEmpty())
323 {
324 if (c.pccData == null)
325 {
326 uIContextMenu.AddButton("editPCC", delegate
327 {
328 EClass.ui.AddLayer<LayerEditPortrait>().Activate(c);
329 });
330 if (!c.IsPC)
331 {
332 uIContextMenu.AddButton("editSkin", delegate
333 {
334 LayerEditSkin layerEditSkin = EClass.ui.AddLayer<LayerEditSkin>();
335 layerEditSkin.SetOnKill(delegate
336 {
337 list.Refresh();
338 });
339 layerEditSkin.Activate(c);
340 });
341 }
342 uIContextMenu.AddButton("togglePCC", delegate
343 {
344 bool isSynced2 = c.isSynced;
345 c.pccData = PCCData.Create(c.IDPCCBodySet);
346 c.pccData.Randomize(c.IDPCCBodySet);
347 if (isSynced2)
348 {
350 }
351 EClass.scene.syncList.Remove(c.renderer);
352 c._CreateRenderer();
353 if (isSynced2)
354 {
357 }
358 list.Refresh();
359 SE.Click();
361 });
362 }
363 else
364 {
365 uIContextMenu.AddButton("editPCC", delegate
366 {
367 EClass.ui.AddLayer<LayerEditPCC>().Activate(c, UIPCC.Mode.Full);
368 });
369 uIContextMenu.AddButton("togglePCC", delegate
370 {
371 bool isSynced = c.isSynced;
372 if (isSynced)
373 {
375 }
376 EClass.scene.syncList.Remove(c.renderer);
377 c.pccData = null;
378 c._CreateRenderer();
379 if (isSynced)
380 {
383 }
384 list.Refresh();
386 });
387 }
388 }
389 if (c.homeBranch == EClass.Branch)
390 {
391 uIContextMenu.AddButton("makeMaid", delegate
392 {
393 if (EClass.Branch.uidMaid == c.uid)
394 {
395 EClass.Branch.uidMaid = 0;
396 }
397 else
398 {
399 EClass.Branch.uidMaid = c.uid;
400 }
401 list.Refresh();
402 SE.Click();
403 });
404 }
405 int @int = c.GetInt(36);
406 bool isLivestockTimerOn = memberType == FactionMemberType.Default && !EClass.world.date.IsExpired(@int);
407 int remainingHours = EClass.world.date.GetRemainingHours(@int);
408 if (!c.IsPCParty)
409 {
410 uIContextMenu.AddButton((c.memberType == FactionMemberType.Livestock) ? "daMakeResident" : (isLivestockTimerOn ? "daMakeLivestock2".lang(Date.GetText(remainingHours)) : "daMakeLivestock"), delegate
411 {
412 if (isLivestockTimerOn)
413 {
414 SE.Beep();
415 }
416 else
417 {
418 if (c.memberType == FactionMemberType.Livestock)
419 {
420 c.SetInt(36, EClass.world.date.GetRaw() + 14400);
421 }
422 EClass.Branch.ChangeMemberType(c, (c.memberType != FactionMemberType.Livestock) ? FactionMemberType.Livestock : FactionMemberType.Default);
423 foreach (ListOwner owner in layer.multi.owners)
424 {
425 owner.RefreshTab();
426 }
427 List();
428 SE.Click();
429 }
430 });
431 }
432 uIContextMenu.AddButton("addToReserve".lang() + " (" + EClass.Home.listReserve.Count + "/" + EClass.Home.GetMaxReserve() + ")", delegate
433 {
435 {
436 SE.Beep();
437 Msg.Say("reserveLimit");
438 return;
439 }
440 SE.MoveZone();
442 list.List();
443 foreach (ListOwner owner2 in layer.multi.owners)
444 {
445 owner2.RefreshTab();
446 }
447 });
448 }
449 }
450 uIContextMenu.Show();
451 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
new LayerPeople layer
FactionMemberType memberType
override void List()
override void OnLeaveScreen()
override void OnEnterScreen()
string[] idActor
Definition: CardRow.cs:35
string c_altName
Definition: Card.cs:1619
int uid
Definition: Card.cs:123
string NameSimple
Definition: Card.cs:2179
CardRenderer renderer
Definition: Card.cs:62
string IDPCCBodySet
Definition: Chara.cs:493
override bool IsAliveInCurrentZone
Definition: Chara.cs:563
override bool IsPC
Definition: Chara.cs:626
override bool IsPCParty
Definition: Chara.cs:629
AIAct SetAI(AIAct g)
Definition: Chara.cs:9083
override bool isSynced
Definition: Chara.cs:705
override CardRenderer _CreateRenderer()
Definition: Chara.cs:6788
Zone currentZone
Definition: Chara.cs:257
bool IsHomeMember()
Definition: Chara.cs:6737
bool IsGuest()
Definition: Chara.cs:6762
override CardRow sourceCard
Definition: Chara.cs:452
FactionBranch homeBranch
Definition: Chara.cs:1080
PCCData pccData
Definition: Chara.cs:67
Definition: Date.cs:4
int GetRaw(int offsetHours=0)
Definition: Date.cs:328
bool IsExpired(int time)
Definition: Date.cs:338
string GetText(TextFormat format)
Definition: Date.cs:251
int GetRemainingHours(int rawDeadLine)
Definition: Date.cs:343
Definition: Dialog.cs:7
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
Definition: Dialog.cs:536
static Scene scene
Definition: EClass.cs:31
static Faction Home
Definition: EClass.cs:27
static Zone _zone
Definition: EClass.cs:21
static World world
Definition: EClass.cs:41
static FactionBranch Branch
Definition: EClass.cs:23
static Chara pc
Definition: EClass.cs:15
static UI ui
Definition: EClass.cs:17
void ChangeMemberType(Chara c, FactionMemberType type)
void AddReserve(Chara c)
Definition: FACTION.cs:338
List< HireInfo > listReserve
Definition: FACTION.cs:138
int GetMaxReserve()
Definition: FACTION.cs:192
void Activate(Chara _chara)
override void OnSwitchContent(Window window)
Definition: LayerPeople.cs:85
UIMultiList multi
Definition: LayerPeople.cs:33
List< Window > windows
Definition: Layer.cs:116
virtual void Close()
Definition: Layer.cs:463
Layer SetOnKill(Action action)
Definition: Layer.cs:579
void RefreshTab()
Definition: ListOwner.cs:110
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
List< ISyncScreen > syncList
Definition: Scene.cs:137
virtual string Name
Definition: Spatial.cs:509
void Show(UIItem i)
void AddButton(Func< string > funcText, UnityAction action=null)
List< ListOwner > owners
Definition: UIMultiList.cs:6
static void SetDirty()
GameDate date
Definition: World.cs:6

References Chara._CreateRenderer(), EClass._zone, LayerEditSkin.Activate(), UIContextMenu.AddButton(), Faction.AddReserve(), EClass.Branch, Card.c_altName, FactionBranch.ChangeMemberType(), Layer.Close(), Chara.currentZone, World.date, BaseCard.GetInt(), Faction.GetMaxReserve(), Date.GetRaw(), Date.GetRemainingHours(), Date.GetText(), EClass.Home, Chara.homeBranch, CardRow.idActor, Chara.IDPCCBodySet, Dialog.InputName(), Chara.IsAliveInCurrentZone, Date.IsExpired(), Chara.IsGuest(), Chara.IsHomeMember(), Chara.IsPC, Chara.IsPCParty, Chara.isSynced, Faction.listReserve, Chara.memberType, LayerPeople.multi, Spatial.Name, Card.NameSimple, CardRenderer.OnEnterScreen(), CardRenderer.OnLeaveScreen(), LayerPeople.OnSwitchContent(), UIMultiList.owners, EClass.pc, Chara.pccData, ListOwner< T1, T2 >.RefreshTab(), Card.renderer, Msg.Say(), EClass.scene, Chara.SetAI(), WidgetRoster.SetDirty(), BaseCard.SetInt(), Layer.SetOnKill(), UIContextMenu.Show(), Chara.sourceCard, Scene.syncList, EClass.ui, Card.uid, FactionBranch.uidMaid, Layer.windows, and EClass.world.

Referenced by List().

◆ OnInstantiate()

override void BaseListPeople.OnInstantiate ( Chara  a,
ItemGeneral  b 
)
inline

Definition at line 66 of file BaseListPeople.cs.

67 {
68 SetSubText(a, b);
69 if (ShowHome)
70 {
71 if (a.IsPCFaction)
72 {
73 Sprite icon = a.affinity.GetIcon();
74 if ((bool)icon)
75 {
76 Util.Instantiate<UIItem>("UI/Element/Grid/Attach/affinity", b).image1.sprite = icon;
77 }
78 }
79 AddSubButtonWork(b, a);
80 if (memberType == FactionMemberType.Default)
81 {
82 Room room = a.FindRoom();
83 TraitBed bed = a.FindBed();
84 UIButton uIButton = b.AddSubButton(EClass.core.refs.icons.home, delegate
85 {
86 if (room == null)
87 {
88 SE.BeepSmall();
89 }
90 else
91 {
92 EClass.pc.SetAI(new AI_Goto(room.GetRandomFreePos(), 1));
93 layer.Close();
94 }
95 }, null, delegate(UITooltip t)
96 {
97 t.note.Clear();
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());
100 t.note.Build();
101 if (room != null)
102 {
103 EClass.core.actionsNextFrame.Add(delegate
104 {
105 });
106 }
107 }, "home");
108 uIButton.icon.SetAlpha((bed != null) ? 1f : 0.4f);
109 uIButton.SetActive(enable: true);
110 }
111 else
112 {
113 b.AddSubButton(EClass.core.refs.icons.home, null, null, null, "home").SetActive(enable: false);
114 }
115 }
116 else
117 {
118 b.AddSubButton(EClass.core.refs.icons.work, null, null, null, "room").SetActive(enable: false);
119 b.AddSubButton(EClass.core.refs.icons.home, null, null, null, "home").SetActive(enable: false);
120 }
122 {
124 {
125 SE.Play("pop_paper");
126 LayerChara layerChara = EClass.ui.AddLayerDontCloseOthers<LayerChara>();
127 layerChara.windows[0].SetRect(EClass.core.refs.rects.center);
128 layerChara.SetChara(a);
129 }, "charaInfo", null, "sheet");
130 }
131 if (IsDisabled(a))
132 {
133 b.gameObject.AddComponent<CanvasGroup>().alpha = 0.6f;
134 }
135 }
Sprite GetIcon()
Definition: Affinity.cs:109
virtual string Name
Definition: BaseArea.cs:37
List< Action > actionsNextFrame
Definition: BaseCore.cs:31
virtual bool ShowHome
virtual bool IsDisabled(Chara c)
void AddSubButtonWork(ItemGeneral b, Chara a)
virtual void SetSubText(Chara a, ItemGeneral b)
virtual bool ShowCharaSheet
TraitBed FindBed()
Definition: Chara.cs:7495
override bool IsPCFaction
Definition: Chara.cs:685
Affinity affinity
Definition: Chara.cs:316
Room FindRoom()
Definition: Chara.cs:8111
bool showExtra
Definition: CoreDebug.cs:168
Sprite home
Definition: CoreRef.cs:92
Sprite inspect
Definition: CoreRef.cs:102
RectData center
Definition: CoreRef.cs:166
Rects rects
Definition: CoreRef.cs:361
static CoreDebug debug
Definition: EClass.cs:49
LayerChara SetChara(Chara c)
Definition: LayerChara.cs:9
Definition: Room.cs:4
Definition: UIItem.cs:5
void Clear()
Definition: UINote.cs:35
UIItem AddHeader(string text, Sprite sprite=null)
Definition: UINote.cs:79
UIItem AddTopic(string id, string text, string value=null)
Definition: UINote.cs:144
void Build()
Definition: UINote.cs:49
UINote note
Definition: UITooltip.cs:21
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References BaseCore.actionsNextFrame, UINote.AddHeader(), ItemGeneral.AddSubButton(), AddSubButtonWork(), UINote.AddTopic(), Chara.affinity, bed, UINote.Build(), UINote.Clear(), EClass.core, Chara.FindBed(), Chara.FindRoom(), Affinity.GetIcon(), CoreRef.Icons.home, UIButton.icon, CoreRef.icons, Chara.IsPCFaction, memberType, UITooltip.note, Core.refs, SetSubText(), ShowHome, and Util.

Referenced by List().

◆ OnList()

override void BaseListPeople.OnList ( )
inlinevirtual

Reimplemented from ListOwner< Chara, ItemGeneral >.

Reimplemented in ListPeopleBed, ListPeopleBuySlave, ListPeopleCallReserve, ListPeopleEmbark, ListPeopleExpedition, ListPeopleParty, ListPeopleRevive, and ListPeopleSelect.

Definition at line 453 of file BaseListPeople.cs.

454 {
455 if (memberType == FactionMemberType.Guest)
456 {
457 foreach (Chara chara in EClass._map.charas)
458 {
459 if (chara.IsGuest())
460 {
461 list.Add(chara);
462 }
463 }
464 return;
465 }
466 foreach (Chara member in EClass.Branch.members)
467 {
468 if (member.memberType == memberType && !member.isSummon)
469 {
470 list.Add(member);
471 }
472 }
473 foreach (Chara member2 in EClass.pc.party.members)
474 {
475 if (member2.memberType == memberType && !list.Contains(member2))
476 {
477 list.Add(member2);
478 }
479 }
480 }
bool isSummon
Definition: Card.cs:711
Party party
Definition: Chara.cs:43
static Map _map
Definition: EClass.cs:19
List< Chara > members
List< Chara > charas
Definition: Map.cs:81
List< Chara > members
Definition: Party.cs:19
override bool Contains(object item)
override void Add(object o)

References EClass._map, EClass.Branch, Map.charas, Chara.IsGuest(), Card.isSummon, FactionBranch.members, Party.members, Chara.memberType, Chara.party, and EClass.pc.

Referenced by List().

◆ OnRefreshMenu()

override void BaseListPeople.OnRefreshMenu ( )
inlinevirtual

Reimplemented from ListOwner< Chara, ItemGeneral >.

Reimplemented in ListPeopleBed, ListPeopleEmbark, and ListPeopleParty.

Definition at line 482 of file BaseListPeople.cs.

483 {
484 WindowMenu menuLeft = window.menuLeft;
485 menuLeft.Clear();
486 if (!main)
487 {
488 return;
489 }
490 menuLeft.AddButton2Line("sort", () => list.sortMode.ToString(), delegate
491 {
492 list.NextSort();
493 });
494 if (ShowShowMode)
495 {
496 Lang.GetList("info_people");
497 menuLeft.AddButton2Line("info", () => "show" + layer.showMode, delegate
498 {
499 layer.showMode = layer.showMode.NextEnum();
500 List();
501 });
502 }
503 }
virtual bool ShowShowMode
UIList.SortMode sortMode
Definition: BaseList.cs:33
Definition: Lang.cs:7
static string[] GetList(string id)
Definition: Lang.cs:117
ShowMode showMode
Definition: LayerPeople.cs:25
void Clear()
Definition: WindowMenu.cs:44
UIButton AddButton2Line(string idLang, Func< string > funcText, Action< UIButton > onClick=null, Sprite sprite=null, string idButton="2line")
Definition: WindowMenu.cs:104
WindowMenu menuLeft
Definition: Window.cs:700

References WindowMenu.AddButton2Line(), WindowMenu.Clear(), Lang.GetList(), and LayerPeople.showMode.

◆ SetSubText()

virtual void BaseListPeople.SetSubText ( Chara  a,
ItemGeneral  b 
)
inlinevirtual

Reimplemented in ListPeopleExpedition.

Definition at line 256 of file BaseListPeople.cs.

257 {
258 switch (ShowMode)
259 {
260 case LayerPeople.ShowMode.Race:
261 b.SetSubText(a.race.GetName().ToTitleCase(wholeText: true), 300);
262 break;
263 case LayerPeople.ShowMode.Job:
264 b.SetSubText(a.job.GetName().ToTitleCase(wholeText: true), 300);
265 break;
266 case LayerPeople.ShowMode.Work:
267 {
268 string text = a.GetTextWork(simple: true) + "," + a.GetTextHobby(simple: true);
269 b.SetSubText(text.TrimEnd(','), 300);
270 break;
271 }
272 }
273 }
virtual LayerPeople.ShowMode ShowMode
SourceJob.Row job
Definition: Chara.cs:468
string GetTextWork(bool simple=false)
Definition: Chara.cs:9273
string GetTextHobby(bool simple=false)
Definition: Chara.cs:9263
SourceRace.Row race
Definition: Chara.cs:466
UIButton SetSubText(string lang, int x, FontColor c=FontColor.Default, TextAnchor align=TextAnchor.MiddleLeft)
Definition: ItemGeneral.cs:161

References Chara.GetTextHobby(), Chara.GetTextWork(), Chara.job, Chara.race, and ItemGeneral.SetSubText().

Referenced by OnInstantiate().

◆ WriteHobbies()

void BaseListPeople.WriteHobbies ( UITooltip  t,
Chara  a,
BaseArea  roomWork 
)
inline

Definition at line 168 of file BaseListPeople.cs.

169 {
170 t.note.Clear();
171 t.note.AddHeader("infoWork".lang((roomWork != null) ? roomWork.Name : "none".lang()));
172 foreach (Hobby item in a.ListWorks())
173 {
174 AddText(item, "work", a.source.works.Contains(item.source.alias));
175 }
176 foreach (Hobby item2 in a.ListHobbies())
177 {
178 AddText(item2, "hobby", a.source.hobbies.Contains(item2.source.alias));
179 }
180 if (a.IsPCParty)
181 {
182 t.note.Space(8);
183 t.note.AddText("workNotActive_party".lang(), FontColor.Warning);
184 }
186 {
187 t.note.AddText("notCountResident".lang(), FontColor.Good);
188 }
189 t.note.Build();
190 void AddText(Hobby h, string lang, bool fix)
191 {
192 int efficiency = h.GetEfficiency(a);
193 string text = h.Name;
194 if (fix)
195 {
196 text += "*";
197 }
198 text = text.TagColor((efficiency == 0) ? FontColor.Warning : FontColor.Good);
199 string[] array = Lang.GetList("work_lv");
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())
203 {
204 bool flag = EClass._map.FindThing(Type.GetType("Trait" + h.source.destTrait + ", Elin"), a) != null;
205 List<CardRow> obj = EClass.sources.cards.rows.Where((CardRow t) => t.trait.Length != 0 && Type.GetType("Trait" + h.source.destTrait).IsAssignableFrom(Type.GetType("Trait" + t.trait[0]))).ToList();
206 obj.Sort((CardRow a, CardRow b) => a.LV - b.LV);
207 CardRow cardRow = obj[0];
208 t.note.AddText("NoteText_small", "・ " + "workDestTrait".lang(cardRow.GetName().ToTitleCase().TagColor(flag ? FontColor.Good : FontColor.Warning)));
209 }
210 if (efficiency == 0)
211 {
212 t.note.AddText("NoteText_small", "・ " + "workNotActive".lang());
213 }
214 else
215 {
216 for (int i = 0; i < h.source.things.Length; i += 2)
217 {
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];
220 string s = (text3.StartsWith("#") ? EClass.sources.categories.map[text3.Replace("#", "")].GetName() : EClass.sources.cards.map[h.source.things[i]].GetName());
221 if (h.source.alias == "Breeding")
222 {
223 num = a.race.breeder * 100 / 2500;
224 num = num * (float)((!(text3 == "_egg")) ? 1 : 2) / 3f;
225 if (a.race.breeder > 0 && num <= 0f)
226 {
227 num = 1f;
228 }
229 }
230 num = (float)Math.Round(num, 1);
231 t.note.AddText("NoteText_small", "・ " + "work_produce".lang(s.ToTitleCase(), num.ToString() ?? ""));
232 }
233 if (!h.source.elements.IsEmpty())
234 {
235 for (int j = 0; j < h.source.elements.Length; j += 2)
236 {
237 SourceElement.Row row = EClass.sources.elements.map[h.source.elements[j]];
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);
241 }
242 }
243 string[] array2 = h.source.GetDetail().SplitNewline();
244 foreach (string text4 in array2)
245 {
246 if (!text4.IsEmpty())
247 {
248 t.note.AddText("NoteText_small", "・ " + text4);
249 }
250 }
251 }
252 t.note.Space(1);
253 }
254 }
FontColor
Definition: FontColor.cs:2
virtual string GetName(int i)
Definition: CardRow.cs:95
string[] trait
Definition: CardRow.cs:33
bool IsPCFactionOrMinion
Definition: Card.cs:2312
new TraitChara trait
Definition: Chara.cs:505
SourceChara.Row source
Definition: Chara.cs:160
static SourceManager sources
Definition: EClass.cs:43
SourceHobby.Row source
Definition: Hobby.cs:8
int GetEfficiency(Chara c)
Definition: Hobby.cs:31
string Name
Definition: Hobby.cs:10
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2592
int LV
Definition: RenderRow.cs:22
List< CardRow > rows
Definition: SourceCard.cs:7
Dictionary< string, CardRow > map
Definition: SourceCard.cs:9
override string GetName()
SourceCard cards
SourceCategory categories
SourceElement elements
virtual bool IsCountAsResident
Definition: TraitChara.cs:67
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Space(int sizeY=0, int sizeX=1)
Definition: UINote.cs:62

References EClass._map, UINote.AddHeader(), SourceManager.cards, SourceManager.categories, UINote.Clear(), SourceManager.elements, Map.FindThing(), Hobby.GetEfficiency(), Lang.GetList(), SourceElement.Row.GetName(), CardRow.GetName(), SourceElement.Row.id, item, RenderRow.LV, SourceCard.map, BaseArea.Name, Hobby.Name, UITooltip.note, SourceCard.rows, Hobby.source, EClass.sources, and CardRow.trait.

Referenced by ListPeopleBed.OnInstantiate().

Member Data Documentation

◆ memberType

FactionMemberType BaseListPeople.memberType

Definition at line 10 of file BaseListPeople.cs.

Referenced by OnInstantiate().

◆ owner

Chara BaseListPeople.owner

Definition at line 8 of file BaseListPeople.cs.

Referenced by ListPeopleBuySlave.OnCreate().

Property Documentation

◆ IdHeaderRow

override string BaseListPeople.IdHeaderRow
get

Definition at line 14 of file BaseListPeople.cs.

◆ layer

new LayerPeople BaseListPeople.layer
get

Definition at line 12 of file BaseListPeople.cs.

◆ ShowCharaSheet

virtual bool BaseListPeople.ShowCharaSheet
get

Definition at line 16 of file BaseListPeople.cs.

◆ ShowGoto

virtual bool BaseListPeople.ShowGoto
get

Definition at line 22 of file BaseListPeople.cs.

◆ ShowHome

virtual bool BaseListPeople.ShowHome
get

Definition at line 24 of file BaseListPeople.cs.

Referenced by OnInstantiate().

◆ ShowMode

virtual LayerPeople.ShowMode BaseListPeople.ShowMode
get

Definition at line 20 of file BaseListPeople.cs.

◆ ShowShowMode

virtual bool BaseListPeople.ShowShowMode
get

Definition at line 18 of file BaseListPeople.cs.


The documentation for this class was generated from the following file: