Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ContentHomeReport Class Reference
Inheritance diagram for ContentHomeReport:
Content UIContent UINote

Public Member Functions

override void OnSwitchContent (int idTab)
 
void RefreshInfo ()
 
string GetTextHappiness (List< Chara > list)
 
void RefreshResources ()
 
- Public Member Functions inherited from UIContent
virtual void OnSwitchContent (int idTab)
 
virtual void OnInstantiate ()
 
- Public Member Functions inherited from UINote
void Clear ()
 
void Build ()
 
void Space (int sizeY=0, int sizeX=1)
 
UINote AddNote (string id)
 
UIItem AddHeader (string text, Sprite sprite=null)
 
UIItem AddHeaderCard (string text, Sprite sprite=null)
 
UIItem AddHeaderTopic (string text, Sprite sprite=null)
 
UIItem AddHeader (string id, string text, Sprite sprite=null)
 
UIItem AddText (string text, FontColor color=FontColor.DontChange)
 
UIItem AddText (string id, string text, FontColor color=FontColor.DontChange)
 
UIItem AddText (string id, string text, Color color)
 
UIItem AddItem (string id)
 
UIItem AddTopic (string id, string text, string value=null)
 
UIItem AddTopic (string text, string value=null)
 
void AddImage (Sprite sprite)
 
void AddImage (string idFile)
 
UIButton AddButton (string text, Action onClick)
 
UIButton AddButtonLink (string text, string url)
 
UIDropdown AddDropdown (string id="DropdownDefault")
 
UIButton AddToggle (string idLang="", bool isOn=false, Action< bool > action=null)
 
Transform AddPrefab (string path)
 
AddExtra< T > (string path)
 

Public Attributes

UIText textName
 
UIText textRank
 
UIText textWealth
 
UIText textHearth
 
UIText textPopu
 
UIText textInfluence
 
UIText textKnowledge
 
UIText textHeaderReport
 
UIText textReknown
 
UIText textKarma
 
UIButton buttonHappinessResident
 
UIButton buttonHappinessLivestock
 
UIList listCurrencies
 
UIList listResources
 
Faction faction
 
FactionBranch branch
 
Zone zone
 
- Public Attributes inherited from UINote
RectTransform target
 
UINoteProfile prof
 
SkinType skinType
 
string idDefaultText
 
LayoutGroup layout
 
RectTransform cur
 
bool extraRebuild
 

Properties

int tabResearch [get]
 

Detailed Description

Definition at line 3 of file ContentHomeReport.cs.

Member Function Documentation

◆ GetTextHappiness()

string ContentHomeReport.GetTextHappiness ( List< Chara list)
inline

Definition at line 70 of file ContentHomeReport.cs.

71 {
72 int num = 0;
73 int num2 = 0;
74 int num3 = 0;
75 int num4 = 0;
76 foreach (Chara item in list)
77 {
78 int happiness = item.GetHappiness();
79 if (happiness >= 80)
80 {
81 num2++;
82 }
83 else if (happiness >= 30)
84 {
85 num3++;
86 }
87 else
88 {
89 num4++;
90 }
91 num += happiness;
92 }
93 int avg = ((list.Count != 0) ? (num / list.Count) : 0);
94 string s = "(" + num2.ToString().TagColor(FontColor.Good) + "/" + num3.ToString().TagColor(FontColor.Default) + "/" + num4.ToString().TagColor(FontColor.Bad) + ")";
95 return (((list.Count == 0) ? " - " : avg.ToString()) + "%").TagColorGoodBad(() => list.Count == 0 || avg >= 50) + " " + s.TagSize(14);
96 }
FontColor
Definition: FontColor.cs:2
Definition: Chara.cs:10

References item.

◆ OnSwitchContent()

override void ContentHomeReport.OnSwitchContent ( int  idTab)
inlinevirtual

Reimplemented from UIContent.

Definition at line 41 of file ContentHomeReport.cs.

42 {
44 branch = EClass.Branch ?? EClass.pc.homeZone.branch;
46 }
Faction faction
Definition: Chara.cs:412
Zone homeZone
Definition: Chara.cs:252
FactionBranch branch
Definition: EClass.cs:5
static FactionBranch Branch
Definition: EClass.cs:22
static Chara pc
Definition: EClass.cs:14
FactionBranch branch
Definition: Zone.cs:34

References branch, EClass.Branch, Zone.branch, Chara.faction, faction, Chara.homeZone, FactionBranch.owner, EClass.pc, and zone.

◆ RefreshInfo()

void ContentHomeReport.RefreshInfo ( )
inline

Definition at line 48 of file ContentHomeReport.cs.

49 {
50 textName.SetText(faction.name + " <size=13>" + "_branch".lang(zone.Name) + "</size>");
53 textKarma.SetText("20");
54 textPopu.SetText((branch.rank != 0) ? branch.faith.Name : "none".lang());
55 textHeaderReport.text = "headerHomeReport".lang(EClass.world.date.year.ToString() ?? "", EClass.world.date.month + "/" + EClass.world.date.day);
56 buttonHappinessResident.mainText.text = branch.happiness.residents.GetText();
57 buttonHappinessLivestock.mainText.text = branch.happiness.livestocks.GetText();
58 buttonHappinessResident.subText.text = branch.CountMembers(FactionMemberType.Default).ToString() ?? "";
59 buttonHappinessLivestock.subText.text = branch.CountMembers(FactionMemberType.Livestock).ToString() ?? "";
61 {
63 });
65 {
67 });
68 }
FactionMemberType
UIButton buttonHappinessLivestock
UIButton buttonHappinessResident
int month
Definition: Date.cs:50
int day
Definition: Date.cs:62
int year
Definition: Date.cs:38
static World world
Definition: EClass.cs:40
HappinessManager happiness
int CountMembers(FactionMemberType type, bool onlyAlive=false)
Religion faith
string name
Definition: FACTION.cs:133
void WriteNote(UINote n)
Definition: Happiness.cs:108
string GetText()
Definition: Happiness.cs:63
string Name
Definition: Religion.cs:30
virtual string Name
Definition: Spatial.cs:495
void SetTooltip(Action< UITooltip > onShowTooltip=null, bool enable=true)
Definition: UIButton.cs:361
void SetText(string s)
Definition: UIText.cs:159
UINote note
Definition: UITooltip.cs:21
GameDate date
Definition: World.cs:6

References branch, buttonHappinessLivestock, buttonHappinessResident, FactionBranch.CountMembers(), World.date, Date.day, faction, FactionBranch.faith, Happiness.GetText(), FactionBranch.happiness, HappinessManager.livestocks, Date.month, Faction.name, Religion.Name, Spatial.Name, UITooltip.note, FactionBranch.rank, FactionBranch.RankText, HappinessManager.residents, UIText.SetText(), UIButton.SetTooltip(), textKarma, textName, textPopu, textRank, textReknown, EClass.world, Happiness.WriteNote(), Date.year, and zone.

◆ RefreshResources()

void ContentHomeReport.RefreshResources ( )
inline

Definition at line 98 of file ContentHomeReport.cs.

99 {
101 listCurrencies.callbacks = new UIList.Callback<BaseHomeResource, ItemHomeResource>
102 {
103 onInstantiate = delegate(BaseHomeResource a, ItemHomeResource b)
104 {
105 b.SetResource(a);
106 },
107 onList = delegate
108 {
110 {
111 if (item.IsCurrency)
112 {
114 }
115 }
116 }
117 };
120 listResources.callbacks = new UIList.Callback<BaseHomeResource, ItemHomeResource>
121 {
122 onInstantiate = delegate(BaseHomeResource a, ItemHomeResource b)
123 {
124 b.SetResource(a);
125 },
126 onList = delegate
127 {
128 foreach (BaseHomeResource item2 in branch.resources.list)
129 {
130 if (item2.IsRate)
131 {
132 listResources.Add(item2);
133 }
134 }
135 }
136 };
138 }
HomeResourceManager resources
List< BaseHomeResource > list
void SetResource(BaseHomeResource _r)
Definition: UIList.cs:9
override void Clear()
Definition: UIList.cs:349
override void Add(object item)
Definition: UIList.cs:302
override void List()
Definition: UIList.cs:717

References UIList.Add(), branch, UIList.Clear(), BaseHomeResource.IsRate, item, HomeResourceManager.list, UIList.List(), listCurrencies, listResources, FactionBranch.resources, and ItemHomeResource.SetResource().

Member Data Documentation

◆ branch

FactionBranch ContentHomeReport.branch

Definition at line 35 of file ContentHomeReport.cs.

Referenced by OnSwitchContent(), RefreshInfo(), and RefreshResources().

◆ buttonHappinessLivestock

UIButton ContentHomeReport.buttonHappinessLivestock

Definition at line 27 of file ContentHomeReport.cs.

Referenced by RefreshInfo().

◆ buttonHappinessResident

UIButton ContentHomeReport.buttonHappinessResident

Definition at line 25 of file ContentHomeReport.cs.

Referenced by RefreshInfo().

◆ faction

Faction ContentHomeReport.faction

Definition at line 33 of file ContentHomeReport.cs.

Referenced by OnSwitchContent(), and RefreshInfo().

◆ listCurrencies

UIList ContentHomeReport.listCurrencies

Definition at line 29 of file ContentHomeReport.cs.

Referenced by RefreshResources().

◆ listResources

UIList ContentHomeReport.listResources

Definition at line 31 of file ContentHomeReport.cs.

Referenced by RefreshResources().

◆ textHeaderReport

UIText ContentHomeReport.textHeaderReport

Definition at line 19 of file ContentHomeReport.cs.

◆ textHearth

UIText ContentHomeReport.textHearth

Definition at line 11 of file ContentHomeReport.cs.

◆ textInfluence

UIText ContentHomeReport.textInfluence

Definition at line 15 of file ContentHomeReport.cs.

◆ textKarma

UIText ContentHomeReport.textKarma

Definition at line 23 of file ContentHomeReport.cs.

Referenced by RefreshInfo().

◆ textKnowledge

UIText ContentHomeReport.textKnowledge

Definition at line 17 of file ContentHomeReport.cs.

◆ textName

UIText ContentHomeReport.textName

Definition at line 5 of file ContentHomeReport.cs.

Referenced by RefreshInfo().

◆ textPopu

UIText ContentHomeReport.textPopu

Definition at line 13 of file ContentHomeReport.cs.

Referenced by RefreshInfo().

◆ textRank

UIText ContentHomeReport.textRank

Definition at line 7 of file ContentHomeReport.cs.

Referenced by RefreshInfo().

◆ textReknown

UIText ContentHomeReport.textReknown

Definition at line 21 of file ContentHomeReport.cs.

Referenced by RefreshInfo().

◆ textWealth

UIText ContentHomeReport.textWealth

Definition at line 9 of file ContentHomeReport.cs.

◆ zone

Zone ContentHomeReport.zone

Definition at line 37 of file ContentHomeReport.cs.

Referenced by OnSwitchContent(), and RefreshInfo().

Property Documentation

◆ tabResearch

int ContentHomeReport.tabResearch
get

Definition at line 39 of file ContentHomeReport.cs.


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