Elin Decompiled Documentation EA 23.102 Nightly
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:5
static UI ui
Definition: EClass.cs:16
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 i.AddSeparator();
118 i.AddButton("help", delegate
119 {
120 LayerHelp.Toggle("general", "1");
121 });
122 i.AddButton("widget", delegate
123 {
124 EClass.ui.AddLayer<LayerWidget>();
125 });
126 i.AddButton("config", delegate
127 {
128 EClass.ui.AddLayer<LayerConfig>();
129 });
130 i.AddButton("worldSetting", delegate
131 {
132 EClass.ui.AddLayer<LayerWorldSetting>();
133 });
134 i.AddSeparator();
135 i.AddButton("LayerHoard", delegate
136 {
137 EClass.ui.AddLayer<LayerHoard>();
138 });
139 i.AddSeparator();
141 {
142 i.AddButton("save", delegate
143 {
144 EClass.game.Save();
145 });
146 i.AddButton("load", delegate
147 {
148 EClass.ui.AddLayer<LayerLoadGame>().Init(_backup: false);
149 });
150 }
151 i.AddSeparator();
152 i.AddButton("title", delegate
153 {
155 });
156 i.AddButton("quit", EClass.game.Quit);
157 i.GetComponent<Image>().SetAlpha(1f);
158 }
159 }
161 {
162 if (EClass.debug.enable)
163 {
164 i.AddButton("Reset Map", delegate
165 {
166 Zone.forceRegenerate = true;
168 });
169 i.AddChild("Map Subset");
170 i.AddSeparator();
171 AddSliderMonth();
172 AddSliderHour();
173 AddSliderWeather();
174 }
175 }
176 else
177 {
178 if (!isRegion && EClass.scene.flock.gameObject.activeSelf)
179 {
180 i.AddButton("birdView", delegate
181 {
183 });
184 }
185 AddTilt();
186 i.AddToggle("highlightArea", conf.highlightArea, delegate
187 {
188 EClass.scene.ToggleHighlightArea();
189 });
190 i.AddToggle("noRoof", conf.noRoof, delegate
191 {
192 EClass.scene.ToggleRoof();
193 });
195 {
196 i.AddSlider("zoomRegion", (float a) => a * (float)CoreConfig.ZoomStep + "%", conf.regionZoom / CoreConfig.ZoomStep, delegate(float b)
197 {
198 conf.regionZoom = (int)b * CoreConfig.ZoomStep;
199 }, 100 / CoreConfig.ZoomStep, 200 / CoreConfig.ZoomStep, isInt: true, hideOther: false);
200 }
201 else if (ActionMode.Adv.zoomOut2)
202 {
203 i.AddSlider("zoomAlt", (float a) => a * (float)CoreConfig.ZoomStep + "%", conf.zoomedZoom / CoreConfig.ZoomStep, delegate(float b)
204 {
205 conf.zoomedZoom = (int)b * CoreConfig.ZoomStep;
206 }, 50 / CoreConfig.ZoomStep, 200 / CoreConfig.ZoomStep, isInt: true, hideOther: false);
207 }
208 else
209 {
210 i.AddSlider("zoom", (float a) => a * (float)CoreConfig.ZoomStep + "%", conf.defaultZoom / CoreConfig.ZoomStep, delegate(float b)
211 {
212 conf.defaultZoom = (int)b * CoreConfig.ZoomStep;
213 }, 50 / CoreConfig.ZoomStep, 200 / CoreConfig.ZoomStep, isInt: true, hideOther: false);
214 }
215 i.AddSlider("backDrawAlpha", (float a) => a + "%", EClass.game.config.backDrawAlpha, delegate(float b)
216 {
217 EClass.game.config.backDrawAlpha = (int)b;
218 }, 0f, 50f, isInt: true, hideOther: false);
219 if (EClass.debug.enable)
220 {
221 i.AddSeparator();
222 AddSliderMonth();
223 i.AddSlider("sliderDay", (float a) => a.ToString() ?? "", EClass.world.date.day, delegate(float b)
224 {
225 if ((int)b != EClass.world.date.day)
226 {
227 EClass.world.date.day = (int)b - 1;
228 EClass.world.date.AdvanceDay();
229 }
232 }, 1f, 30f, isInt: true, hideOther: false);
233 AddSliderHour();
234 AddSliderWeather();
235 i.AddSlider("sliderAnimeSpeed", (float a) => EClass.game.config.animeSpeed + "%", EClass.game.config.animeSpeed, delegate(float b)
236 {
237 EClass.game.config.animeSpeed = (int)b;
238 }, 0f, 100f, isInt: true, hideOther: false);
239 UIContextMenu uIContextMenu3 = i.AddChild("debug");
240 uIContextMenu3.AddToggle("reveal_map", EClass.debug.revealMap, delegate
241 {
243 });
244 uIContextMenu3.AddToggle("test_los", EClass.debug.testLOS, delegate
245 {
246 Toggle(ref EClass.debug.testLOS);
247 });
248 uIContextMenu3.AddToggle("test_los2", EClass.debug.testLOS2, delegate
249 {
250 Toggle(ref EClass.debug.testLOS2);
251 });
252 uIContextMenu3.AddToggle("godBuild", EClass.debug.godBuild, delegate
253 {
254 Toggle(ref EClass.debug._godBuild);
255 });
256 uIContextMenu3.AddToggle("godMode", EClass.debug.godMode, delegate
257 {
258 Toggle(ref EClass.debug.godMode);
259 });
260 uIContextMenu3.AddToggle("autoAdvanceQuest", EClass.debug.autoAdvanceQuest, delegate
261 {
262 Toggle(ref EClass.debug.autoAdvanceQuest);
263 });
264 uIContextMenu3.AddSlider("slopeMod", (float a) => a.ToString() ?? "", conf.slopeMod, delegate(float b)
265 {
266 EClass.game.config.slopeMod = (int)b;
267 (EClass.pc.renderer as CharaRenderer).first = true;
268 }, 0f, 500f, isInt: true, hideOther: false);
269 }
270 }
271 i.Show(pos);
272 if (id == "system")
273 {
274 i.hideOnMouseLeave = false;
275 }
276 void AddSliderHour()
277 {
278 i.AddSlider("sliderTime", (float a) => a.ToString() ?? "", d.hour, delegate(float b)
279 {
281 if (d.hour != (int)b)
282 {
283 d.hour = (int)b - 1;
284 d.AdvanceHour();
285 EClass.world.weather.SetCondition(currentCondition);
286 }
288 EClass._map.RefreshFOV(EClass.pc.pos.x, EClass.pc.pos.z, 20, recalculate: true);
290 }, 0f, 23f, isInt: true, hideOther: false);
291 }
292 void AddSliderMonth()
293 {
294 i.AddSlider("sliderMonth", (float a) => a.ToString() ?? "", EClass.world.date.month, delegate(float b)
295 {
296 if (d.month != (int)b)
297 {
298 d.month = (int)b - 1;
299 d.AdvanceMonth();
300 }
304 EClass.pc.c_daysWithGod += 30;
306 }, 1f, 12f, isInt: true, hideOther: false);
307 }
308 void AddSliderWeather()
309 {
310 i.AddSlider("sliderWeather", (float a) => EClass.world.weather.GetName(((int)a).ToEnum<Weather.Condition>()) ?? "", (float)EClass.world.weather._currentCondition, delegate(float b)
311 {
312 EClass.world.weather.SetCondition(((int)b).ToEnum<Weather.Condition>());
313 }, 0f, 7f, isInt: true, hideOther: false);
314 }
315 void AddTilt()
316 {
317 i.AddToggle("alwaysTilt".lang() + (isRegion ? "(Region)" : ""), isRegion ? conf.tiltRegion : conf.tilt, delegate
318 {
319 EClass.scene.ToggleTilt();
320 });
321 i.AddSlider("tiltPower", (float a) => a.ToString() ?? "", isRegion ? conf.tiltPowerRegion : conf.tiltPower, delegate(float b)
322 {
323 if (isRegion)
324 {
325 conf.tiltPowerRegion = (int)b;
326 }
327 else
328 {
329 conf.tiltPower = (int)b;
330 }
331 EClass.scene.camSupport.tiltShift.blurArea = 0.1f * b;
332 }, 0f, 150f, isInt: true, hideOther: false);
333 }
334 static void Toggle(ref bool flag)
335 {
336 flag = !flag;
339 SE.ClickGeneral();
340 }
341 }
bool zoomOut2
Definition: AM_Adv.cs:105
virtual bool IsBuildMode
Definition: ActionMode.cs:181
static AM_Adv Adv
Definition: ActionMode.cs:15
int c_daysWithGod
Definition: Card.cs:1397
Point pos
Definition: Card.cs:55
void RefreshFaithElement()
Definition: Chara.cs:9166
Religion faith
Definition: Chara.cs:424
static int ZoomStep
Definition: CoreConfig.cs:626
bool godMode
Definition: CoreDebug.cs:172
void ToggleRevealMap()
Definition: CoreDebug.cs:2260
bool _godBuild
Definition: CoreDebug.cs:178
bool revealMap
Definition: CoreDebug.cs:153
bool enable
Definition: CoreDebug.cs:285
bool testLOS2
Definition: CoreDebug.cs:149
bool godBuild
Definition: CoreDebug.cs:303
bool autoAdvanceQuest
Definition: CoreDebug.cs:210
bool testLOS
Definition: CoreDebug.cs:147
static string custom
Definition: CorePath.cs:163
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:8
static Scene scene
Definition: EClass.cs:30
static Core core
Definition: EClass.cs:6
static Zone _zone
Definition: EClass.cs:20
static World world
Definition: EClass.cs:40
static Map _map
Definition: EClass.cs:18
static BaseGameScreen screen
Definition: EClass.cs:32
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
KeyCode key
Definition: EInput.cs:14
Definition: EInput.cs:8
static KeyMapManager keys
Definition: EInput.cs:367
bool disableManualSave
int slopeMod
Definition: Game.cs:60
bool tilt
Definition: Game.cs:18
int animeSpeed
Definition: Game.cs:84
int regionZoom
Definition: Game.cs:69
bool noRoof
Definition: Game.cs:27
int defaultZoom
Definition: Game.cs:63
bool highlightArea
Definition: Game.cs:39
int zoomedZoom
Definition: Game.cs:66
int tiltPower
Definition: Game.cs:72
int backDrawAlpha
Definition: Game.cs:81
int tiltPowerRegion
Definition: Game.cs:75
bool tiltRegion
Definition: Game.cs:21
GamePrincipal principal
Definition: Game.cs:221
void GotoTitle(bool showDialog=true)
Definition: Game.cs:931
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:960
new World world
Definition: Game.cs:173
Config config
Definition: Game.cs:215
void Quit()
Definition: Game.cs:949
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:923
void RefreshAllTiles()
Definition: Map.cs:2086
int holyWell
Definition: Player.cs:724
HotbarManager hotbars
Definition: Player.cs:886
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
void OnChangeHour()
Definition: Religion.cs:537
void ToggleBirdView(bool sound=true)
Definition: Scene.cs:942
ActionMode actionMode
Definition: Scene.cs:77
FlockController flock
Definition: Scene.cs:67
virtual bool IsRegion
Definition: Spatial.cs:501
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:577

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: