Elin Decompiled Documentation EA 23.319 Nightly Patch 1
Loading...
Searching...
No Matches
HotItemContext Class Reference
Inheritance diagram for HotItemContext:
HotItem UIButton.Item

Public Member Functions

override void OnHover (UIButton b)
 
override void OnClick (UIButton b)
 
override void OnShowContextMenu (UIContextMenu m)
 
- Public Member Functions inherited from HotItem
string TextHotkey ()
 
virtual void OnClick (ButtonHotItem b, Hotbar h)
 
virtual void OnRightClick (ButtonHotItem b)
 
virtual bool CanAutoFire (Chara tg)
 
virtual void OnSetCurrentItem ()
 
virtual void OnUnsetCurrentItem ()
 
virtual void OnUnselect ()
 
virtual void SetImage (Image icon)
 
virtual bool TrySetAct (ActPlan p)
 
virtual void OnMarkMapHighlights ()
 
virtual void OnRenderTile (Point point, HitResult result, int dir)
 
- Public Member Functions inherited from UIButton.Item
virtual Sprite GetSprite ()
 
virtual Sprite GetSprite (bool highlight)
 
virtual bool ShouldHighlight ()
 
virtual void OnAddedToBar ()
 
virtual void OnShowContextMenu (UIContextMenu m)
 
virtual void OnHover (UIButton b)
 
virtual void OnClick (UIButton b)
 
virtual void OnSetItem (UIButton b)
 
virtual void SetSubText (UIText t)
 

Static Public Member Functions

static void Show (string id, Vector3 pos)
 

Public Attributes

string id
 
bool autoExpand
 
- Public Attributes inherited from HotItem
ButtonHotItem button
 
Hotbar hotbar
 
bool disabled
 
- Public Attributes inherited from UIButton.Item
bool always
 

Properties

override string Name [get]
 
override string TextTip [get]
 
override string pathSprite [get]
 
override Selectable.Transition Transition [get]
 
bool AutoExpand [get]
 
- Properties inherited from HotItem
override Sprite SpriteHighlight [get]
 
override bool IsSelectable [get]
 
override string TextTip [get]
 
virtual Thing RenderThing [get]
 
virtual Thing Thing [get]
 
virtual Thing Tool [get]
 
virtual bool IsTool [get]
 
virtual bool LookAtMouse [get]
 
virtual bool IsGameAction [get]
 
virtual bool UseUIObjMaterial [get]
 
- Properties inherited from UIButton.Item
virtual string TextTip [get]
 
virtual string Name [get]
 
virtual Sprite SpriteHighlight [get]
 
virtual string pathSprite [get]
 
virtual bool IsSelectable [get]
 
virtual bool AdjustImageSize [get]
 
virtual bool UseIconForHighlight [get]
 
virtual bool KeepVisibleWhenHighlighted [get]
 
virtual Color SpriteColor [get]
 
virtual Vector3 SpriteScale [get]
 
virtual bool Hidden [get]
 
virtual Transition Transition [get]
 

Detailed Description

Definition at line 5 of file HotItemContext.cs.

Member Function Documentation

◆ OnClick()

override void HotItemContext.OnClick ( UIButton  b)
inlinevirtual

Reimplemented from UIButton.Item.

Definition at line 51 of file HotItemContext.cs.

52 {
53 if (!EClass.ui.contextMenu.isActive)
54 {
56 }
57 }
Definition: EClass.cs:6
static UI ui
Definition: EClass.cs:17
static void Show(string id, Vector3 pos)
static Vector2 buttonPos
Definition: UIButton.cs:98

References UIButton.buttonPos, Show(), and EClass.ui.

Referenced by OnHover().

◆ OnHover()

override void HotItemContext.OnHover ( UIButton  b)
inlinevirtual

Reimplemented from UIButton.Item.

Definition at line 43 of file HotItemContext.cs.

44 {
45 if (AutoExpand && !EClass.ui.BlockInput)
46 {
47 OnClick(null, null);
48 }
49 }
override void OnClick(UIButton b)

References AutoExpand, OnClick(), and EClass.ui.

◆ OnShowContextMenu()

override void HotItemContext.OnShowContextMenu ( UIContextMenu  m)
inlinevirtual

Reimplemented from UIButton.Item.

Definition at line 59 of file HotItemContext.cs.

60 {
61 m.AddToggle("autoExpand", autoExpand, delegate(bool on)
62 {
63 autoExpand = on;
64 });
65 }
UIContextMenuItem AddToggle(string idLang="", bool isOn=false, UnityAction< bool > action=null)

References UIContextMenu.AddToggle(), and autoExpand.

◆ Show()

static void HotItemContext.Show ( string  id,
Vector3  pos 
)
inlinestatic

Definition at line 67 of file HotItemContext.cs.

68 {
69 string menuName = ((id == "system") ? "ContextSystem" : "ContextMenu");
70 UIContextMenu i = EClass.ui.contextMenu.Create(menuName);
73 bool isRegion = EClass._zone.IsRegion;
74 if (!(id == "mapTool"))
75 {
76 if (id == "system")
77 {
78 UIContextMenu uIContextMenu = i.AddChild("etc");
79 uIContextMenu.AddButton("LayerFeedback".lang() + "(" + EInput.keys.report.key.ToString() + ")", delegate
80 {
81 EClass.ui.ToggleFeedback();
82 });
83 uIContextMenu.AddButton("LayerConsole", delegate
84 {
85 EClass.ui.AddLayer<LayerConsole>();
86 });
87 uIContextMenu.AddButton("LayerCredit", delegate
88 {
89 EClass.ui.AddLayer<LayerCredit>();
90 });
91 uIContextMenu.AddButton("announce", delegate
92 {
93 EClass.ui.AddLayer("LayerAnnounce");
94 });
95 uIContextMenu.AddButton("about", delegate
96 {
97 EClass.ui.AddLayer("LayerAbout");
98 });
99 uIContextMenu.AddButton("hideUI", delegate
100 {
101 SE.ClickGeneral();
102 EClass.ui.ToggleCanvas();
103 });
104 UIContextMenu uIContextMenu2 = i.AddChild("tool");
105 uIContextMenu2.AddButton("LayerMod", delegate
106 {
107 EClass.ui.AddLayer<LayerMod>();
108 });
109 uIContextMenu2.AddButton("LayerTextureViewer", delegate
110 {
111 EClass.ui.AddLayer<LayerTextureViewer>();
112 });
113 uIContextMenu2.AddButton("OpenCustomFolder", delegate
114 {
115 Util.ShowExplorer(CorePath.custom + "Portrait");
116 });
117 if (ModUtil.contextMenuProxies.Count > 0)
118 {
119 UIContextMenu parent2 = i.AddChild("mod");
120 foreach (ContextMenuProxy contextMenuProxy in ModUtil.contextMenuProxies)
121 {
122 PopulateMenu(parent2, contextMenuProxy);
123 }
124 }
125 i.AddSeparator();
126 i.AddButton("help", delegate
127 {
128 LayerHelp.Toggle("general", "1");
129 });
130 i.AddButton("widget", delegate
131 {
132 EClass.ui.AddLayer<LayerWidget>();
133 });
134 i.AddButton("config", delegate
135 {
136 EClass.ui.AddLayer<LayerConfig>();
137 });
138 i.AddButton("worldSetting", delegate
139 {
140 EClass.ui.AddLayer<LayerWorldSetting>();
141 });
142 i.AddSeparator();
143 i.AddButton("LayerHoard", delegate
144 {
145 EClass.ui.AddLayer<LayerHoard>();
146 });
147 i.AddSeparator();
149 {
150 i.AddButton("save", delegate
151 {
152 EClass.game.Save();
153 });
154 i.AddButton("load", delegate
155 {
156 EClass.ui.AddLayer<LayerLoadGame>().Init(_backup: false);
157 });
158 }
159 i.AddSeparator();
160 i.AddButton("title", delegate
161 {
163 });
164 i.AddButton("quit", EClass.game.Quit);
165 i.GetComponent<Image>().SetAlpha(1f);
166 }
167 }
169 {
170 if (EClass.debug.enable)
171 {
172 i.AddButton("Reset Map", delegate
173 {
174 Zone.forceRegenerate = true;
176 });
177 i.AddChild("Map Subset");
178 i.AddSeparator();
179 AddSliderMonth();
180 AddSliderHour();
181 AddSliderWeather();
182 }
183 }
184 else
185 {
186 if (!isRegion && EClass.scene.flock.gameObject.activeSelf)
187 {
188 i.AddButton("birdView", delegate
189 {
191 });
192 }
193 AddTilt();
194 i.AddToggle("highlightArea", conf.highlightArea, delegate
195 {
196 EClass.scene.ToggleHighlightArea();
197 });
198 i.AddToggle("noRoof", conf.noRoof, delegate
199 {
200 EClass.scene.ToggleRoof();
201 });
203 {
204 i.AddSlider("zoomRegion", (float a) => a * (float)CoreConfig.ZoomStep + "%", conf.regionZoom / CoreConfig.ZoomStep, delegate(float b)
205 {
206 conf.regionZoom = (int)b * CoreConfig.ZoomStep;
207 }, 100 / CoreConfig.ZoomStep, 200 / CoreConfig.ZoomStep, isInt: true, hideOther: false);
208 }
209 else if (ActionMode.Adv.zoomOut2)
210 {
211 i.AddSlider("zoomAlt", (float a) => a * (float)CoreConfig.ZoomStep + "%", conf.zoomedZoom / CoreConfig.ZoomStep, delegate(float b)
212 {
213 conf.zoomedZoom = (int)b * CoreConfig.ZoomStep;
214 }, 50 / CoreConfig.ZoomStep, 200 / CoreConfig.ZoomStep, isInt: true, hideOther: false);
215 }
216 else
217 {
218 i.AddSlider("zoom", (float a) => a * (float)CoreConfig.ZoomStep + "%", conf.defaultZoom / CoreConfig.ZoomStep, delegate(float b)
219 {
220 conf.defaultZoom = (int)b * CoreConfig.ZoomStep;
221 }, 50 / CoreConfig.ZoomStep, 200 / CoreConfig.ZoomStep, isInt: true, hideOther: false);
222 }
223 i.AddSlider("backDrawAlpha", (float a) => a + "%", EClass.game.config.backDrawAlpha, delegate(float b)
224 {
225 EClass.game.config.backDrawAlpha = (int)b;
226 }, 0f, 50f, isInt: true, hideOther: false);
227 if (EClass.debug.enable)
228 {
229 i.AddSeparator();
230 AddSliderMonth();
231 i.AddSlider("sliderDay", (float a) => a.ToString() ?? "", EClass.world.date.day, delegate(float b)
232 {
233 if ((int)b != EClass.world.date.day)
234 {
235 EClass.world.date.day = (int)b - 1;
236 EClass.world.date.AdvanceDay();
237 }
240 }, 1f, 30f, isInt: true, hideOther: false);
241 AddSliderHour();
242 AddSliderWeather();
243 i.AddSlider("sliderAnimeSpeed", (float a) => EClass.game.config.animeSpeed + "%", EClass.game.config.animeSpeed, delegate(float b)
244 {
245 EClass.game.config.animeSpeed = (int)b;
246 }, 0f, 100f, isInt: true, hideOther: false);
247 UIContextMenu uIContextMenu3 = i.AddChild("debug");
248 uIContextMenu3.AddToggle("reveal_map", EClass.debug.revealMap, delegate
249 {
251 });
252 uIContextMenu3.AddToggle("test_los", EClass.debug.testLOS, delegate
253 {
254 Toggle(ref EClass.debug.testLOS);
255 });
256 uIContextMenu3.AddToggle("test_los2", EClass.debug.testLOS2, delegate
257 {
258 Toggle(ref EClass.debug.testLOS2);
259 });
260 uIContextMenu3.AddToggle("godBuild", EClass.debug.godBuild, delegate
261 {
262 Toggle(ref EClass.debug._godBuild);
263 });
264 uIContextMenu3.AddToggle("godMode", EClass.debug.godMode, delegate
265 {
266 Toggle(ref EClass.debug.godMode);
267 });
268 uIContextMenu3.AddToggle("autoAdvanceQuest", EClass.debug.autoAdvanceQuest, delegate
269 {
270 Toggle(ref EClass.debug.autoAdvanceQuest);
271 });
272 uIContextMenu3.AddSlider("slopeMod", (float a) => a.ToString() ?? "", conf.slopeMod, delegate(float b)
273 {
274 EClass.game.config.slopeMod = (int)b;
275 (EClass.pc.renderer as CharaRenderer).first = true;
276 }, 0f, 500f, isInt: true, hideOther: false);
277 }
278 }
279 i.Show(pos);
280 if (id == "system")
281 {
282 i.hideOnMouseLeave = false;
283 }
284 void AddSliderHour()
285 {
286 i.AddSlider("sliderTime", (float a) => a.ToString() ?? "", d.hour, delegate(float b)
287 {
289 if (d.hour != (int)b)
290 {
291 d.hour = (int)b - 1;
292 d.AdvanceHour();
293 EClass.world.weather.SetCondition(currentCondition);
294 }
296 EClass._map.RefreshFOV(EClass.pc.pos.x, EClass.pc.pos.z, 20, recalculate: true);
298 }, 0f, 23f, isInt: true, hideOther: false);
299 }
300 void AddSliderMonth()
301 {
302 i.AddSlider("sliderMonth", (float a) => a.ToString() ?? "", EClass.world.date.month, delegate(float b)
303 {
304 if (d.month != (int)b)
305 {
306 d.month = (int)b - 1;
307 d.AdvanceMonth();
308 }
312 EClass.pc.c_daysWithGod += 30;
314 }, 1f, 12f, isInt: true, hideOther: false);
315 }
316 void AddSliderWeather()
317 {
318 i.AddSlider("sliderWeather", (float a) => EClass.world.weather.GetName(((int)a).ToEnum<Weather.Condition>()) ?? "", (float)EClass.world.weather._currentCondition, delegate(float b)
319 {
320 EClass.world.weather.SetCondition(((int)b).ToEnum<Weather.Condition>());
321 }, 0f, 7f, isInt: true, hideOther: false);
322 }
323 void AddTilt()
324 {
325 i.AddToggle("alwaysTilt".lang() + (isRegion ? "(Region)" : ""), isRegion ? conf.tiltRegion : conf.tilt, delegate
326 {
327 EClass.scene.ToggleTilt();
328 });
329 i.AddSlider("tiltPower", (float a) => a.ToString() ?? "", isRegion ? conf.tiltPowerRegion : conf.tiltPower, delegate(float b)
330 {
331 if (isRegion)
332 {
333 conf.tiltPowerRegion = (int)b;
334 }
335 else
336 {
337 conf.tiltPower = (int)b;
338 }
339 EClass.scene.camSupport.tiltShift.blurArea = 0.1f * b;
340 }, 0f, 150f, isInt: true, hideOther: false);
341 }
342 static void PopulateMenu(UIContextMenu parent, ContextMenuProxy proxy)
343 {
344 if (proxy.isMenu)
345 {
346 UIContextMenu parent3 = parent.AddChild(proxy.DisplayName);
347 {
348 foreach (ContextMenuProxy child in proxy.children)
349 {
350 PopulateMenu(parent3, child);
351 }
352 return;
353 }
354 }
355 parent.AddButton(proxy.DisplayName, proxy.onClick);
356 }
357 static void Toggle(ref bool flag)
358 {
359 flag = !flag;
362 SE.ClickGeneral();
363 }
364 }
bool zoomOut2
Definition: AM_Adv.cs:106
virtual bool IsBuildMode
Definition: ActionMode.cs:181
static AM_Adv Adv
Definition: ActionMode.cs:15
int c_daysWithGod
Definition: Card.cs:1513
Point pos
Definition: Card.cs:60
void RefreshFaithElement()
Definition: Chara.cs:10603
Religion faith
Definition: Chara.cs:443
readonly List< ContextMenuProxy > children
static int ZoomStep
Definition: CoreConfig.cs:647
bool godMode
Definition: CoreDebug.cs:188
void ToggleRevealMap()
Definition: CoreDebug.cs:2491
bool _godBuild
Definition: CoreDebug.cs:194
bool revealMap
Definition: CoreDebug.cs:169
bool enable
Definition: CoreDebug.cs:301
bool testLOS2
Definition: CoreDebug.cs:165
bool godBuild
Definition: CoreDebug.cs:319
bool autoAdvanceQuest
Definition: CoreDebug.cs:226
bool testLOS
Definition: CoreDebug.cs:163
static string custom
Definition: CorePath.cs:159
Game game
Definition: Core.cs:72
int hour
Definition: Date.cs:74
int month
Definition: Date.cs:50
int day
Definition: Date.cs:62
static Game game
Definition: EClass.cs:9
static Scene scene
Definition: EClass.cs:31
static Core core
Definition: EClass.cs:7
static Zone _zone
Definition: EClass.cs:21
static World world
Definition: EClass.cs:41
static Map _map
Definition: EClass.cs:19
static BaseGameScreen screen
Definition: EClass.cs:33
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
static CoreDebug debug
Definition: EClass.cs:49
KeyCode key
Definition: EInput.cs:14
Definition: EInput.cs:8
static KeyMapManager keys
Definition: EInput.cs:378
bool disableManualSave
int slopeMod
Definition: Game.cs:61
bool tilt
Definition: Game.cs:19
int animeSpeed
Definition: Game.cs:85
int regionZoom
Definition: Game.cs:70
bool noRoof
Definition: Game.cs:28
int defaultZoom
Definition: Game.cs:64
bool highlightArea
Definition: Game.cs:40
int zoomedZoom
Definition: Game.cs:67
int tiltPower
Definition: Game.cs:73
int backDrawAlpha
Definition: Game.cs:82
int tiltPowerRegion
Definition: Game.cs:76
bool tiltRegion
Definition: Game.cs:22
GamePrincipal principal
Definition: Game.cs:225
void GotoTitle(bool showDialog=true)
Definition: Game.cs:1011
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1040
new World world
Definition: Game.cs:177
Config config
Definition: Game.cs:219
void Quit()
Definition: Game.cs:1029
void ResetHotbar(int id)
Definition: HotbarManager.cs:8
static void Toggle(string idFile, string idTopic=null)
Definition: LayerHelp.cs:32
void RefreshFOV(int x, int z, int radius=6, bool recalculate=false)
Definition: Map.cs:942
void RefreshAllTiles()
Definition: Map.cs:2153
int holyWell
Definition: Player.cs:984
HotbarManager hotbars
Definition: Player.cs:1152
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
virtual void OnChangeHour()
Definition: Religion.cs:509
void ToggleBirdView(bool sound=true)
Definition: Scene.cs:961
ActionMode actionMode
Definition: Scene.cs:79
FlockController flock
Definition: Scene.cs:69
virtual bool IsRegion
Definition: Spatial.cs:515
void AddSeparator(int index=0)
void Show(UIItem i)
UIContextMenuItem AddSlider(string text, Func< float, string > textFunc, float value, Action< float > action, float min=0f, float max=1f, bool isInt=false, bool hideOther=true, bool useInput=false)
void AddButton(Func< string > funcText, UnityAction action=null)
UIContextMenu AddChild(string idLang, TextAnchor anchor)
Definition: Util.cs:10
static void ShowExplorer(string itemPath, bool selectFirstFile=false)
Definition: Util.cs:228
string GetName()
Definition: Weather.cs:158
void SetCondition(Condition condition, int _duration=20, bool silent=false)
Definition: Weather.cs:308
Condition _currentCondition
Definition: Weather.cs:67
Condition
Definition: Weather.cs:16
static void OnChangeMode()
GameDate date
Definition: World.cs:6
Weather weather
Definition: World.cs:12
void Activate()
Definition: Zone.cs:632

References EClass._map, EClass._zone, Scene.actionMode, Zone.Activate(), UIContextMenu.AddButton(), UIContextMenu.AddChild(), UIContextMenu.AddSeparator(), UIContextMenu.AddSlider(), UIContextMenu.AddToggle(), ActionMode.Adv, Game.Config.animeSpeed, Game.Config.backDrawAlpha, Game.config, EClass.core, CorePath.custom, World.date, Date.day, EClass.debug, Game.Config.defaultZoom, GamePrincipal.disableManualSave, CoreDebug.enable, Scene.flock, Core.game, EClass.game, Game.GotoTitle(), Game.Config.highlightArea, ActionMode.IsBuildMode, Spatial.IsRegion, EInput.KeyMap.key, EInput.keys, Game.Config.noRoof, Game.principal, Game.Quit(), BaseGameScreen.RefreshAll(), Map.RefreshAllTiles(), Game.Config.regionZoom, EInput.KeyMapManager.report, CoreDebug.revealMap, Game.Save(), EClass.scene, EClass.screen, CoreDebug.testLOS, CoreDebug.testLOS2, LayerHelp.Toggle(), Scene.ToggleBirdView(), CoreDebug.ToggleRevealMap(), EClass.ui, Util, EClass.world, Game.world, Game.Config.zoomedZoom, AM_Adv.zoomOut2, and CoreConfig.ZoomStep.

Referenced by OnClick(), and AM_BaseGameMode.OnUpdateInput().

Member Data Documentation

◆ autoExpand

bool HotItemContext.autoExpand

Definition at line 11 of file HotItemContext.cs.

Referenced by OnShowContextMenu().

◆ id

string HotItemContext.id

Definition at line 8 of file HotItemContext.cs.

Property Documentation

◆ AutoExpand

bool HotItemContext.AutoExpand
get

Definition at line 41 of file HotItemContext.cs.

Referenced by OnHover().

◆ Name

override string HotItemContext.Name
get

Definition at line 13 of file HotItemContext.cs.

◆ pathSprite

override string HotItemContext.pathSprite
get

Definition at line 17 of file HotItemContext.cs.

18 {
19 get
20 {
21 if (!(id == "system"))
22 {
23 return "icon_" + id;
24 }
25 return "icon_m_system";
26 }
27 }

◆ TextTip

override string HotItemContext.TextTip
get

Definition at line 15 of file HotItemContext.cs.

◆ Transition

override Selectable.Transition HotItemContext.Transition
get

Definition at line 29 of file HotItemContext.cs.

30 {
31 get
32 {
33 if (!AutoExpand)
34 {
35 return base.Transition;
36 }
37 return Selectable.Transition.None;
38 }
39 }

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