9 public override bool HeaderIsListOf(
int id)
15 public override void OnInit()
17 this.branch =
ELayer.Branch;
18 LayerHome.Instance =
this;
22 public override void OnSwitchContent(Window window)
24 if (window.setting.tabs.Count == 0)
28 WindowMenu menuLeft = window.menuLeft;
30 if (
ELayer.player.shippingResults.Count > 0)
32 menuLeft.AddButtonSimple(() =>
"shipping_result".lang(), delegate(UIButton a)
37 string idLang = window.CurrentTab.idLang;
43 if (!(idLang ==
"skills"))
45 if (!(idLang ==
"population"))
47 if (!(idLang ==
"chronicle"))
51 this.RefreshChronicle();
59 public void RefreshChronicle()
64 public void RefreshTech(
bool listComplete =
false)
66 UIList list = listComplete ? this.listTech2 : this.listTech;
67 list.sortMode =
ELayer.player.pref.sortResearch;
68 BaseList list2 = list;
73 callback.onList = delegate(UIList.SortMode m)
75 foreach (
ResearchPlan o
in (listComplete ? this.branch.researches.finished :
this.branch.researches.plans))
80 callback.onSort = ((
ResearchPlan a, UIList.SortMode m) => a.GetSortVal(m));
81 list2.callbacks = callback;
87 public void RefreshFocus()
91 itemResearch.goFocus.SetActive(itemResearch.plan ==
this.branch.researches.focused);
96 public void RefreshFeat()
98 BaseList baseList = this.listFeat;
102 int p =
ELayer.Branch.GetTechUpgradeCost(a);
103 int currency =
ELayer.pc.GetCurrency(
"money2");
104 if (p == 0 || p > currency || a.ValueWithoutLink == 0 || a.source.cost[0] == 0)
109 Dialog.YesNo(
"dialogUpgradeTech".lang(a.Name,
null,
null,
null,
null), delegate
112 ELayer.pc.ModCurrency(-p,
"money2");
113 ELayer.Branch.elements.ModBase(a.id, 1);
114 this.listFeat.List(false);
115 ELayer.Branch.resources.SetDirty();
116 ELayer.core.game.player.hotbars.ResetHotbar(2);
117 if (WidgetHotbar.HotBarMainMenu)
119 WidgetHotbar.HotBarMainMenu.RebuildPage(-1);
123 WidgetMenuPanel.Instance.OnChangeActionMode();
125 },
null,
"yes",
"no");
131 callback.onList = delegate(UIList.SortMode m)
133 foreach (
Element o
in from b
in this.branch.elements.dict.Values
134 where (b.Value > 0 || b.vBase > 0) && b.source.category !=
"policy" && b.source.category !=
"landfeat" && !b.HasTag(
"hidden")
137 this.listFeat.Add(o);
140 callback.onSort = ((
Element a, UIList.SortMode m) => a.GetSortVal(m));
141 callback.onRefresh =
null;
142 baseList.callbacks = callback;
143 this.listFeat.List(
false);
144 BaseList baseList2 = this.listFeat2;
153 callback2.onList = delegate(UIList.SortMode m)
155 foreach (
Element o
in from b
in this.branch.elements.dict.Values
156 where b.source.category ==
"policy"
159 this.listFeat2.Add(o);
162 callback2.onSort = ((
Element a, UIList.SortMode m) => a.GetSortVal(m));
163 callback2.onRefresh =
null;
164 baseList2.callbacks = callback2;
165 this.listFeat2.List(
false);
166 BaseList baseList3 = this.listFeat3;
175 callback3.onList = delegate(UIList.SortMode m)
177 IEnumerable<Element> enumerable = this.branch.elements.dict.Values;
178 if (this.branch.HasNetwork)
180 enumerable = enumerable.Concat(
ELayer.pc.faction.elements.dict.Values);
182 foreach (
Element o
in from b
in enumerable
183 where (b.Value > 0 || b.vBase > 0) && b.source.category ==
"landfeat" && !b.HasTag(
"hidden")
186 this.listFeat3.Add(o);
189 callback3.onSort = ((
Element a, UIList.SortMode m) => a.GetSortVal(m));
190 callback3.onRefresh =
null;
191 baseList3.callbacks = callback3;
192 this.listFeat3.List(
false);
196 public void RefreshAreas()
198 BaseList baseList = this.listArea;
205 UIButton button = b.button1;
206 b.SetMainText(a.Name,
null,
true);
207 b.AddSubButton(
ELayer.core.refs.icons.go, delegate
209 ELayer.screen.Focus(a.points[0]);
213 callback.onList = delegate(UIList.SortMode m)
215 foreach (
Area o
in ELayer._map.rooms.listArea)
217 this.listArea.Add(o);
220 callback.onSort = ((
Area a, UIList.SortMode m) => a.GetSortVal(m));
221 callback.onRefresh =
null;
222 baseList.callbacks = callback;
223 this.listArea.List(
false);
227 public void RefreshSpots()
229 this.listArea.Clear();
230 BaseList baseList = this.listArea;
237 UIButton button = b.button1;
238 b.SetMainText(a.Name,
null,
true);
239 b.AddSubButton(
ELayer.core.refs.icons.go, delegate
241 ELayer.screen.Focus(a.GetPoint());
245 callback.onList = delegate(UIList.SortMode m)
247 foreach (
Card card
in ELayer._map.Installed.all.Values)
249 if (card.trait.IsSpot)
251 this.listArea.Add(card.trait);
255 callback.onSort = ((
Trait a, UIList.SortMode m) => a.GetSortVal(m));
256 callback.onRefresh =
null;
257 baseList.callbacks = callback;
258 this.listArea.List(
false);
265 public UIList listArea;
268 public UIList listTech;
271 public UIList listTech2;
274 public UIList listFeat;
277 public UIList listFeat2;
280 public UIList listFeat3;
289 public const int TabResearch = 1;
292 public const int TabPolicy = 2;
295 public const int TabPopulation = 3;
298 public const int TabFeat = 4;