DayZ 1.24
Loading...
Searching...
No Matches
OptionsMenu.c
Go to the documentation of this file.
1class OptionsMenu extends UIScriptedMenu
2{
3 const int MODAL_ID_DEFAULT = 100;
4 const int DIALOG_TAB_OFFSET = 1400;
5
6 protected TabberUI m_Tabber;
7 protected ref OptionsMenuGame m_GameTab;
8 protected ref OptionsMenuSounds m_SoundsTab;
9 protected ref OptionsMenuVideo m_VideoTab;
10 protected ref OptionsMenuControls m_ControlsTab;
11
13
14 protected ButtonWidget m_Apply;
15 protected ButtonWidget m_Back;
16 protected ButtonWidget m_Reset; //undo
17 protected ButtonWidget m_Defaults; //defaults
18
19 protected Widget m_Details;
20 protected TextWidget m_Version;
21
22 protected int m_ActiveTabIdx = 0;
23 protected bool m_ModalLock;
24 protected bool m_CanApplyOrReset;
25 protected bool m_CanToggle;
26
28 {
29
30 }
31
32 override Widget Init()
33 {
34 m_Options = new GameOptions();
35
36#ifdef PLATFORM_XBOX
37 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/options/xbox/options_menu.layout", null);
38#else
39#ifdef PLATFORM_PS4
40 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/options/ps/options_menu.layout", null);
41#else
42#ifdef PLATFORM_WINDOWS
43 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/options/pc/options_menu.layout", null);
44#endif
45#endif
46#endif
47
48 layoutRoot.FindAnyWidget("Tabber").GetScript(m_Tabber);
49
50 m_Details = layoutRoot.FindAnyWidget("settings_details");
51 m_Version = TextWidget.Cast(layoutRoot.FindAnyWidget("version"));
52
53 m_GameTab = new OptionsMenuGame(layoutRoot.FindAnyWidget("Tab_0"), m_Details, m_Options, this);
54 m_SoundsTab = new OptionsMenuSounds(layoutRoot.FindAnyWidget("Tab_1"), m_Details, m_Options, this);
55
56#ifdef PLATFORM_XBOX
57 m_ControlsTab = new OptionsMenuControls(layoutRoot.FindAnyWidget("Tab_2"), m_Details, m_Options, this);
58#else
59 m_VideoTab = new OptionsMenuVideo(layoutRoot.FindAnyWidget("Tab_2"), m_Details, m_Options, this);
60 m_ControlsTab = new OptionsMenuControls(layoutRoot.FindAnyWidget("Tab_3"), m_Details, m_Options, this);
61#endif
62
63 m_Apply = ButtonWidget.Cast(layoutRoot.FindAnyWidget("apply"));
64 m_Back = ButtonWidget.Cast(layoutRoot.FindAnyWidget("back"));
65 m_Reset = ButtonWidget.Cast(layoutRoot.FindAnyWidget("reset"));
66 m_Defaults = ButtonWidget.Cast(layoutRoot.FindAnyWidget("defaults"));
67
68 m_ModalLock = false;
69 m_CanApplyOrReset = false;
70 m_CanToggle = false;
71
72 string version;
73 GetGame().GetVersion(version);
74#ifdef PLATFORM_CONSOLE
75 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
76#else
77 version = "#main_menu_version" + " " + version;
78#endif
79 m_Version.SetText(version);
80
81#ifdef PLATFORM_WINDOWS
82 SetFocus(layoutRoot);
83#else
85#endif
86
87 m_Tabber.m_OnTabSwitch.Insert(OnTabSwitch);
88 m_Tabber.m_OnAttemptTabSwitch.Insert(OnAttemptTabSwitch);
89
90 GetGame().GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
91 GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
92 OnChanged();
93
94 return layoutRoot;
95 }
96
98 {
99 }
100
101 protected void OnInputPresetChanged()
102 {
103#ifdef PLATFORM_CONSOLE
105#endif
106 }
107
109 {
110#ifdef PLATFORM_CONSOLE
112#endif
113 }
114
115 override bool OnClick(Widget w, int x, int y, int button)
116 {
117 if (button == MouseState.LEFT)
118 {
119 switch (w)
120 {
121 case m_Apply:
122 {
123 Apply();
124 return true;
125 }
126 case m_Back:
127 {
128 Back();
129 return true;
130 }
131 case m_Reset:
132 {
134 return true;
135 }
136 case m_Defaults:
137 {
138 //SetToDefaults();
140 return true;
141 }
142 }
143 }
144 return false;
145 }
146
147 void OnTabSwitch(int tab)
148 {
149 switch (tab)
150 {
151 case 0:
152 {
153 m_GameTab.Focus();
154 break;
155 }
156 case 1:
157 {
158 m_SoundsTab.Focus();
159 break;
160 }
161 case 2:
162 {
163#ifdef PLATFORM_XBOX
164 m_ControlsTab.Focus();
165#else
166 m_VideoTab.Focus();
167#endif
168 break;
169 }
170 case 3:
171 {
172#ifndef PLATFORM_XBOX
173 m_ControlsTab.Focus();
174#endif
175 break;
176 }
177 }
178
179 m_ActiveTabIdx = tab;
180 }
181
182 void Apply()
183 {
184 m_ControlsTab.Apply();
185
186 if (m_GameTab.IsChanged())
187 m_GameTab.Apply();
188
189 if (m_Options.IsChanged() || m_GameTab.IsChanged())
190 {
191 m_Options.Test();
192 m_Options.Apply();
193 }
194
195 // save input configuration
196 GetUApi().Export();
197
198 if (GetGame().GetInput().IsEnabledMouseAndKeyboard()) //useless on consoles
199 {
200 m_Apply.SetFlags(WidgetFlags.IGNOREPOINTER);
201 ColorDisable(m_Apply);
202 m_Reset.SetFlags(WidgetFlags.IGNOREPOINTER);
203 ColorDisable(m_Reset);
204 }
205
206 m_CanApplyOrReset = false;
207#ifdef PLATFORM_CONSOLE
210
211 IngameHud hud;
212 if (GetGame().GetMission() && Class.CastTo(hud, GetGame().GetMission().GetHud()))
213 hud.ShowQuickBar(GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer());
214#endif
215
216 if (m_Options.NeedRestart())
217 g_Game.GetUIManager().ShowDialog("#main_menu_configure", "#menu_restart_needed", 117, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
218 }
219
220 void Back()
221 {
222 if (!g_Game.GetUIManager().IsDialogVisible() && !g_Game.GetUIManager().IsModalVisible())
223 {
224 if (IsAnyTabChanged())
225 {
226 g_Game.GetUIManager().ShowDialog("#main_menu_configure", "#main_menu_configure_desc", 1337, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
227#ifdef PLATFORM_CONSOLE
229#endif
230 }
231 else
232 {
233 m_Options.Revert();
234 GetGame().EndOptionsVideo();
235 GetGame().GetUIManager().Back();
236 }
237 }
238 }
239
241 {
242 bool changed = IsAnyTabChanged();
243 if (changed)
244 {
245 if (!g_Game.GetUIManager().IsDialogVisible() && !g_Game.GetUIManager().IsModalVisible())
246 {
247 int id = target + DIALOG_TAB_OFFSET;
248 g_Game.GetUIManager().ShowDialog("#main_menu_configure", "#main_menu_configure_desc", id, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
249#ifdef PLATFORM_CONSOLE
251#endif
252 }
253 }
254 else
256
257 m_Tabber.SetCanSwitch(!changed);
258 }
259
261 {
262 bool changed = (m_Options.IsChanged() || m_GameTab.IsChanged() || m_SoundsTab.IsChanged() || m_ControlsTab.IsChanged());
263#ifndef PLATFORM_XBOX
264 changed |= m_VideoTab.IsChanged();
265#endif
266
267 return changed;
268 }
269
271 {
272 bool changed = IsAnyTabChanged();
273
274 if (GetGame().GetInput().IsEnabledMouseAndKeyboard())
275 {
276 if (changed)
277 {
278 m_Reset.ClearFlags(WidgetFlags.IGNOREPOINTER);
279 ColorNormal(m_Reset);
280 m_Apply.ClearFlags(WidgetFlags.IGNOREPOINTER);
281 ColorNormal(m_Apply);
282 }
283 else
284 {
285 m_Apply.SetFlags(WidgetFlags.IGNOREPOINTER);
286 ColorDisable(m_Apply);
287 m_Reset.SetFlags(WidgetFlags.IGNOREPOINTER);
288 ColorDisable(m_Reset);
289 }
290 }
291
292 m_CanApplyOrReset = changed;
293#ifdef PLATFORM_CONSOLE
296#endif
297
298 m_Tabber.AlignTabbers();
299 }
300
301 //resets it all
302 void Reset()
303 {
304 m_Options.Revert();
305 m_GameTab.Revert();
306 m_SoundsTab.Revert();
307 m_ControlsTab.Revert();
308#ifndef PLATFORM_XBOX
309 m_VideoTab.Revert();
310#endif
311
312 if (m_Options.IsChanged())
313 m_Options.Revert();
314
315 if (GetGame().GetInput().IsEnabledMouseAndKeyboard())
316 {
317 m_Apply.SetFlags(WidgetFlags.IGNOREPOINTER);
318 ColorDisable(m_Apply);
319 m_Reset.SetFlags(WidgetFlags.IGNOREPOINTER);
320 ColorDisable(m_Reset);
321 }
322
323 m_CanApplyOrReset = false;
324#ifdef PLATFORM_CONSOLE
327#endif
328 }
329
331 {
332 if (m_Options.IsChanged())
333 m_Options.Revert();
334
335 switch (m_ActiveTabIdx)
336 {
337 case 0:
338 {
339 m_GameTab.Revert();
340 break;
341 }
342 case 1:
343 {
344 m_SoundsTab.Revert();
345 break;
346 }
347 case 2:
348 {
349#ifdef PLATFORM_XBOX
350 m_ControlsTab.Revert();
351#else
352 m_VideoTab.Revert();
353#endif
354 break;
355 }
356 case 3:
357 {
358#ifndef PLATFORM_XBOX
359 m_ControlsTab.Revert();
360#endif
361 break;
362 }
363 }
364
365 if (m_Options.IsChanged())
366 m_Options.Revert();
367
368 if (GetGame().GetInput().IsEnabledMouseAndKeyboard())
369 {
370 m_Apply.SetFlags(WidgetFlags.IGNOREPOINTER);
371 ColorDisable(m_Apply);
372 m_Reset.SetFlags(WidgetFlags.IGNOREPOINTER);
373 ColorDisable(m_Reset);
374 }
375
376 m_CanApplyOrReset = false;
377#ifdef PLATFORM_CONSOLE
380#endif
381
382 m_Tabber.AlignTabbers();
383 }
384
386 {
387 if (!g_Game.GetUIManager().IsDialogVisible() && !g_Game.GetUIManager().IsModalVisible())
388 g_Game.GetUIManager().ShowDialog("#menu_default_cap", "TODO - reset options to default", MODAL_ID_DEFAULT, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
389 }
390
392 {
393 switch (m_ActiveTabIdx)
394 {
395 case 0:
396 m_GameTab.SetToDefaults();
397 break;
398
399 case 1:
400 m_SoundsTab.SetToDefaults();
401 break;
402
403 case 2:
404#ifdef PLATFORM_XBOX
405 m_ControlsTab.SetToDefaults();
406#else
407 m_VideoTab.SetToDefaults();
408#endif
409 break;
410
411 case 3:
412#ifndef PLATFORM_XBOX
413 m_ControlsTab.SetToDefaults();
414#endif
415 break;
416 }
417
418 if (GetGame().GetInput().IsEnabledMouseAndKeyboard())
419 {
420 m_Reset.ClearFlags(WidgetFlags.IGNOREPOINTER);
421 ColorNormal(m_Reset);
422 m_Apply.ClearFlags(WidgetFlags.IGNOREPOINTER);
423 ColorNormal(m_Apply);
424 }
425
426 m_CanApplyOrReset = true;
427#ifdef PLATFORM_CONSOLE
430#endif
431 }
432
434 {
435#ifdef PLATFORM_CONSOLE
436 m_CanToggle = false;
438#endif
439 }
440
442 {
443#ifdef PLATFORM_CONSOLE
444 m_CanToggle = true;
446#endif
447 }
448
451 {
452 m_GameTab.ToggleDependentOptions(mode, state);
453 m_SoundsTab.ToggleDependentOptions(mode, state);
454 m_ControlsTab.ToggleDependentOptions(mode, state);
455#ifndef PLATFORM_XBOX
456 m_VideoTab.ToggleDependentOptions(mode, state);
457#endif
458 }
459
461 {
462 m_Options = new GameOptions();
463
464 if (m_GameTab)
465 m_GameTab.SetOptions(m_Options);
466 if (m_SoundsTab)
467 m_SoundsTab.SetOptions(m_Options);
468 if (m_ControlsTab)
469 m_ControlsTab.SetOptions(m_Options);
470
471#ifndef PLATFORM_XBOX
472 if (m_VideoTab)
473 m_VideoTab.SetOptions(m_Options);
474#endif
475 }
476
478 {
479#ifndef PLATFORM_XBOX
480 if (m_VideoTab)
481 m_VideoTab.SetOptions(m_Options);
482#endif
483 }
484
485 override bool OnModalResult(Widget w, int x, int y, int code, int result)
486 {
487 bool ret = false;
488
489 if (code == 1337)
490 {
491 if (result == 2)
492 {
493 m_Options.Revert();
494 GetGame().EndOptionsVideo();
495 GetGame().GetUIManager().Back();
496 }
497 ret = true;
498 }
499 else if (code == 117)
500 g_Game.RequestRestart(IDC_MAIN_QUIT);
501 else if (code == MODAL_ID_DEFAULT)
502 {
503 if (result == 2)
505 }
506 else if (code >= DIALOG_TAB_OFFSET)
507 {
508 if (result == 2)
509 {
510 int id = code - DIALOG_TAB_OFFSET;
511 //m_Options.Revert();
513 m_Tabber.PerformSwitchTab(id);
514 }
515 ret = true;
516 }
517
518 m_ModalLock = ret; //prevents dialog being shown on the next update
519 return ret;
520 }
521
522 override bool OnMouseEnter(Widget w, int x, int y)
523 {
524 if (w && IsFocusable(w))
525 {
527 return true;
528 }
529 return false;
530 }
531
532 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
533 {
534 if (w && IsFocusable(w))
535 {
536 ColorNormal(w);
537 return true;
538 }
539 return false;
540 }
541
542 override bool OnFocus(Widget w, int x, int y)
543 {
544 if (w && IsFocusable(w))
545 {
547 return true;
548 }
549 else if (y == 1)
550 SliderFocus();
551 else
552 ToggleFocus();
553
554 return false;
555 }
556
557 override bool OnFocusLost(Widget w, int x, int y)
558 {
559 if (w && IsFocusable(w))
560 {
561 ColorNormal(w);
562 return true;
563 }
564 return false;
565 }
566
568 {
569 if (w)
570 return (w == m_Apply || w == m_Back || w == m_Reset || w == m_Defaults);
571 return false;
572 }
573
574 override void Refresh()
575 {
576 string version;
577 GetGame().GetVersion(version);
578#ifdef PLATFORM_CONSOLE
579 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
580#else
581 version = "#main_menu_version" + " " + version;
582#endif
583
584 m_Version.SetText(version);
585
586#ifdef PLATFORM_CONSOLE
589#endif
590 }
591
592 override void OnShow()
593 {
594 super.OnShow();
595 m_GameTab.Focus();
596 Refresh();
597 }
598
599 override void Update(float timeslice)
600 {
601 super.Update(timeslice);
602
603 if (m_ModalLock)
604 {
605 m_ModalLock = false;
606#ifdef PLATFORM_CONSOLE
608#endif
609 return;
610 }
611
612 if (g_Game.GetUIManager().IsDialogVisible())
613 return;
614
615 if (GetUApi().GetInputByID(UAUITabLeft).LocalPress())
616 m_Tabber.PreviousTab();
617 else if (GetUApi().GetInputByID(UAUITabRight).LocalPress())
618 m_Tabber.NextTab();
619 else if (GetUApi().GetInputByID(UAUICtrlX).LocalPress())
620 {
621 if (m_CanApplyOrReset)
622 Apply();
623 }
624 else if (GetUApi().GetInputByID(UAUICredits).LocalPress())
625 {
626 if (m_CanApplyOrReset)
628
629 }
630 else if (GetUApi().GetInputByID(UAUICtrlY).LocalPress())
632 else if (GetUApi().GetInputByID(UAUIBack).LocalPress())
633 Back();
634 }
635
636 //Coloring functions (Until WidgetStyles are useful)
638 {
639 if ((w.GetFlags() & WidgetFlags.IGNOREPOINTER) == WidgetFlags.IGNOREPOINTER)
640 return;
641
642 if (w.IsInherited(ButtonWidget))
643 {
645 button.SetTextColor(ARGB(255, 200, 0, 0));
646 }
647
648 w.SetColor(ARGB(255, 0, 0, 0));
649
650 TextWidget text1 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
651 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
652 TextWidget text3 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
653 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() + "_image"));
654 Widget option = Widget.Cast(w.FindAnyWidget(w.GetName() + "_option_wrapper"));
655 Widget option_label = w.FindAnyWidget("option_label");
656
657 if (text1)
658 text1.SetColor(ARGB(255, 255, 0, 0));
659
660 if (text2)
661 text2.SetColor(ARGB(255, 255, 0, 0));
662
663 if (text3)
664 {
665 text3.SetColor(ARGB(255, 255, 0, 0));
666 w.SetAlpha(1);
667 }
668
669 if (image)
670 image.SetColor(ARGB(255, 200, 0, 0));
671
672 if (option)
673 option.SetColor(ARGB(255, 255, 0, 0));
674
675 if (option_label)
676 option_label.SetColor(ARGB(255, 255, 0, 0));
677 }
678
680 {
681 if ((w.GetFlags() & WidgetFlags.IGNOREPOINTER) == WidgetFlags.IGNOREPOINTER)
682 return;
683
684 if (w.IsInherited(ButtonWidget))
685 {
687 button.SetTextColor(ARGB(255, 255, 255, 255));
688 }
689
690 TextWidget text1 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
691 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
692 TextWidget text3 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
693 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() + "_image"));
694 Widget option = w.FindAnyWidget(w.GetName() + "_option_wrapper");
695 Widget option_label = w.FindAnyWidget("option_label");
696
697 if (text1)
698 text1.SetColor(ARGB(255, 255, 255, 255));
699
700 if (text2)
701 text2.SetColor(ARGB(255, 255, 255, 255));
702
703 if (text3)
704 {
705 text3.SetColor(ARGB(255, 255, 255, 255));
706 w.SetAlpha(0);
707 }
708
709 if (image)
710 image.SetColor(ARGB(255, 255, 255, 255));
711
712 if (option)
713 option.SetColor(ARGB(150, 255, 255, 255));
714
715 if (option_label)
716 option_label.SetColor(ARGB(255, 255, 255, 255));
717 }
718
720 {
721#ifdef PLATFORM_WINDOWS
722 SetFocus(null);
723#endif
724
725 if (w)
726 {
728 if (button)
730 }
731 }
732
733 protected void UpdateControlsElements()
734 {
735#ifdef PLATFORM_CONSOLE
736 RichTextWidget toolbar_text = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
737 string text = "";
738 if (g_Game.GetUIManager().IsDialogVisible() || g_Game.GetUIManager().IsDialogQueued())
739 text += string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#dialog_confirm", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
740
741 else
742 {
743 if (m_CanToggle)
744 text += string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#dialog_change", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
745 if (m_CanApplyOrReset)
746 text += string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlX", "#STR_settings_menu_root_toolbar_bg_ConsoleToolbar_Apply_ApplyText0", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
748 if (m_CanApplyOrReset)
750 }
751 text += string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "#STR_settings_menu_root_toolbar_bg_ConsoleToolbar_Back_BackText0", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
752 toolbar_text.SetText(text);
753
754 RichTextWidget toolbar_b2 = RichTextWidget.Cast(layoutRoot.FindAnyWidget("BackIcon0"));
755 RichTextWidget toolbar_x2 = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ApplyIcon0"));
756 RichTextWidget toolbar_y2 = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ResetIcon0"));
757 RichTextWidget toolbar_def2 = RichTextWidget.Cast(layoutRoot.FindAnyWidget("DefaultIcon0"));
762#endif
763 }
764
766 {
767 bool toolbarShow = false;
768#ifdef PLATFORM_CONSOLE
769 toolbarShow = !GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer() || GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
770#endif
771
772 layoutRoot.FindAnyWidget("toolbar_bg").Show(toolbarShow);
773 layoutRoot.FindAnyWidget("play_panel_root").Show(!toolbarShow);
774 }
775}
void OnInputPresetChanged()
Definition Inventory.c:160
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Definition Inventory.c:167
ActionInput GetInput()
Definition ActionBase.c:989
ButtonWidget m_Back
DayZGame g_Game
Definition DayZGame.c:3528
Icon x
Icon y
proto native UAInputAPI GetUApi()
Super root of all classes in Enforce script.
Definition EnScript.c:11
static int COLOR_DISABLED_TEXT
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Definition InputUtils.c:151
static const float ICON_SCALE_TOOLBAR
Definition InputUtils.c:15
void UpdateControlsElementVisibility()
override bool OnMouseEnter(Widget w, int x, int y)
override void OnShow()
void ColorDisable(Widget w)
Definition InGameMenu.c:346
override bool OnFocus(Widget w, int x, int y)
override void Update(float timeslice)
void ReloadVideoOptions()
override void Refresh()
TextWidget m_Version
void OnAttemptTabSwitch(int source, int target)
void ColorHighlight(Widget w)
bool IsFocusable(Widget w)
void ~OptionsMenu()
Definition OptionsMenu.c:97
void Apply()
renames character
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
void SetToDefaults()
ref GameOptions m_Options
Definition OptionsMenu.c:12
bool m_CanApplyOrReset
Definition OptionsMenu.c:24
void ResetCurrentTab()
override bool OnFocusLost(Widget w, int x, int y)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
void ReloadOptions()
ref OptionsMenuGame m_GameTab
Definition OptionsMenu.c:7
ref OptionsMenuSounds m_SoundsTab
Definition OptionsMenu.c:8
void ToggleDependentOptions(int mode, bool state)
Controls visibility and sometimes even state of specific, dependent options across sub-menus.
bool IsAnyTabChanged()
const int DIALOG_TAB_OFFSET
Definition OptionsMenu.c:4
ButtonWidget m_Defaults
void UpdateControlsElements()
void OnTabSwitch(int tab)
ref OptionsMenuVideo m_VideoTab
Definition OptionsMenu.c:9
ButtonWidget m_Back
override Widget Init()
Definition OptionsMenu.c:32
override bool OnClick(Widget w, int x, int y, int button)
void OptionsMenu()
Definition OptionsMenu.c:27
override bool OnModalResult(Widget w, int x, int y, int code, int result)
void ColorNormal(Widget w)
ButtonWidget m_Reset
Definition OptionsMenu.c:16
ref OptionsMenuControls m_ControlsTab
Definition OptionsMenu.c:10
void PerformSetToDefaults()
deprecated, resets all (as before ~1.20)
void OnInputPresetChanged()
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
MouseState
Definition EnSystem.c:311
const int IDC_MAIN_QUIT
Definition constants.c:136
WidgetFlags
Definition EnWidgets.c:58
proto native void SetFocus(Widget w)
EInputDeviceType
Definition input.c:3
int ARGB(int a, int r, int g, int b)
Definition proto.c:322