Elin Decompiled Documentation EA 23.188 Stable Patch 2
Loading...
Searching...
No Matches
BaseListPeople Class Reference
Inheritance diagram for BaseListPeople:
ListOwner< Chara, ItemGeneral > EClass ListPeople ListPeopleBuySlave ListPeopleCallReserve 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 ()
 
virtual void OnRefreshMenu ()
 
void RefreshTab ()
 
void MoveToOther (object c)
 

Public Attributes

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

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 (int a, int start, int step, int rate=75)
 
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 123 of file BaseListPeople.cs.

124 {
125 BaseArea roomWork = a.GetRoomWork();
126 bool flag = true;
127 foreach (Hobby item in a.ListWorks().Concat(a.ListHobbies()))
128 {
129 if (item.GetEfficiency(a) <= 0)
130 {
131 flag = false;
132 break;
133 }
134 }
136 {
137 if (roomWork == null)
138 {
139 SE.BeepSmall();
140 }
141 else
142 {
143 EClass.pc.SetAI(new AI_Goto(roomWork.GetRandomFreePos(), 1));
144 layer.Close();
145 }
146 }, null, delegate(UITooltip t)
147 {
148 WriteHobbies(t, a, roomWork);
149 }).icon.SetAlpha(flag ? 1f : 0.4f);
150 }
void WriteHobbies(UITooltip t, Chara a, BaseArea roomWork)
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:8540
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:8513
BaseArea GetRoomWork()
Definition: Chara.cs:8491
Sprite work
Definition: CoreRef.cs:94
Icons icons
Definition: CoreRef.cs:353
CoreRef refs
Definition: Core.cs:51
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6
Definition: Hobby.cs:5
UIButton AddSubButton(Sprite sprite, Action action, string lang=null, Action< UITooltip > onTooltip=null)
Definition: ItemGeneral.cs:86

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:6288
bool isDead
Definition: Chara.cs:387

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(Chara a, ItemGeneral b)
40 {
41 b.SetChara(a, (this is ListPeopleBuySlave) ? ItemGeneral.Mode.Slave : ItemGeneral.Mode.Default);
42 OnInstantiate(a, b);
43 b.Build();
44 },
45 onClick = delegate(Chara c, ItemGeneral i)
46 {
47 OnClick(c, i);
48 },
49 onSort = delegate(Chara a, UIList.SortMode m)
50 {
51 a.SetSortVal(m);
52 return -a.sortVal;
53 },
54 onList = delegate
55 {
56 OnList();
57 },
58 onRefresh = null
59 };
60 list.List();
61 }
override void OnClick(Chara c, ItemGeneral i)
override void OnInstantiate(Chara a, ItemGeneral b)
override void OnList()
int sortVal
Definition: Card.cs:99
Definition: Chara.cs:10
override void SetSortVal(UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
Definition: Chara.cs:6965
void Build()
Definition: ItemGeneral.cs:171
void SetChara(Chara c, Mode mode=Mode.Default)
Definition: ItemGeneral.cs:27
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27
override void List()
Definition: UIList.cs:717

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

◆ OnClick()

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

Definition at line 258 of file BaseListPeople.cs.

259 {
261 {
262 if (c.currentZone != EClass._zone)
263 {
264 Msg.Say("isIn", c, (c.currentZone == null) ? "???" : c.currentZone.Name);
265 }
266 SE.BeepSmall();
267 return;
268 }
269 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction().SetHighlightTarget(i);
270 if (c.IsGuest())
271 {
272 uIContextMenu.AddButton("findMember", delegate
273 {
274 EClass.pc.SetAI(new AI_Goto(c, 1));
275 layer.Close();
276 });
277 }
278 else if (c.IsHomeMember())
279 {
280 if (!c.IsPC)
281 {
282 uIContextMenu.AddButton("findMember", delegate
283 {
284 EClass.pc.SetAI(new AI_Goto(c, 1));
285 layer.Close();
286 });
287 }
288 uIContextMenu.AddButton("changeName", delegate
289 {
290 Dialog.InputName("dialogChangeName", c.c_altName.IsEmpty(c.NameSimple), delegate(bool cancel, string text)
291 {
292 if (!cancel)
293 {
294 if (text == "*r")
295 {
296 text = NameGen.getRandomName();
297 }
298 c.c_altName = text;
300 }
301 });
302 });
303 if (c != EClass.pc)
304 {
305 if (c.sourceCard.idActor.IsEmpty() && c.host == null)
306 {
307 if (c.pccData == null)
308 {
309 uIContextMenu.AddButton("editPCC", delegate
310 {
311 EClass.ui.AddLayer<LayerEditPortrait>().Activate(c);
312 });
313 if (!c.IsPC)
314 {
315 uIContextMenu.AddButton("editSkin", delegate
316 {
317 LayerEditSkin layerEditSkin = EClass.ui.AddLayer<LayerEditSkin>();
318 layerEditSkin.SetOnKill(delegate
319 {
320 list.Refresh();
321 });
322 layerEditSkin.Activate(c);
323 });
324 }
325 uIContextMenu.AddButton("togglePCC", delegate
326 {
327 bool isSynced2 = c.isSynced;
328 c.pccData = PCCData.Create(c.IDPCCBodySet);
329 c.pccData.Randomize(c.IDPCCBodySet);
330 if (isSynced2)
331 {
333 }
334 EClass.scene.syncList.Remove(c.renderer);
335 c._CreateRenderer();
336 if (isSynced2)
337 {
340 }
341 list.Refresh();
342 SE.Click();
344 });
345 }
346 else
347 {
348 uIContextMenu.AddButton("editPCC", delegate
349 {
350 EClass.ui.AddLayer<LayerEditPCC>().Activate(c, UIPCC.Mode.Full);
351 });
352 uIContextMenu.AddButton("togglePCC", delegate
353 {
354 bool isSynced = c.isSynced;
355 if (isSynced)
356 {
358 }
359 EClass.scene.syncList.Remove(c.renderer);
360 c.pccData = null;
361 c._CreateRenderer();
362 if (isSynced)
363 {
366 }
367 list.Refresh();
369 });
370 }
371 }
372 if (c.homeBranch == EClass.Branch)
373 {
374 uIContextMenu.AddButton("makeMaid", delegate
375 {
376 if (EClass.Branch.uidMaid == c.uid)
377 {
378 EClass.Branch.uidMaid = 0;
379 }
380 else
381 {
382 EClass.Branch.uidMaid = c.uid;
383 }
384 list.Refresh();
385 SE.Click();
386 });
387 }
388 int @int = c.GetInt(36);
389 bool isLivestockTimerOn = memberType == FactionMemberType.Default && !EClass.world.date.IsExpired(@int);
390 int remainingHours = EClass.world.date.GetRemainingHours(@int);
391 if (!c.IsPCParty)
392 {
393 uIContextMenu.AddButton((c.memberType == FactionMemberType.Livestock) ? "daMakeResident" : (isLivestockTimerOn ? "daMakeLivestock2".lang(Date.GetText(remainingHours)) : "daMakeLivestock"), delegate
394 {
395 if (isLivestockTimerOn)
396 {
397 SE.Beep();
398 }
399 else
400 {
401 if (c.memberType == FactionMemberType.Livestock)
402 {
403 c.SetInt(36, EClass.world.date.GetRaw() + 14400);
404 }
405 EClass.Branch.ChangeMemberType(c, (c.memberType != FactionMemberType.Livestock) ? FactionMemberType.Livestock : FactionMemberType.Default);
406 foreach (ListOwner owner in layer.multi.owners)
407 {
408 owner.RefreshTab();
409 }
410 List();
411 SE.Click();
412 }
413 });
414 }
415 uIContextMenu.AddButton("addToReserve".lang() + " (" + EClass.Home.listReserve.Count + "/" + EClass.Home.GetMaxReserve() + ")", delegate
416 {
418 {
419 SE.Beep();
420 Msg.Say("reserveLimit");
421 return;
422 }
423 SE.MoveZone();
425 list.List();
426 foreach (ListOwner owner2 in layer.multi.owners)
427 {
428 owner2.RefreshTab();
429 }
430 });
431 }
432 }
433 uIContextMenu.Show();
434 }
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:1567
int uid
Definition: Card.cs:120
string NameSimple
Definition: Card.cs:2101
CardRenderer renderer
Definition: Card.cs:59
string IDPCCBodySet
Definition: Chara.cs:489
override bool IsAliveInCurrentZone
Definition: Chara.cs:559
override bool IsPC
Definition: Chara.cs:610
Chara host
Definition: Chara.cs:33
override bool IsPCParty
Definition: Chara.cs:613
AIAct SetAI(AIAct g)
Definition: Chara.cs:8449
override bool isSynced
Definition: Chara.cs:689
override CardRenderer _CreateRenderer()
Definition: Chara.cs:6334
Zone currentZone
Definition: Chara.cs:253
bool IsHomeMember()
Definition: Chara.cs:6283
bool IsGuest()
Definition: Chara.cs:6308
override CardRow sourceCard
Definition: Chara.cs:448
FactionBranch homeBranch
Definition: Chara.cs:1052
PCCData pccData
Definition: Chara.cs:67
Definition: Date.cs:4
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
bool IsExpired(int time)
Definition: Date.cs:332
string GetText(TextFormat format)
Definition: Date.cs:245
int GetRemainingHours(int rawDeadLine)
Definition: Date.cs:337
Definition: Dialog.cs:7
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
Definition: Dialog.cs:528
static Scene scene
Definition: EClass.cs:30
static Faction Home
Definition: EClass.cs:26
static Zone _zone
Definition: EClass.cs:20
static World world
Definition: EClass.cs:40
static FactionBranch Branch
Definition: EClass.cs:22
static Chara pc
Definition: EClass.cs:14
static UI ui
Definition: EClass.cs:16
void ChangeMemberType(Chara c, FactionMemberType type)
void AddReserve(Chara c)
Definition: FACTION.cs:327
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:82
UIMultiList multi
Definition: LayerPeople.cs:30
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:97
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:497
void Show(UIItem i)
void AddButton(Func< string > funcText, UnityAction action=null)
virtual void Refresh(bool highlightLast=false)
Definition: UIList.cs:424
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, Chara.host, 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 63 of file BaseListPeople.cs.

64 {
65 SetSubText(a, b);
66 if (ShowHome)
67 {
68 if (a.IsPCFaction)
69 {
70 Sprite icon = a.affinity.GetIcon();
71 if ((bool)icon)
72 {
73 Util.Instantiate<UIItem>("UI/Element/Grid/Attach/affinity", b).image1.sprite = icon;
74 }
75 }
76 AddSubButtonWork(b, a);
77 Room room = a.FindRoom();
78 TraitBed bed = a.FindBed();
79 if (a.memberType == FactionMemberType.Default)
80 {
82 {
83 if (room == null)
84 {
85 SE.BeepSmall();
86 }
87 else
88 {
89 EClass.pc.SetAI(new AI_Goto(room.GetRandomFreePos(), 1));
90 layer.Close();
91 }
92 }, null, delegate(UITooltip t)
93 {
94 t.note.Clear();
95 t.note.AddHeader("infoHome".lang((room != null) ? room.Name : "none".lang()));
96 t.note.AddTopic("TopicLeft", "infoBed".lang(), (bed != null) ? bed.Name.ToTitleCase() : "none".lang());
97 t.note.Build();
98 if (room != null)
99 {
100 EClass.core.actionsNextFrame.Add(delegate
101 {
102 });
103 }
104 }).icon.SetAlpha((bed != null) ? 1f : 0.4f);
105 }
106 }
108 {
110 {
111 SE.Play("pop_paper");
112 LayerChara layerChara = EClass.ui.AddLayerDontCloseOthers<LayerChara>();
113 layerChara.windows[0].SetRect(EClass.core.refs.rects.center);
114 layerChara.SetChara(a);
115 }, "charaInfo");
116 }
117 if (IsDisabled(a))
118 {
119 b.gameObject.AddComponent<CanvasGroup>().alpha = 0.6f;
120 }
121 }
Sprite GetIcon()
Definition: Affinity.cs:107
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:7001
override bool IsPCFaction
Definition: Chara.cs:669
Affinity affinity
Definition: Chara.cs:312
Room FindRoom()
Definition: Chara.cs:7562
bool showExtra
Definition: CoreDebug.cs:168
Sprite home
Definition: CoreRef.cs:90
Sprite inspect
Definition: CoreRef.cs:100
RectData center
Definition: CoreRef.cs:164
Rects rects
Definition: CoreRef.cs:359
static CoreDebug debug
Definition: EClass.cs:48
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, CoreRef.icons, Chara.IsPCFaction, Chara.memberType, BaseArea.Name, 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, ListPeopleRevive, and ListPeopleSelect.

Definition at line 436 of file BaseListPeople.cs.

437 {
438 if (memberType == FactionMemberType.Guest)
439 {
440 foreach (Chara chara in EClass._map.charas)
441 {
442 if (chara.IsGuest())
443 {
444 list.Add(chara);
445 }
446 }
447 return;
448 }
449 foreach (Chara member in EClass.Branch.members)
450 {
451 if (member.memberType == memberType && !member.isSummon)
452 {
453 list.Add(member);
454 }
455 }
456 foreach (Chara member2 in EClass.pc.party.members)
457 {
458 if (member2.memberType == memberType && !list.items.Contains(member2))
459 {
460 list.Add(member2);
461 }
462 }
463 }
bool isSummon
Definition: Card.cs:696
Party party
Definition: Chara.cs:43
static Map _map
Definition: EClass.cs:18
List< Chara > members
List< Chara > charas
Definition: Map.cs:81
List< Chara > members
Definition: Party.cs:18
List< object > items
Definition: UIList.cs:241
override void Add(object item)
Definition: UIList.cs:302

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, and ListPeopleEmbark.

Definition at line 465 of file BaseListPeople.cs.

466 {
467 WindowMenu menuLeft = window.menuLeft;
468 menuLeft.Clear();
469 if (!main)
470 {
471 return;
472 }
473 menuLeft.AddButton2Line("sort", () => list.sortMode.ToString(), delegate
474 {
475 list.NextSort();
476 });
477 if (ShowShowMode)
478 {
479 Lang.GetList("info_people");
480 menuLeft.AddButton2Line("info", () => "show" + layer.showMode, delegate
481 {
482 layer.showMode = layer.showMode.NextEnum();
483 List();
484 });
485 }
486 }
virtual bool ShowShowMode
UIList.SortMode sortMode
Definition: BaseList.cs:33
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:114
ShowMode showMode
Definition: LayerPeople.cs:24
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:91
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 239 of file BaseListPeople.cs.

240 {
241 switch (ShowMode)
242 {
243 case LayerPeople.ShowMode.Race:
244 b.SetSubText(a.race.GetName().ToTitleCase(wholeText: true), 300);
245 break;
246 case LayerPeople.ShowMode.Job:
247 b.SetSubText(a.job.GetName().ToTitleCase(wholeText: true), 300);
248 break;
249 case LayerPeople.ShowMode.Work:
250 {
251 string text = a.GetTextWork(simple: true) + "," + a.GetTextHobby(simple: true);
252 b.SetSubText(text.TrimEnd(','), 300);
253 break;
254 }
255 }
256 }
virtual LayerPeople.ShowMode ShowMode
SourceJob.Row job
Definition: Chara.cs:464
string GetTextWork(bool simple=false)
Definition: Chara.cs:8639
string GetTextHobby(bool simple=false)
Definition: Chara.cs:8629
SourceRace.Row race
Definition: Chara.cs:462
UIButton SetSubText(string lang, int x, FontColor c=FontColor.Default, TextAnchor align=TextAnchor.MiddleLeft)
Definition: ItemGeneral.cs:129

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 152 of file BaseListPeople.cs.

153 {
154 t.note.Clear();
155 t.note.AddHeader("infoWork".lang((roomWork != null) ? roomWork.Name : "none".lang()));
156 foreach (Hobby item in a.ListWorks())
157 {
158 AddText(item, "work", a.source.works.Contains(item.source.alias));
159 }
160 foreach (Hobby item2 in a.ListHobbies())
161 {
162 AddText(item2, "hobby", a.source.hobbies.Contains(item2.source.alias));
163 }
164 if (a.IsPCParty)
165 {
166 t.note.Space(8);
167 t.note.AddText("workNotActive_party".lang(), FontColor.Warning);
168 }
170 {
171 t.note.AddText("notCountResident".lang(), FontColor.Good);
172 }
173 t.note.Build();
174 void AddText(Hobby h, string lang, bool fix)
175 {
176 int efficiency = h.GetEfficiency(a);
177 string text = h.Name;
178 if (fix)
179 {
180 text += "*";
181 }
182 text = text.TagColor((efficiency == 0) ? FontColor.Warning : FontColor.Good);
183 string[] array = Lang.GetList("work_lv");
184 string text2 = array[Mathf.Clamp(efficiency / 50, (efficiency != 0) ? 1 : 0, array.Length - 1)];
185 t.note.AddTopic("TopicLeft", lang.lang(), text + " (" + text2 + ")");
186 if (!h.source.destTrait.IsEmpty())
187 {
188 bool flag = EClass._map.FindThing(Type.GetType("Trait" + h.source.destTrait + ", Elin"), a) != null;
189 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();
190 obj.Sort((CardRow a, CardRow b) => a.LV - b.LV);
191 CardRow cardRow = obj[0];
192 t.note.AddText("NoteText_small", "・ " + "workDestTrait".lang(cardRow.GetName().ToTitleCase().TagColor(flag ? FontColor.Good : FontColor.Warning)));
193 }
194 if (efficiency == 0)
195 {
196 t.note.AddText("NoteText_small", "・ " + "workNotActive".lang());
197 }
198 else
199 {
200 for (int i = 0; i < h.source.things.Length; i += 2)
201 {
202 float num = Mathf.Max(1f, (long)h.source.things[i + 1].ToInt() * (long)efficiency * a.homeBranch.GetProductBonus(a) / 100 / 1000);
203 string text3 = h.source.things[i];
204 string s = (text3.StartsWith("#") ? EClass.sources.categories.map[text3.Replace("#", "")].GetName() : EClass.sources.cards.map[h.source.things[i]].GetName());
205 if (h.source.alias == "Breeding")
206 {
207 num = a.race.breeder * 100 / 2500;
208 num = num * (float)((!(text3 == "_egg")) ? 1 : 2) / 3f;
209 if (a.race.breeder > 0 && num <= 0f)
210 {
211 num = 1f;
212 }
213 }
214 t.note.AddText("NoteText_small", "・ " + "work_produce".lang(s.ToTitleCase(), num.ToString() ?? ""));
215 }
216 if (!h.source.elements.IsEmpty())
217 {
218 for (int j = 0; j < h.source.elements.Length; j += 2)
219 {
220 SourceElement.Row row = EClass.sources.elements.map[h.source.elements[j]];
221 int num2 = h.source.elements[j + 1];
222 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));
223 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);
224 }
225 }
226 string[] array2 = h.source.GetDetail().SplitNewline();
227 foreach (string text4 in array2)
228 {
229 if (!text4.IsEmpty())
230 {
231 t.note.AddText("NoteText_small", "・ " + text4);
232 }
233 }
234 }
235 t.note.Space(1);
236 }
237 }
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:2234
new TraitChara trait
Definition: Chara.cs:501
SourceChara.Row source
Definition: Chara.cs:156
static SourceManager sources
Definition: EClass.cs:42
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:6
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
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.

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