Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
HotbarManager Class Reference
Inheritance diagram for HotbarManager:
EClass

Public Member Functions

void ResetHotbar (int id)
 
Hotbar SetHobar (int id, int slots, WidgetHotbar actor=null)
 
void OnCreateGame ()
 

Public Attributes

Hotbar[] bars = new Hotbar[8]
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Static Public Attributes inherited from EClass
static Core core
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 3 of file HotbarManager.cs.

Member Function Documentation

◆ OnCreateGame()

void HotbarManager.OnCreateGame ( )
inline

Definition at line 251 of file HotbarManager.cs.

252 {
253 ResetHotbar(0);
254 ResetHotbar(1);
255 ResetHotbar(2);
256 ResetHotbar(3);
257 ResetHotbar(4);
258 ResetHotbar(5);
259 ResetHotbar(6);
260 ResetHotbar(7);
261 }
void ResetHotbar(int id)
Definition: HotbarManager.cs:8

References ResetHotbar().

Referenced by Player.OnCreateGame().

◆ ResetHotbar()

void HotbarManager.ResetHotbar ( int  id)
inline

Definition at line 8 of file HotbarManager.cs.

9 {
10 WidgetHotbar widgetHotbar = bars[id]?.actor ?? null;
11 Hotbar hotbar = null;
12 switch (id)
13 {
14 case 0:
15 hotbar = SetHobar(0, 4);
16 break;
17 case 1:
18 hotbar = SetHobar(1, 4);
19 hotbar.SetItem(new HotItemContext
20 {
21 id = "system"
22 }, 0);
23 hotbar.SetItem(new HotItemToggleLog(), 1);
24 hotbar.SetItem(new HotItemContext
25 {
26 id = "mapTool"
27 }, 2);
28 hotbar.SetItem(new HotItemToggleWidget(), 3);
29 break;
30 case 2:
31 hotbar = SetHobar(2, 7);
32 hotbar.SetItem(new HotItemLayer
33 {
34 id = "stash"
35 });
36 hotbar.SetItem(new HotItemLayer
37 {
38 id = "LayerAbility"
39 });
40 hotbar.SetItem(new HotItemLayer
41 {
42 id = "LayerChara"
43 });
44 hotbar.SetItem(new HotItemLayer
45 {
46 id = "LayerJournal"
47 });
49 {
50 hotbar.SetItem(new HotItemActionMode
51 {
52 id = "Inspect"
53 });
54 }
56 {
57 hotbar.SetItem(new HotItemLayer
58 {
59 id = "LayerTravel"
60 });
61 }
62 break;
63 case 3:
64 {
65 hotbar = SetHobar(3, 12);
67 {
68 return;
69 }
70 bool flag = EClass.debug.godBuild || EClass.debug.ignoreBuildRule;
71 if (flag || EClass.Branch != null)
72 {
73 if (flag || EClass.Branch.elements.Has(4006))
74 {
75 hotbar.SetItem(new HotItemActionMode
76 {
77 id = "Inspect"
78 }).always = true;
79 }
80 if (flag || EClass.Branch.elements.Has(4000))
81 {
82 hotbar.SetItem(new HotItemActionMode
83 {
84 id = "Cut"
85 });
86 }
87 if (flag || EClass.Branch.elements.Has(4001))
88 {
89 hotbar.SetItem(new HotItemActionMode
90 {
91 id = "Mine"
92 });
93 }
94 if (flag || EClass.Branch.elements.Has(4001))
95 {
96 hotbar.SetItem(new HotItemActionMode
97 {
98 id = "Dig"
99 });
100 }
101 if (flag || EClass.Branch.elements.Has(4002))
102 {
103 hotbar.SetItem(new HotItemActionMode
104 {
105 id = "Terrain"
106 });
107 }
108 if (flag)
109 {
110 hotbar.SetItem(new HotItemActionMode
111 {
112 id = "Copy"
113 });
114 }
115 if (flag)
116 {
117 hotbar.SetItem(new HotItemActionMode
118 {
119 id = "Populate"
120 });
121 }
122 if (flag || EClass.Branch.elements.Has(4004))
123 {
124 hotbar.SetItem(new HotItemActionMode
125 {
126 id = "Deconstruct"
127 });
128 }
129 }
130 else if (EClass._zone is Zone_Tent)
131 {
132 hotbar.SetItem(new HotItemActionMode
133 {
134 id = "Terrain"
135 });
136 }
137 hotbar.SetItem(new HotItemActionMode
138 {
139 id = "ExitBuild"
140 });
141 break;
142 }
143 case 4:
144 hotbar = SetHobar(4, 9);
146 {
147 return;
148 }
149 if (EClass.debug.godBuild || EClass.Branch != null)
150 {
151 hotbar.SetItem(new HotItemActionMode
152 {
153 id = "Cinema"
154 });
155 hotbar.SetItem(new HotItemActionMode
156 {
157 id = "FlagCell"
158 });
160 {
161 hotbar.SetItem(new HotItemActionMode
162 {
163 id = "Visibility"
164 });
165 }
167 {
168 hotbar.SetItem(new HotItemActionMode
169 {
170 id = "EditMarker"
171 });
172 }
174 {
175 hotbar.SetItem(new HotItemActionMode
176 {
177 id = "Picker"
178 });
179 }
181 {
182 hotbar.SetItem(new HotItemContext
183 {
184 id = "mapTool",
185 autoExpand = false
186 });
187 }
188 }
189 break;
190 case 5:
191 hotbar = SetHobar(5, 9);
192 hotbar.SetItem(new HotItemLayer
193 {
194 id = "LayerHelp"
195 }, 0);
196 hotbar.SetItem(new HotItemWidget
197 {
198 id = "Codex"
199 }, 1);
200 hotbar.SetItem(new HotItemWidget
201 {
202 id = "Memo"
203 }, 2);
204 hotbar.SetItem(new HotItemWidget
205 {
206 id = "QuestTracker"
207 }, 3);
208 hotbar.SetItem(new HotItemActionSleep(), 4);
209 break;
210 case 6:
211 hotbar = SetHobar(6, 9);
212 break;
213 case 7:
214 hotbar = SetHobar(7, 7);
215 hotbar.SetItem(new HotItemToggle
216 {
217 type = HotItemToggle.Type.SnapFreepos
218 });
219 hotbar.SetItem(new HotItemToggle
220 {
221 type = HotItemToggle.Type.ToggleRoof
222 });
223 hotbar.SetItem(new HotItemToggle
224 {
225 type = HotItemToggle.Type.ToggleSlope
226 });
227 hotbar.SetItem(new HotItemToggle
228 {
229 type = HotItemToggle.Type.ToggleBuildLight
230 });
231 break;
232 }
233 hotbar.actor = widgetHotbar;
234 if ((bool)widgetHotbar)
235 {
236 widgetHotbar.Rebuild();
237 }
238 }
bool godBuild
Definition: CoreDebug.cs:303
bool ignoreBuildRule
Definition: CoreDebug.cs:184
bool IsGameStarted
Definition: Core.cs:84
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6
static Zone _zone
Definition: EClass.cs:20
static FactionBranch Branch
Definition: EClass.cs:22
static CoreDebug debug
Definition: EClass.cs:48
bool Has(int ele)
ElementContainerZone elements
Hotbar[] bars
Definition: HotbarManager.cs:6
Hotbar SetHobar(int id, int slots, WidgetHotbar actor=null)
Definition: Hotbar.cs:5
HotItem SetItem(HotItem item, int index=-1, int pageIndex=-1, bool refreshActor=false)
Definition: Hotbar.cs:173
WidgetHotbar actor
Definition: Hotbar.cs:91
virtual bool IsRegion
Definition: Spatial.cs:501
void Rebuild()
bool CanEnterBuildModeAnywhere
Definition: Zone.cs:449

References EClass._zone, Hotbar.actor, bars, EClass.Branch, Zone.CanEnterBuildModeAnywhere, EClass.core, EClass.debug, FactionBranch.elements, CoreDebug.godBuild, ElementContainer.Has(), CoreDebug.ignoreBuildRule, Core.IsGameStarted, Spatial.IsRegion, WidgetHotbar.Rebuild(), SetHobar(), and Hotbar.SetItem().

Referenced by Scene.Init(), OnCreateGame(), WidgetHotbar.OnSetContextMenu(), BuildMenu.Toggle(), and CoreDebug.UpdateInput().

◆ SetHobar()

Hotbar HotbarManager.SetHobar ( int  id,
int  slots,
WidgetHotbar  actor = null 
)
inline

Definition at line 240 of file HotbarManager.cs.

241 {
242 Hotbar hotbar = new Hotbar();
243 hotbar.itemsPerPage = slots;
244 bars[id] = hotbar;
245 hotbar.AddPage();
246 hotbar.AddPage();
247 hotbar.id = id;
248 return hotbar;
249 }
void AddPage()
Definition: Hotbar.cs:126

References Hotbar.AddPage(), and bars.

Referenced by ResetHotbar().

Member Data Documentation

◆ bars

Hotbar [] HotbarManager.bars = new Hotbar[8]

Definition at line 6 of file HotbarManager.cs.

Referenced by ResetHotbar(), SetHobar(), and BuildMenu.Toggle().


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