18 public override void OnSwitchContent(
int idTab)
20 this.faction =
EClass.pc.faction;
21 this.branch = (EClass.Branch ??
EClass.pc.homeZone.branch);
23 this.zone = (((factionBranch !=
null) ? factionBranch.owner :
null) ??
EClass.pc.homeZone);
27 public void RefreshInfo()
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)
41 this.branch.happiness.residents.WriteNote(t.note);
43 this.buttonHappinessLivestock.SetTooltip(delegate(UITooltip t)
45 this.branch.happiness.livestocks.WriteNote(t.note);
50 public string GetTextHappiness(List<Chara> list)
56 foreach (
Chara chara
in list)
58 int happiness = chara.GetHappiness();
63 else if (happiness >= 30)
73 int avg = (list.Count == 0) ? 0 : (num / list.Count);
74 string s =
string.Concat(
new string[]
77 num2.ToString().TagColor(FontColor.Good,
null),
79 num3.ToString().TagColor(FontColor.Default,
null),
81 num4.ToString().TagColor(FontColor.Bad,
null),
84 return (((list.Count == 0) ?
" - " : avg.ToString()) +
"%").TagColorGoodBad(() => list.Count == 0 || avg >= 50,
false) +
" " + s.TagSize(14);
88 public void RefreshResources()
90 this.listCurrencies.Clear();
91 BaseList baseList = this.listCurrencies;
97 callback.onList = delegate(UIList.SortMode m)
101 if (baseHomeResource.IsCurrency)
103 this.listCurrencies.Add(baseHomeResource);
107 baseList.callbacks = callback;
108 this.listCurrencies.List(
false);
109 this.listResources.Clear();
110 BaseList baseList2 = this.listResources;
116 callback2.onList = delegate(UIList.SortMode m)
120 if (baseHomeResource.IsRate)
122 this.listResources.Add(baseHomeResource);
126 baseList2.callbacks = callback2;
127 this.listResources.List(
false);
131 public UIText textName;
134 public UIText textRank;
137 public UIText textWealth;
140 public UIText textHearth;
143 public UIText textPopu;
146 public UIText textInfluence;
149 public UIText textKnowledge;
152 public UIText textHeaderReport;
155 public UIText textReknown;
158 public UIText textKarma;
161 public UIButton buttonHappinessResident;
164 public UIButton buttonHappinessLivestock;
167 public UIList listCurrencies;
170 public UIList listResources;