Elin Decompiled Documentation EA 23.102 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 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:8136
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:8109
BaseArea GetRoomWork()
Definition: Chara.cs:8087
Sprite work
Definition: CoreRef.cs:92
Icons icons
Definition: CoreRef.cs:339
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:5947
bool isDead
Definition: Chara.cs:374

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:6593
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 254 of file BaseListPeople.cs.

255 {
257 {
258 if (c.currentZone != EClass._zone)
259 {
260 Msg.Say("isIn", c, (c.currentZone == null) ? "???" : c.currentZone.Name);
261 }
262 SE.BeepSmall();
263 return;
264 }
265 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction().SetHighlightTarget(i);
266 if (c.IsGuest())
267 {
268 uIContextMenu.AddButton("findMember", delegate
269 {
270 EClass.pc.SetAI(new AI_Goto(c, 1));
271 layer.Close();
272 });
273 }
274 else if (c.IsHomeMember())
275 {
276 if (!c.IsPC)
277 {
278 uIContextMenu.AddButton("findMember", delegate
279 {
280 EClass.pc.SetAI(new AI_Goto(c, 1));
281 layer.Close();
282 });
283 }
284 uIContextMenu.AddButton("changeName", delegate
285 {
286 Dialog.InputName("dialogChangeName", c.c_altName.IsEmpty(c.NameSimple), delegate(bool cancel, string text)
287 {
288 if (!cancel)
289 {
290 if (text == "*r")
291 {
292 text = NameGen.getRandomName();
293 }
294 c.c_altName = text;
296 }
297 });
298 });
299 if (c != EClass.pc)
300 {
301 if (c.sourceCard.idActor.IsEmpty() && c.host == null)
302 {
303 if (c.pccData == null)
304 {
305 uIContextMenu.AddButton("editPCC", delegate
306 {
307 EClass.ui.AddLayer<LayerEditPortrait>().Activate(c);
308 });
309 uIContextMenu.AddButton("togglePCC", delegate
310 {
311 bool isSynced2 = c.isSynced;
312 c.pccData = PCCData.Create(c.IDPCCBodySet);
313 c.pccData.Randomize(c.IDPCCBodySet);
314 if (isSynced2)
315 {
317 }
318 EClass.scene.syncList.Remove(c.renderer);
319 c._CreateRenderer();
320 if (isSynced2)
321 {
324 }
325 list.Refresh();
326 SE.Click();
327 });
328 }
329 else
330 {
331 uIContextMenu.AddButton("editPCC", delegate
332 {
333 EClass.ui.AddLayer<LayerEditPCC>().Activate(c, UIPCC.Mode.Full);
334 });
335 uIContextMenu.AddButton("togglePCC", delegate
336 {
337 bool isSynced = c.isSynced;
338 if (isSynced)
339 {
341 }
342 EClass.scene.syncList.Remove(c.renderer);
343 c.pccData = null;
344 c._CreateRenderer();
345 if (isSynced)
346 {
349 }
350 list.Refresh();
351 });
352 }
353 }
354 uIContextMenu.AddButton("makeMaid", delegate
355 {
356 if (EClass.Branch.uidMaid == c.uid)
357 {
358 EClass.Branch.uidMaid = 0;
359 }
360 else
361 {
362 EClass.Branch.uidMaid = c.uid;
363 }
364 list.Refresh();
365 SE.Click();
366 });
367 int @int = c.GetInt(36);
368 bool isLivestockTimerOn = memberType == FactionMemberType.Default && !EClass.world.date.IsExpired(@int);
369 int remainingHours = EClass.world.date.GetRemainingHours(@int);
370 if (!c.IsPCParty)
371 {
372 uIContextMenu.AddButton((c.memberType == FactionMemberType.Livestock) ? "daMakeResident" : (isLivestockTimerOn ? "daMakeLivestock2".lang(Date.GetText(remainingHours)) : "daMakeLivestock"), delegate
373 {
374 if (isLivestockTimerOn)
375 {
376 SE.Beep();
377 }
378 else
379 {
380 if (c.memberType == FactionMemberType.Livestock)
381 {
382 c.SetInt(36, EClass.world.date.GetRaw() + 14400);
383 }
384 EClass.Branch.ChangeMemberType(c, (c.memberType != FactionMemberType.Livestock) ? FactionMemberType.Livestock : FactionMemberType.Default);
385 foreach (ListOwner owner in layer.multi.owners)
386 {
387 owner.RefreshTab();
388 }
389 List();
390 SE.Click();
391 }
392 });
393 uIContextMenu.AddButton("addToReserve".lang() + " (" + EClass.Home.listReserve.Count + "/" + EClass.Home.GetMaxReserve() + ")", delegate
394 {
396 {
397 SE.Beep();
398 Msg.Say("reserveLimit");
399 return;
400 }
401 SE.MoveZone();
403 list.List();
404 foreach (ListOwner owner2 in layer.multi.owners)
405 {
406 owner2.RefreshTab();
407 }
408 });
409 }
410 }
411 }
412 uIContextMenu.Show();
413 }
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:1493
int uid
Definition: Card.cs:118
string NameSimple
Definition: Card.cs:2015
CardRenderer renderer
Definition: Card.cs:57
string IDPCCBodySet
Definition: Chara.cs:476
override bool IsAliveInCurrentZone
Definition: Chara.cs:546
override bool IsPC
Definition: Chara.cs:597
Chara host
Definition: Chara.cs:33
override bool IsPCParty
Definition: Chara.cs:600
AIAct SetAI(AIAct g)
Definition: Chara.cs:8045
override bool isSynced
Definition: Chara.cs:676
override CardRenderer _CreateRenderer()
Definition: Chara.cs:5993
Zone currentZone
Definition: Chara.cs:240
bool IsHomeMember()
Definition: Chara.cs:5942
bool IsGuest()
Definition: Chara.cs:5967
override CardRow sourceCard
Definition: Chara.cs:435
PCCData pccData
Definition: Chara.cs:64
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:131
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:6629
override bool IsPCFaction
Definition: Chara.cs:656
Affinity affinity
Definition: Chara.cs:299
Room FindRoom()
Definition: Chara.cs:7161
bool showExtra
Definition: CoreDebug.cs:167
Sprite home
Definition: CoreRef.cs:88
Sprite inspect
Definition: CoreRef.cs:98
RectData center
Definition: CoreRef.cs:162
Rects rects
Definition: CoreRef.cs:345
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 415 of file BaseListPeople.cs.

416 {
417 if (memberType == FactionMemberType.Guest)
418 {
419 foreach (Chara chara in EClass._map.charas)
420 {
421 if (chara.IsGuest())
422 {
423 list.Add(chara);
424 }
425 }
426 return;
427 }
428 foreach (Chara member in EClass.Branch.members)
429 {
430 if (member.memberType == memberType && !member.isSummon)
431 {
432 list.Add(member);
433 }
434 }
435 }
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 437 of file BaseListPeople.cs.

438 {
439 WindowMenu menuLeft = window.menuLeft;
440 menuLeft.Clear();
441 if (!main)
442 {
443 return;
444 }
445 menuLeft.AddButton2Line("sort", () => list.sortMode.ToString(), delegate
446 {
447 list.NextSort();
448 });
449 if (ShowShowMode)
450 {
451 Lang.GetList("info_people");
452 menuLeft.AddButton2Line("info", () => "show" + layer.showMode, delegate
453 {
454 layer.showMode = layer.showMode.NextEnum();
455 List();
456 });
457 }
458 }
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 235 of file BaseListPeople.cs.

236 {
237 switch (ShowMode)
238 {
239 case LayerPeople.ShowMode.Race:
240 b.SetSubText(a.race.GetName().ToTitleCase(wholeText: true), 300);
241 break;
242 case LayerPeople.ShowMode.Job:
243 b.SetSubText(a.job.GetName().ToTitleCase(wholeText: true), 300);
244 break;
245 case LayerPeople.ShowMode.Work:
246 {
247 string text = a.GetTextWork(simple: true) + "," + a.GetTextHobby(simple: true);
248 b.SetSubText(text.TrimEnd(','), 300);
249 break;
250 }
251 }
252 }
virtual LayerPeople.ShowMode ShowMode
SourceJob.Row job
Definition: Chara.cs:451
string GetTextWork(bool simple=false)
Definition: Chara.cs:8235
string GetTextHobby(bool simple=false)
Definition: Chara.cs:8225
SourceRace.Row race
Definition: Chara.cs:449
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 }
169 t.note.Build();
170 void AddText(Hobby h, string lang, bool fix)
171 {
172 int efficiency = h.GetEfficiency(a);
173 string text = h.Name;
174 if (fix)
175 {
176 text += "*";
177 }
178 text = text.TagColor((efficiency == 0) ? FontColor.Warning : FontColor.Good);
179 string[] array = Lang.GetList("work_lv");
180 string text2 = array[Mathf.Clamp(efficiency / 50, (efficiency != 0) ? 1 : 0, array.Length - 1)];
181 t.note.AddTopic("TopicLeft", lang.lang(), text + " (" + text2 + ")");
182 if (!h.source.destTrait.IsEmpty())
183 {
184 bool flag = EClass._map.FindThing(Type.GetType("Trait" + h.source.destTrait + ", Elin"), a) != null;
185 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();
186 obj.Sort((CardRow a, CardRow b) => a.LV - b.LV);
187 CardRow cardRow = obj[0];
188 t.note.AddText("NoteText_small", "・ " + "workDestTrait".lang(cardRow.GetName().ToTitleCase().TagColor(flag ? FontColor.Good : FontColor.Warning)));
189 }
190 if (efficiency == 0)
191 {
192 t.note.AddText("NoteText_small", "・ " + "workNotActive".lang());
193 }
194 else
195 {
196 for (int i = 0; i < h.source.things.Length; i += 2)
197 {
198 int num = Mathf.Max(1, h.source.things[i + 1].ToInt() * efficiency * a.homeBranch.GetProductBonus(a) / 100 / 1000);
199 string text3 = h.source.things[i];
200 string s = (text3.StartsWith("#") ? EClass.sources.categories.map[text3.Replace("#", "")].GetName() : EClass.sources.cards.map[h.source.things[i]].GetName());
201 if (h.source.alias == "Breeding")
202 {
203 num = a.race.breeder * 100 / 2500;
204 num = num * ((!(text3 == "_egg")) ? 1 : 2) / 3;
205 if (a.race.breeder > 0 && num <= 0)
206 {
207 num = 1;
208 }
209 }
210 t.note.AddText("NoteText_small", "・ " + "work_produce".lang(s.ToTitleCase(), num.ToString() ?? ""));
211 }
212 if (!h.source.elements.IsEmpty())
213 {
214 for (int j = 0; j < h.source.elements.Length; j += 2)
215 {
216 SourceElement.Row row = EClass.sources.elements.map[h.source.elements[j]];
217 int num2 = h.source.elements[j + 1];
218 int num3 = ((num2 < 0 || row.id == 2115 || row.id == 2207) ? (num2 / 10) : Mathf.Max(0, num2 * h.GetEfficiency(a) * a.homeBranch.efficiency / 100 / 1000));
219 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);
220 }
221 }
222 string[] array2 = h.source.GetDetail().SplitNewline();
223 foreach (string text4 in array2)
224 {
225 if (!text4.IsEmpty())
226 {
227 t.note.AddText("NoteText_small", "・ " + text4);
228 }
229 }
230 }
231 t.note.Space(1);
232 }
233 }
FontColor
Definition: FontColor.cs:2
virtual string GetName(int i)
Definition: CardRow.cs:95
string[] trait
Definition: CardRow.cs:33
SourceChara.Row source
Definition: Chara.cs:143
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
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: