Elin Modding Docs Doc
Loading...
Searching...
No Matches
ContentHomeReport.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x02000550 RID: 1360
6{
7 // Token: 0x17000B23 RID: 2851
8 // (get) Token: 0x060024F2 RID: 9458 RVA: 0x000D0F0C File Offset: 0x000CF10C
9 public int tabResearch
10 {
11 get
12 {
13 return 1;
14 }
15 }
16
17 // Token: 0x060024F3 RID: 9459 RVA: 0x000D0F10 File Offset: 0x000CF110
18 public override void OnSwitchContent(int idTab)
19 {
20 this.faction = EClass.pc.faction;
21 this.branch = (EClass.Branch ?? EClass.pc.homeZone.branch);
22 FactionBranch factionBranch = EClass.Branch;
23 this.zone = (((factionBranch != null) ? factionBranch.owner : null) ?? EClass.pc.homeZone);
24 }
25
26 // Token: 0x060024F4 RID: 9460 RVA: 0x000D0F70 File Offset: 0x000CF170
27 public void RefreshInfo()
28 {
29 this.textName.SetText(this.faction.name + " <size=13>" + "_branch".lang(this.zone.Name, null, null, null, null) + "</size>");
30 this.textRank.SetText(this.branch.RankText);
31 this.textReknown.SetText("0");
32 this.textKarma.SetText("20");
33 this.textPopu.SetText((this.branch.rank != 0) ? this.branch.faith.Name : "none".lang());
34 this.textHeaderReport.text = "headerHomeReport".lang(EClass.world.date.year.ToString() ?? "", EClass.world.date.month.ToString() + "/" + EClass.world.date.day.ToString(), null, null, null);
35 this.buttonHappinessResident.mainText.text = this.branch.happiness.residents.GetText();
36 this.buttonHappinessLivestock.mainText.text = this.branch.happiness.livestocks.GetText();
37 this.buttonHappinessResident.subText.text = (this.branch.CountMembers(FactionMemberType.Default, false).ToString() ?? "");
38 this.buttonHappinessLivestock.subText.text = (this.branch.CountMembers(FactionMemberType.Livestock, false).ToString() ?? "");
39 this.buttonHappinessResident.SetTooltip(delegate(UITooltip t)
40 {
41 this.branch.happiness.residents.WriteNote(t.note);
42 }, true);
43 this.buttonHappinessLivestock.SetTooltip(delegate(UITooltip t)
44 {
45 this.branch.happiness.livestocks.WriteNote(t.note);
46 }, true);
47 }
48
49 // Token: 0x060024F5 RID: 9461 RVA: 0x000D116C File Offset: 0x000CF36C
50 public string GetTextHappiness(List<Chara> list)
51 {
52 int num = 0;
53 int num2 = 0;
54 int num3 = 0;
55 int num4 = 0;
56 foreach (Chara chara in list)
57 {
58 int happiness = chara.GetHappiness();
59 if (happiness >= 80)
60 {
61 num2++;
62 }
63 else if (happiness >= 30)
64 {
65 num3++;
66 }
67 else
68 {
69 num4++;
70 }
71 num += happiness;
72 }
73 int avg = (list.Count == 0) ? 0 : (num / list.Count);
74 string s = string.Concat(new string[]
75 {
76 "(",
77 num2.ToString().TagColor(FontColor.Good, null),
78 "/",
79 num3.ToString().TagColor(FontColor.Default, null),
80 "/",
81 num4.ToString().TagColor(FontColor.Bad, null),
82 ")"
83 });
84 return (((list.Count == 0) ? " - " : avg.ToString()) + "%").TagColorGoodBad(() => list.Count == 0 || avg >= 50, false) + " " + s.TagSize(14);
85 }
86
87 // Token: 0x060024F6 RID: 9462 RVA: 0x000D12CC File Offset: 0x000CF4CC
88 public void RefreshResources()
89 {
90 this.listCurrencies.Clear();
91 BaseList baseList = this.listCurrencies;
92 UIList.Callback<BaseHomeResource, ItemHomeResource> callback = new UIList.Callback<BaseHomeResource, ItemHomeResource>();
93 callback.onInstantiate = delegate(BaseHomeResource a, ItemHomeResource b)
94 {
95 b.SetResource(a);
96 };
97 callback.onList = delegate(UIList.SortMode m)
98 {
99 foreach (BaseHomeResource baseHomeResource in this.branch.resources.list)
100 {
101 if (baseHomeResource.IsCurrency)
102 {
103 this.listCurrencies.Add(baseHomeResource);
104 }
105 }
106 };
107 baseList.callbacks = callback;
108 this.listCurrencies.List(false);
109 this.listResources.Clear();
110 BaseList baseList2 = this.listResources;
111 UIList.Callback<BaseHomeResource, ItemHomeResource> callback2 = new UIList.Callback<BaseHomeResource, ItemHomeResource>();
112 callback2.onInstantiate = delegate(BaseHomeResource a, ItemHomeResource b)
113 {
114 b.SetResource(a);
115 };
116 callback2.onList = delegate(UIList.SortMode m)
117 {
118 foreach (BaseHomeResource baseHomeResource in this.branch.resources.list)
119 {
120 if (baseHomeResource.IsRate)
121 {
122 this.listResources.Add(baseHomeResource);
123 }
124 }
125 };
126 baseList2.callbacks = callback2;
127 this.listResources.List(false);
128 }
129
130 // Token: 0x04001476 RID: 5238
131 public UIText textName;
132
133 // Token: 0x04001477 RID: 5239
134 public UIText textRank;
135
136 // Token: 0x04001478 RID: 5240
137 public UIText textWealth;
138
139 // Token: 0x04001479 RID: 5241
140 public UIText textHearth;
141
142 // Token: 0x0400147A RID: 5242
143 public UIText textPopu;
144
145 // Token: 0x0400147B RID: 5243
146 public UIText textInfluence;
147
148 // Token: 0x0400147C RID: 5244
149 public UIText textKnowledge;
150
151 // Token: 0x0400147D RID: 5245
152 public UIText textHeaderReport;
153
154 // Token: 0x0400147E RID: 5246
155 public UIText textReknown;
156
157 // Token: 0x0400147F RID: 5247
158 public UIText textKarma;
159
160 // Token: 0x04001480 RID: 5248
161 public UIButton buttonHappinessResident;
162
163 // Token: 0x04001481 RID: 5249
164 public UIButton buttonHappinessLivestock;
165
166 // Token: 0x04001482 RID: 5250
167 public UIList listCurrencies;
168
169 // Token: 0x04001483 RID: 5251
170 public UIList listResources;
171
172 // Token: 0x04001484 RID: 5252
173 public Faction faction;
174
175 // Token: 0x04001485 RID: 5253
176 public FactionBranch branch;
177
178 // Token: 0x04001486 RID: 5254
179 public Zone zone;
180}
Definition Chara.cs:12
Definition Zone.cs:14