12 public int tabResearch
23 EMono._zone.RefreshElectricity();
25 this.faction =
EMono.pc.faction;
26 this.branch = (EMono.Branch ??
EMono.pc.homeZone.branch);
28 this.zone = (((factionBranch !=
null) ? factionBranch.owner :
null) ??
EMono.pc.homeZone);
29 this.branch.resources.Refresh();
31 this.RefreshResources();
33 this.transLayout.RebuildLayoutTo(
this);
37 public void RefreshInfo()
39 this.textHeaderReport.text =
"headerHomeReport".lang(
EMono.world.date.year.ToString() ??
"",
EMono.world.date.month.ToString() +
"/" +
EMono.world.date.day.ToString(),
null,
null,
null);
40 this.textFaction.text =
EMono.pc.faction.Name;
41 this.textGod.text = this.branch.faith.Name;
42 this.textContentLv.text = this.branch.DangerLV.ToString() +
" " + (
"(" + this.branch.ContentLV.ToString() +
")").TagSize(12);
43 this.textDateFound.text =
Date.GetText(this.branch.dateFound,
Date.TextFormat.YearMonthDay);
44 this.textPasture.text = this.branch.CountPasture().ToString() +
" " + (
"(-" + this.branch.GetPastureCost().ToString() +
"dailyIncome".lang() +
")").TagSize(12);
45 bool flag = this.branch.CountMembers(FactionMemberType.Default,
false) > this.branch.MaxPopulation;
46 this.textMember.SetText(this.branch.CountMembers(FactionMemberType.Default,
false).ToString() +
" / " +
this.branch.MaxPopulation.ToString(), flag ? FontColor.Bad : FontColor.Default);
51 this.textDev.text = ((EMono._zone.development / 10).ToString() ??
"");
52 this.textLand.text = (EMono._map.bounds.Width * EMono._map.bounds.Height / 100).ToString() +
" ㎢";
53 int civility = this.branch.GetCivility();
54 this.textCivility.text = civility.ToString() +
" " + (
"(" + Lang.GetList(
"civility")[Mathf.Clamp(civility / 20, 0, 4)] +
")").TagSize(12);
55 int electricity =
EMono._zone.GetElectricity(
true);
56 int electricity2 =
EMono._zone.GetElectricity(
false);
57 this.textElec.SetText(
"elecLv".lang(electricity2.ToString() ??
"", (electricity.ToString() ??
"").TagColor((electricity <= electricity2) ? FontColor.Good : FontColor.Bad,
null),
null,
null,
null));
58 if (electricity > electricity2)
62 int soilCost = this.zone.GetSoilCost();
63 int maxSoil = this.branch.MaxSoil;
64 this.textSoil.SetText(
"soilLv".lang(maxSoil.ToString() ??
"", ((maxSoil - soilCost).ToString() ??
"").TagColor((soilCost <= maxSoil) ? FontColor.Good : FontColor.Bad,
null),
null,
null,
null));
65 if (soilCost > maxSoil)
69 this.textName.SetText(this.zone.Name);
70 this.textRank.SetText(this.branch.RankText);
71 this.textPopu.SetText(this.faction.name);
72 this.textFaith.SetText(this.branch.faith.Name + Environment.NewLine + (
" ♥" +
this.branch.RankText).TagSize(13));
73 this.imageFaith.sprite = this.branch.faith.GetSprite();
74 this.textTemper.SetText(this.branch.faith.GetTextTemper(
this.branch.temper));
75 this.barTemper.fillAmount = 0.5f + (float)this.branch.temper * 0.01f * 0.5f;
76 this.barTemper.color = ((this.branch.temper > -25) ? SkinManager.CurrentColors.textGood : SkinManager.CurrentColors.textBad);
79 this.buttonWorth.mainText.SetText(this.branch.Worth.ToFormat());
80 this.buttonWorth.SetTooltip(delegate(UITooltip t)
82 this.branch.resources.worth.WriteNote(t.note);
85 this.buttonLv.mainText.SetText(this.branch.lv.ToString() ??
"");
86 this.buttonLv.SetTooltip(delegate(UITooltip t)
88 UIHomeInfo.<>c__DisplayClass38_0 CS$<>8__locals1;
89 CS$<>8__locals1.n = t.note;
90 CS$<>8__locals1.n.Clear();
91 CS$<>8__locals1.n.AddHeader(
"branchLv".lang(),
null);
92 CS$<>8__locals1.n.AddTopic(
"TopicLeft",
"vCurrent".lang(),
EMono.Branch.TextLv);
93 CS$<>8__locals1.n.Space(0, 1);
94 this.<RefreshInfo>g__Write|38_6(this.branch.lv, ref CS$<>8__locals1);
95 if (this.branch.lv <
this.branch.MaxLv)
97 CS$<>8__locals1.n.Space(0, 1);
98 CS$<>8__locals1.n.AddHeaderTopic(
"nextLevel",
null);
99 this.<RefreshInfo>g__Write|38_6(this.branch.lv + 1, ref CS$<>8__locals1);
103 this.buttonRanking.mainText.SetText(
EMono.game.spatials.ranks.GetRankText(
EMono._zone));
104 this.buttonRanking.SetTooltip(delegate(UITooltip t)
106 UINote note = t.note;
108 note.AddHeader(
"homeRanking".lang(),
null);
109 note.AddTopic(
"TopicLeft",
"vCurrent".lang(),
EMono.game.spatials.ranks.GetRankText(
EMono._zone));
111 note.AddHeader(
"HeaderTopic",
"rank_income".lang(),
null);
113 note.AddText(
"rank_income2".lang(
EMono.game.spatials.ranks.GetIncome(
EMono._zone).ToFormat(),
null,
null,
null,
null), FontColor.DontChange);
116 this.buttonRank.mainText.SetText(this.branch.rank.ToString() ??
"");
117 this.buttonRank.SetTooltip(delegate(UITooltip t)
119 UINote note = t.note;
121 note.AddHeader(
"factionRank2".lang(),
null);
122 note.AddTopic(
"TopicLeft",
"vCurrent".lang(), this.branch.rank.ToString() ??
"");
125 this.buttonHappinessResident.mainText.text = this.branch.happiness.residents.GetText();
126 this.buttonHappinessLivestock.mainText.text = this.branch.happiness.livestocks.GetText();
127 this.buttonHappinessResident.subText.text = (this.branch.CountMembers(FactionMemberType.Default,
false).ToString() ??
"");
128 this.buttonHappinessLivestock.subText.text = (this.branch.CountMembers(FactionMemberType.Livestock,
false).ToString() ??
"");
129 this.buttonHappinessResident.SetTooltip(delegate(UITooltip t)
131 this.branch.happiness.residents.WriteNote(t.note);
133 this.buttonHappinessLivestock.SetTooltip(delegate(UITooltip t)
135 this.branch.happiness.livestocks.WriteNote(t.note);
140 public string GetTextHappiness(List<Chara> list)
146 foreach (
Chara chara
in list)
148 int happiness = chara.GetHappiness();
153 else if (happiness >= 30)
163 int avg = (list.Count == 0) ? 0 : (num / list.Count);
164 string s =
string.Concat(
new string[]
167 num2.ToString().TagColor(FontColor.Good,
null),
169 num3.ToString().TagColor(FontColor.Default,
null),
171 num4.ToString().TagColor(FontColor.Bad,
null),
174 return (((list.Count == 0) ?
" - " : avg.ToString()) +
"%").TagColorGoodBad(() => list.Count == 0 || avg >= 50,
false) +
" " + s.TagSize(13);
178 public void RefreshResources()
180 this.listCurrencies.Clear();
181 BaseList baseList = this.listCurrencies;
187 callback.onList = delegate(UIList.SortMode m)
191 if (baseHomeResource.IsCurrency && baseHomeResource.IsAvailable)
193 this.listCurrencies.Add(baseHomeResource);
197 baseList.callbacks = callback;
198 this.listCurrencies.List(
false);
199 this.listResources.Clear();
200 BaseList baseList2 = this.listResources;
206 callback2.onList = delegate(UIList.SortMode m)
210 if (baseHomeResource.IsRate && baseHomeResource.IsAvailable)
212 this.listResources.Add(baseHomeResource);
216 baseList2.callbacks = callback2;
217 this.listResources.List(
false);
218 this.listSkill.Clear();
219 BaseList baseList3 = this.listSkill;
225 callback3.onList = delegate(UIList.SortMode m)
229 if (baseHomeResource.IsSkill)
231 this.listSkill.Add(baseHomeResource);
235 baseList3.callbacks = callback3;
236 this.listSkill.List(
false);
247 onShowTooltip = onShowTooltip
249 this.reports.Add(item);
253 public void RefreshReport()
255 if (
EMono.Branch.meetings.list.Count > 0)
257 this.AddReport(
"rMeeting".lang(
EMono.Branch.meetings.list.Count.ToString() ??
"",
null,
null,
null,
null),
UIHomeInfo.
ReportData.ReportType.Default,
null,
null);
259 foreach (
ZoneEvent zoneEvent
in this.branch.owner.events.list)
261 if (zoneEvent.HasReport)
266 foreach (
ResearchPlan researchPlan
in this.branch.researches.newPlans)
268 this.AddReport(
"rNewPlan".lang(researchPlan.Name ??
"",
null,
null,
null,
null),
UIHomeInfo.
ReportData.ReportType.Good, delegate
272 foreach (
ResearchPlan researchPlan2
in this.branch.researches.plans)
274 if (researchPlan2.exp == researchPlan2.MaxExp)
276 this.AddReport(
"vResearched".lang(researchPlan2.Name,
null,
null,
null,
null),
UIHomeInfo.
ReportData.ReportType.Great, delegate
281 foreach (
Chara chara
in this.branch.members)
283 if (!chara.isDead && !chara.IsPCParty && chara.memberType == FactionMemberType.Default && !chara.noMove)
286 if (
EMono.game.activeZone ==
this.branch.owner)
288 using (List<Hobby>.Enumerator enumerator4 = chara.ListWorks(
true).GetEnumerator())
290 while (enumerator4.MoveNext())
292 if (enumerator4.Current.GetEfficiency(chara) > 0)
306 this.AddReport(
"rNoWork".lang(chara.Name,
null,
null,
null,
null).ToTitleCase(
false),
UIHomeInfo.
ReportData.ReportType.Warning,
null,
null);
311 if (chara.GetWorkSummary().work !=
null)
319 if (
EMono.player.taxBills > 0)
321 this.AddReport(
"rBill".lang(
EMono.player.taxBills.ToString() ??
"",
null,
null,
null,
null),
UIHomeInfo.
ReportData.ReportType.Warning,
null,
null);
323 if (this.reports.Count == 0)
327 this.AddReport(
"rTax".lang((30 -
EMono.world.date.day + 1).ToString() ??
"",
this.faction.GetTotalTax(
false).ToFormat(),
null,
null,
null),
UIHomeInfo.
ReportData.ReportType.Default,
null, delegate(UITooltip t)
330 this.faction.SetTaxTooltip(t.note);
333 if (
EMono.debug.showExtra)
335 this.AddReport(
"efficiency:" + this.branch.efficiency.ToString(),
UIHomeInfo.
ReportData.ReportType.Default,
null,
null);
338 this.listReport.Clear();
339 BaseList baseList = this.listReport;
343 if (a.onClick !=
null)
350 b.SetMainText(a.text,
this.iconReports[(
int)a.type],
true);
351 b.button1.mainText.SetColor(a.GetFontColor());
352 if (a.onClick !=
null)
354 b.AddSubButton(
EMono.core.refs.icons.go, a.onClick,
null,
null);
357 if (a.onShowTooltip !=
null)
359 b.button1.SetTooltip(a.onShowTooltip,
true);
362 callback.onList = delegate(UIList.SortMode m)
366 this.listReport.Add(o);
369 callback.onRefresh =
null;
370 baseList.callbacks = callback;
371 this.listReport.List(
false);
376 private void <RefreshInfo>g__Write|38_6(
int lv, ref
UIHomeInfo.<>c__DisplayClass38_0 A_2)
378 string[] array = this.branch.GetHearthHint(lv).SplitNewline();
379 for (
int i = 0; i < array.Length; i++)
381 string text = array[i].Replace(Environment.NewLine,
"");
384 A_2.n.AddText(text, FontColor.DontChange);
390 public Transform transLayout;
393 public UIText textFaction;
396 public UIText textDateFound;
399 public UIText textGod;
402 public UIText textMember;
405 public UIText textLand;
408 public UIText textHeaderReport;
411 public UIText textDev;
414 public UIText textElec;
417 public UIText textCivility;
420 public UIText textName;
423 public UIText textRank;
426 public UIText textPopu;
429 public UIText textFaith;
432 public UIText textTemper;
435 public UIText textSoil;
438 public UIText textContentLv;
441 public UIText textPasture;
444 public UIButton buttonHappinessResident;
447 public UIButton buttonHappinessLivestock;
450 public UIButton buttonWorth;
453 public UIButton buttonRank;
456 public UIButton buttonLv;
459 public UIButton buttonRanking;
462 public UIList listCurrencies;
465 public UIList listResources;
468 public UIList listSkill;
471 public UIList listReport;
483 public Image imageFaith;
486 public Image barTemper;
492 public Sprite[] iconReports;
498 public FontColor GetFontColor()
503 return FontColor.Warning;
505 return FontColor.Bad;
507 return FontColor.Good;
509 return FontColor.Good;
511 return FontColor.Great;
513 return FontColor.Default;
518 public UIHomeInfo.ReportData.ReportType type;
524 public Action onClick;
527 public Action<UITooltip> onShowTooltip;
530 public enum ReportType