Elin Decompiled Documentation EA 23.335 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 146 of file BaseListPeople.cs.

147 {
148 BaseArea roomWork = a.GetRoomWork();
149 bool flag = true;
150 foreach (Hobby item in a.ListWorks().Concat(a.ListHobbies()))
151 {
152 if (item.GetEfficiency(a) <= 0)
153 {
154 flag = false;
155 break;
156 }
157 }
158 UIButton uIButton = b.AddSubButton(EClass.core.refs.icons.work, delegate
159 {
160 if (roomWork == null)
161 {
162 SE.BeepSmall();
163 }
164 else
165 {
166 EClass.pc.SetAI(new AI_Goto(roomWork.GetRandomFreePos(), 1));
167 layer.Close();
168 }
169 }, null, delegate(UITooltip t)
170 {
171 WriteHobbies(t, a, roomWork);
172 }, "room");
173 uIButton.icon.SetAlpha(flag ? 1f : 0.4f);
174 uIButton.SetActive(enable: true);
175 }
void WriteHobbies(UITooltip t, Chara a, BaseArea roomWork)
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:9504
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:9477
BaseArea GetRoomWork()
Definition: Chara.cs:9455
Sprite work
Definition: CoreRef.cs:97
Icons icons
Definition: CoreRef.cs:358
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:6944
bool isDead
Definition: Chara.cs:393

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:104
Definition: Chara.cs:10
override void SetSortVal(UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
Definition: Chara.cs:7695
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 284 of file BaseListPeople.cs.

285 {
287 {
288 if (c.currentZone != EClass._zone)
289 {
290 Msg.Say("isIn", c, (c.currentZone == null) ? "???" : c.currentZone.Name);
291 }
292 SE.BeepSmall();
293 return;
294 }
295 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction().SetHighlightTarget(i);
296 if (c.IsGuest())
297 {
298 uIContextMenu.AddButton("findMember", delegate
299 {
300 EClass.pc.SetAI(new AI_Goto(c, 1));
301 layer.Close();
302 });
303 }
304 else if (c.IsHomeMember())
305 {
306 if (!c.IsPC)
307 {
308 uIContextMenu.AddButton("findMember", delegate
309 {
310 EClass.pc.SetAI(new AI_Goto(c, 1));
311 layer.Close();
312 });
313 }
314 uIContextMenu.AddButton("changeName", delegate
315 {
316 Dialog.InputName("dialogChangeName", c.c_altName.IsEmpty(c.NameSimple), delegate(bool cancel, string text)
317 {
318 if (!cancel)
319 {
320 if (text == "*r")
321 {
322 text = NameGen.getRandomName();
323 }
324 c.c_altName = text;
326 }
327 });
328 });
329 if (c != EClass.pc)
330 {
331 if (c.sourceCard.idActor.IsEmpty())
332 {
333 if (c.pccData == null)
334 {
335 uIContextMenu.AddButton("editPCC", delegate
336 {
337 EClass.ui.AddLayer<LayerEditPortrait>().Activate(c);
338 });
339 if (!c.IsPC)
340 {
341 uIContextMenu.AddButton("editSkin", delegate
342 {
343 LayerEditSkin layerEditSkin = EClass.ui.AddLayer<LayerEditSkin>();
344 layerEditSkin.SetOnKill(delegate
345 {
346 list.Refresh();
347 });
348 layerEditSkin.Activate(c);
349 });
350 }
351 uIContextMenu.AddButton("togglePCC", delegate
352 {
353 bool isSynced2 = c.isSynced;
354 c.pccData = PCCData.Create(c.IDPCCBodySet);
355 c.pccData.Randomize(c.IDPCCBodySet);
356 if (isSynced2)
357 {
359 }
360 EClass.scene.syncList.Remove(c.renderer);
361 c._CreateRenderer();
362 if (isSynced2)
363 {
366 }
367 list.Refresh();
368 SE.Click();
370 });
371 }
372 else
373 {
374 uIContextMenu.AddButton("editPCC", delegate
375 {
376 EClass.ui.AddLayer<LayerEditPCC>("LayerPCC/LayerEditPCC").Activate(c, UIPCC.Mode.Full);
377 });
378 uIContextMenu.AddButton("togglePCC", delegate
379 {
380 bool isSynced = c.isSynced;
381 if (isSynced)
382 {
384 }
385 EClass.scene.syncList.Remove(c.renderer);
386 c.pccData = null;
387 c._CreateRenderer();
388 if (isSynced)
389 {
392 }
393 list.Refresh();
395 });
396 }
397 }
398 if (c.homeBranch == EClass.Branch)
399 {
400 uIContextMenu.AddButton("makeMaid", delegate
401 {
402 if (EClass.Branch.uidMaid == c.uid)
403 {
404 EClass.Branch.uidMaid = 0;
405 }
406 else
407 {
408 EClass.Branch.uidMaid = c.uid;
409 }
410 list.Refresh();
411 SE.Click();
412 });
413 }
414 int @int = c.GetInt(36);
415 bool isLivestockTimerOn = memberType == FactionMemberType.Default && !EClass.world.date.IsExpired(@int);
416 int remainingHours = EClass.world.date.GetRemainingHours(@int);
417 if (!c.IsPCParty)
418 {
419 uIContextMenu.AddButton((c.memberType == FactionMemberType.Livestock) ? "daMakeResident" : (isLivestockTimerOn ? "daMakeLivestock2".lang(Date.GetText(remainingHours)) : "daMakeLivestock"), delegate
420 {
421 if (isLivestockTimerOn)
422 {
423 SE.Beep();
424 }
425 else
426 {
427 if (c.memberType == FactionMemberType.Livestock)
428 {
429 c.SetInt(36, EClass.world.date.GetRaw() + 14400);
430 }
431 EClass.Branch.ChangeMemberType(c, (c.memberType != FactionMemberType.Livestock) ? FactionMemberType.Livestock : FactionMemberType.Default);
432 foreach (ListOwner owner in layer.multi.owners)
433 {
434 owner.RefreshTab();
435 }
436 List();
437 SE.Click();
438 }
439 });
440 }
441 uIContextMenu.AddButton("addToReserve".lang() + " (" + EClass.Home.listReserve.Count + "/" + EClass.Home.GetMaxReserve() + ")", delegate
442 {
444 {
445 SE.Beep();
446 Msg.Say("reserveLimit");
447 return;
448 }
449 SE.MoveZone();
451 list.List();
452 foreach (ListOwner owner2 in layer.multi.owners)
453 {
454 owner2.RefreshTab();
455 }
456 });
457 }
458 }
459 uIContextMenu.Show();
460 }
new LayerPeople layer
FactionMemberType memberType
override void List()
override void OnLeaveScreen()
override void OnEnterScreen()
string[] idActor
Definition: CardRow.cs:35
void SetInt(string id, int value=0)
Definition: Card.cs:2586
string c_altName
Definition: Card.cs:1633
int uid
Definition: Card.cs:125
string NameSimple
Definition: Card.cs:2193
CardRenderer renderer
Definition: Card.cs:64
int GetInt(string id, int? defaultInt=null)
Definition: Card.cs:2567
string IDPCCBodySet
Definition: Chara.cs:495
override bool IsAliveInCurrentZone
Definition: Chara.cs:567
override bool IsPC
Definition: Chara.cs:630
override bool IsPCParty
Definition: Chara.cs:633
AIAct SetAI(AIAct g)
Definition: Chara.cs:9413
override bool isSynced
Definition: Chara.cs:709
override CardRenderer _CreateRenderer()
Definition: Chara.cs:6990
Zone currentZone
Definition: Chara.cs:259
bool IsHomeMember()
Definition: Chara.cs:6939
bool IsGuest()
Definition: Chara.cs:6964
override CardRow sourceCard
Definition: Chara.cs:454
FactionBranch homeBranch
Definition: Chara.cs:1113
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, Card.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(), Card.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 Room room = a.FindRoom();
81 TraitBed bed = a.FindBed();
82 UIButton uIButton = b.AddSubButton(EClass.core.refs.icons.home, delegate
83 {
84 if (room == null)
85 {
86 SE.BeepSmall();
87 }
88 else
89 {
90 EClass.pc.SetAI(new AI_Goto(room.GetRandomFreePos(), 1));
91 layer.Close();
92 }
93 }, null, delegate(UITooltip t)
94 {
95 t.note.Clear();
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());
98 t.note.Build();
99 if (room != null)
100 {
101 EClass.core.actionsNextFrame.Add(delegate
102 {
103 });
104 }
105 }, "home");
106 uIButton.icon.SetAlpha((bed != null) ? 1f : 0.4f);
107 uIButton.SetActive(enable: true);
108 UIButton sub2 = null;
109 sub2 = b.AddSubButton(EClass.core.refs.icons.sharedEquip, delegate
110 {
111 a.SetInt(113, (a.GetInt(113) == 0) ? 1 : 0);
112 SE.Tab();
113 sub2.icon.SetAlpha((a.GetInt(113) == 1) ? 0.4f : 1f);
115 }, null, delegate(UITooltip t)
116 {
117 t.note.Clear();
118 t.note.AddHeader("infoSharedEquip".lang((a.GetInt(113) == 1) ? "none".lang() : "infoSharedEquip_on".lang()));
119 t.note.Build();
120 }, "sharedEquip");
121 sub2.icon.SetAlpha((a.GetInt(113) == 1) ? 0.4f : 1f);
122 sub2.SetActive(enable: true);
123 }
124 else
125 {
126 b.AddSubButton(EClass.core.refs.icons.work, null, null, null, "room").SetActive(enable: false);
127 b.AddSubButton(EClass.core.refs.icons.home, null, null, null, "home").SetActive(enable: false);
128 b.AddSubButton(EClass.core.refs.icons.sharedEquip, null, null, null, "sharedEquip").SetActive(enable: false);
129 }
131 {
133 {
134 SE.Play("pop_paper");
135 LayerChara layerChara = EClass.ui.AddLayerDontCloseOthers<LayerChara>();
136 layerChara.windows[0].SetRect(EClass.core.refs.rects.center);
137 layerChara.SetChara(a);
138 }, "charaInfo", null, "sheet");
139 }
140 if (IsDisabled(a))
141 {
142 b.gameObject.AddComponent<CanvasGroup>().alpha = 0.6f;
143 }
144 }
Sprite GetIcon()
Definition: Affinity.cs:118
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:7738
override bool IsPCFaction
Definition: Chara.cs:689
Affinity affinity
Definition: Chara.cs:318
Room FindRoom()
Definition: Chara.cs:8363
bool showExtra
Definition: CoreDebug.cs:183
Sprite home
Definition: CoreRef.cs:93
Sprite sharedEquip
Definition: CoreRef.cs:115
Sprite inspect
Definition: CoreRef.cs:103
RectData center
Definition: CoreRef.cs:169
Rects rects
Definition: CoreRef.cs:364
static CoreDebug debug
Definition: EClass.cs:49
LayerChara SetChara(Chara c)
Definition: LayerChara.cs:9
Definition: Room.cs:4
static void TryShowTip(Transform root=null, bool highlight=true, bool ignoreWhenRightClick=true)
Definition: UIButton.cs:778
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(), Card.GetInt(), CoreRef.Icons.home, UIButton.icon, CoreRef.icons, Chara.IsPCFaction, UITooltip.note, Core.refs, Card.SetInt(), SetSubText(), CoreRef.Icons.sharedEquip, ShowHome, UIButton.TryShowTip(), 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 462 of file BaseListPeople.cs.

463 {
464 if (memberType == FactionMemberType.Guest)
465 {
466 foreach (Chara chara in EClass._map.charas)
467 {
468 if (chara.IsGuest())
469 {
470 list.Add(chara);
471 }
472 }
473 return;
474 }
475 foreach (Chara member in EClass.Branch.members)
476 {
477 if (member.memberType == memberType && !member.isSummon)
478 {
479 list.Add(member);
480 }
481 }
482 foreach (Chara member2 in EClass.pc.party.members)
483 {
484 if (member2.memberType == memberType && !list.Contains(member2))
485 {
486 list.Add(member2);
487 }
488 }
489 }
bool isSummon
Definition: Card.cs:713
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 491 of file BaseListPeople.cs.

492 {
493 WindowMenu menuLeft = window.menuLeft;
494 menuLeft.Clear();
495 if (!main)
496 {
497 return;
498 }
499 menuLeft.AddButton2Line("sort", () => list.sortMode.ToString(), delegate
500 {
501 list.NextSort();
502 });
503 if (ShowShowMode)
504 {
505 Lang.GetList("info_people");
506 menuLeft.AddButton2Line("info", () => "show" + layer.showMode, delegate
507 {
508 layer.showMode = layer.showMode.NextEnum();
509 List();
510 });
511 }
512 }
virtual bool ShowShowMode
UIList.SortMode sortMode
Definition: BaseList.cs:33
Definition: Lang.cs:7
static string[] GetList(string id)
Definition: Lang.cs:113
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 265 of file BaseListPeople.cs.

266 {
267 switch (ShowMode)
268 {
269 case LayerPeople.ShowMode.Race:
270 b.SetSubText(a.race.GetName().ToTitleCase(wholeText: true), 300);
271 break;
272 case LayerPeople.ShowMode.Job:
273 b.SetSubText(a.job.GetName().ToTitleCase(wholeText: true), 300);
274 break;
275 case LayerPeople.ShowMode.Work:
276 {
277 string text = a.GetTextWork(simple: true) + "," + a.GetTextHobby(simple: true);
278 b.SetSubText(text.TrimEnd(','), 300);
279 break;
280 }
281 }
282 }
virtual LayerPeople.ShowMode ShowMode
SourceJob.Row job
Definition: Chara.cs:470
string GetTextWork(bool simple=false)
Definition: Chara.cs:9603
string GetTextHobby(bool simple=false)
Definition: Chara.cs:9593
SourceRace.Row race
Definition: Chara.cs:468
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 177 of file BaseListPeople.cs.

178 {
179 t.note.Clear();
180 t.note.AddHeader("infoWork".lang((roomWork != null) ? roomWork.Name : "none".lang()));
181 foreach (Hobby item in a.ListWorks())
182 {
183 AddText(item, "work", a.source.works.Contains(item.source.alias));
184 }
185 foreach (Hobby item2 in a.ListHobbies())
186 {
187 AddText(item2, "hobby", a.source.hobbies.Contains(item2.source.alias));
188 }
189 if (a.IsPCParty)
190 {
191 t.note.Space(8);
192 t.note.AddText("workNotActive_party".lang(), FontColor.Warning);
193 }
195 {
196 t.note.AddText("notCountResident".lang(), FontColor.Good);
197 }
198 t.note.Build();
199 void AddText(Hobby h, string lang, bool fix)
200 {
201 int efficiency = h.GetEfficiency(a);
202 string text = h.Name;
203 if (fix)
204 {
205 text += "*";
206 }
207 text = text.TagColor((efficiency == 0) ? FontColor.Warning : FontColor.Good);
208 string[] array = Lang.GetList("work_lv");
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())
212 {
213 bool flag = EClass._map.FindThing(Type.GetType("Trait" + h.source.destTrait + ", Elin"), a) != null;
214 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();
215 obj.Sort((CardRow a, CardRow b) => a.LV - b.LV);
216 CardRow cardRow = obj[0];
217 t.note.AddText("NoteText_small", "・ " + "workDestTrait".lang(cardRow.GetName().ToTitleCase().TagColor(flag ? FontColor.Good : FontColor.Warning)));
218 }
219 if (efficiency == 0)
220 {
221 t.note.AddText("NoteText_small", "・ " + "workNotActive".lang());
222 }
223 else
224 {
225 for (int i = 0; i < h.source.things.Length; i += 2)
226 {
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];
229 string s = (text3.StartsWith("#") ? EClass.sources.categories.map[text3.Replace("#", "")].GetName() : EClass.sources.cards.map[h.source.things[i]].GetName());
230 if (h.source.alias == "Breeding")
231 {
232 num = a.race.breeder * 100 / 2500;
233 num = num * (float)((!(text3 == "_egg")) ? 1 : 2) / 3f;
234 if (a.race.breeder > 0 && num <= 0f)
235 {
236 num = 1f;
237 }
238 }
239 num = (float)Math.Round(num, 1);
240 t.note.AddText("NoteText_small", "・ " + "work_produce".lang(s.ToTitleCase(), num.ToString() ?? ""));
241 }
242 if (!h.source.elements.IsEmpty())
243 {
244 for (int j = 0; j < h.source.elements.Length; j += 2)
245 {
246 SourceElement.Row row = EClass.sources.elements.map[h.source.elements[j]];
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);
250 }
251 }
252 string[] array2 = h.source.GetDetail().SplitNewline();
253 foreach (string text4 in array2)
254 {
255 if (!text4.IsEmpty())
256 {
257 t.note.AddText("NoteText_small", "・ " + text4);
258 }
259 }
260 }
261 t.note.Space(1);
262 }
263 }
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:2342
new TraitChara trait
Definition: Chara.cs:509
SourceChara.Row source
Definition: Chara.cs:162
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:2671
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:70
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(), UINote.AddText(), UINote.AddTopic(), UINote.Build(), 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, UINote.Space(), and CardRow.trait.

Referenced by ListPeopleBed.OnInstantiate().

Member Data Documentation

◆ memberType

FactionMemberType BaseListPeople.memberType

Definition at line 10 of file BaseListPeople.cs.

◆ 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: