Elin Decompiled Documentation EA 23.130 Nightly
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 (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:8234
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:8207
BaseArea GetRoomWork()
Definition: Chara.cs:8185
Sprite work
Definition: CoreRef.cs:94
Icons icons
Definition: CoreRef.cs:341
CoreRef refs
Definition: Core.cs:51
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6
Definition: Hobby.cs:4
UIButton AddSubButton(Sprite sprite, Action action, string lang=null, Action< UITooltip > onTooltip=null)
Definition: ItemGeneral.cs:76

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:6005
bool isDead
Definition: Chara.cs:379

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);
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:97
Definition: Chara.cs:10
override void SetSortVal(UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
Definition: Chara.cs:6665
void Build()
Definition: ItemGeneral.cs:161
void SetChara(Chara c)
Definition: ItemGeneral.cs:21
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 uIContextMenu.AddButton("togglePCC", delegate
314 {
315 bool isSynced2 = c.isSynced;
316 c.pccData = PCCData.Create(c.IDPCCBodySet);
317 c.pccData.Randomize(c.IDPCCBodySet);
318 if (isSynced2)
319 {
321 }
322 EClass.scene.syncList.Remove(c.renderer);
323 c._CreateRenderer();
324 if (isSynced2)
325 {
328 }
329 list.Refresh();
330 SE.Click();
331 });
332 }
333 else
334 {
335 uIContextMenu.AddButton("editPCC", delegate
336 {
337 EClass.ui.AddLayer<LayerEditPCC>().Activate(c, UIPCC.Mode.Full);
338 });
339 uIContextMenu.AddButton("togglePCC", delegate
340 {
341 bool isSynced = c.isSynced;
342 if (isSynced)
343 {
345 }
346 EClass.scene.syncList.Remove(c.renderer);
347 c.pccData = null;
348 c._CreateRenderer();
349 if (isSynced)
350 {
353 }
354 list.Refresh();
355 });
356 }
357 }
358 uIContextMenu.AddButton("makeMaid", delegate
359 {
360 if (EClass.Branch.uidMaid == c.uid)
361 {
362 EClass.Branch.uidMaid = 0;
363 }
364 else
365 {
366 EClass.Branch.uidMaid = c.uid;
367 }
368 list.Refresh();
369 SE.Click();
370 });
371 int @int = c.GetInt(36);
372 bool isLivestockTimerOn = memberType == FactionMemberType.Default && !EClass.world.date.IsExpired(@int);
373 int remainingHours = EClass.world.date.GetRemainingHours(@int);
374 if (!c.IsPCParty)
375 {
376 uIContextMenu.AddButton((c.memberType == FactionMemberType.Livestock) ? "daMakeResident" : (isLivestockTimerOn ? "daMakeLivestock2".lang(Date.GetText(remainingHours)) : "daMakeLivestock"), delegate
377 {
378 if (isLivestockTimerOn)
379 {
380 SE.Beep();
381 }
382 else
383 {
384 if (c.memberType == FactionMemberType.Livestock)
385 {
386 c.SetInt(36, EClass.world.date.GetRaw() + 14400);
387 }
388 EClass.Branch.ChangeMemberType(c, (c.memberType != FactionMemberType.Livestock) ? FactionMemberType.Livestock : FactionMemberType.Default);
389 foreach (ListOwner owner in layer.multi.owners)
390 {
391 owner.RefreshTab();
392 }
393 List();
394 SE.Click();
395 }
396 });
397 uIContextMenu.AddButton("addToReserve".lang() + " (" + EClass.Home.listReserve.Count + "/" + EClass.Home.GetMaxReserve() + ")", delegate
398 {
400 {
401 SE.Beep();
402 Msg.Say("reserveLimit");
403 return;
404 }
405 SE.MoveZone();
407 list.List();
408 foreach (ListOwner owner2 in layer.multi.owners)
409 {
410 owner2.RefreshTab();
411 }
412 });
413 }
414 }
415 }
416 uIContextMenu.Show();
417 }
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:1517
int uid
Definition: Card.cs:118
string NameSimple
Definition: Card.cs:2039
CardRenderer renderer
Definition: Card.cs:57
string IDPCCBodySet
Definition: Chara.cs:481
override bool IsAliveInCurrentZone
Definition: Chara.cs:551
override bool IsPC
Definition: Chara.cs:602
Chara host
Definition: Chara.cs:33
override bool IsPCParty
Definition: Chara.cs:605
AIAct SetAI(AIAct g)
Definition: Chara.cs:8143
override bool isSynced
Definition: Chara.cs:681
override CardRenderer _CreateRenderer()
Definition: Chara.cs:6051
Zone currentZone
Definition: Chara.cs:245
bool IsHomeMember()
Definition: Chara.cs:6000
bool IsGuest()
Definition: Chara.cs:6025
override CardRow sourceCard
Definition: Chara.cs:440
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:325
List< HireInfo > listReserve
Definition: FACTION.cs:136
int GetMaxReserve()
Definition: FACTION.cs:190
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
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:133
virtual string Name
Definition: Spatial.cs:495
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
GameDate date
Definition: World.cs:6

References Chara._CreateRenderer(), EClass._zone, 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.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(), BaseCard.SetInt(), 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:81
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:6701
override bool IsPCFaction
Definition: Chara.cs:661
Affinity affinity
Definition: Chara.cs:304
Room FindRoom()
Definition: Chara.cs:7263
bool showExtra
Definition: CoreDebug.cs:167
Sprite home
Definition: CoreRef.cs:90
Sprite inspect
Definition: CoreRef.cs:100
RectData center
Definition: CoreRef.cs:164
Rects rects
Definition: CoreRef.cs:347
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 419 of file BaseListPeople.cs.

420 {
421 if (memberType == FactionMemberType.Guest)
422 {
423 foreach (Chara chara in EClass._map.charas)
424 {
425 if (chara.IsGuest())
426 {
427 list.Add(chara);
428 }
429 }
430 return;
431 }
432 foreach (Chara member in EClass.Branch.members)
433 {
434 if (member.memberType == memberType && !member.isSummon)
435 {
436 list.Add(member);
437 }
438 }
439 }
bool isSummon
Definition: Card.cs:682
static Map _map
Definition: EClass.cs:18
List< Chara > members
List< Chara > charas
Definition: Map.cs:81
override void Add(object item)
Definition: UIList.cs:302

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

Referenced by List().

◆ OnRefreshMenu()

override void BaseListPeople.OnRefreshMenu ( )
inlinevirtual

Reimplemented from ListOwner< Chara, ItemGeneral >.

Reimplemented in ListPeopleBed, and ListPeopleEmbark.

Definition at line 441 of file BaseListPeople.cs.

442 {
443 WindowMenu menuLeft = window.menuLeft;
444 menuLeft.Clear();
445 if (!main)
446 {
447 return;
448 }
449 menuLeft.AddButton2Line("sort", () => list.sortMode.ToString(), delegate
450 {
451 list.NextSort();
452 });
453 if (ShowShowMode)
454 {
455 Lang.GetList("info_people");
456 menuLeft.AddButton2Line("info", () => "show" + layer.showMode, delegate
457 {
458 layer.showMode = layer.showMode.NextEnum();
459 List();
460 });
461 }
462 }
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:456
string GetTextWork(bool simple=false)
Definition: Chara.cs:8333
string GetTextHobby(bool simple=false)
Definition: Chara.cs:8323
SourceRace.Row race
Definition: Chara.cs:454
UIButton SetSubText(string lang, int x, FontColor c=FontColor.Default, TextAnchor align=TextAnchor.MiddleLeft)
Definition: ItemGeneral.cs:119

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 int num = Mathf.Max(1, h.source.things[i + 1].ToInt() * 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 * ((!(text3 == "_egg")) ? 1 : 2) / 3;
209 if (a.race.breeder > 0 && num <= 0)
210 {
211 num = 1;
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 int num3 = ((num2 < 0 || row.id == 2115 || row.id == 2207) ? (num2 / 10) : Mathf.Max(0, num2 * 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:2172
new TraitChara trait
Definition: Chara.cs:493
SourceChara.Row source
Definition: Chara.cs:148
static SourceManager sources
Definition: EClass.cs:42
SourceHobby.Row source
Definition: Hobby.cs:7
int GetEfficiency(Chara c)
Definition: Hobby.cs:30
string Name
Definition: Hobby.cs:9
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2570
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: