DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
OptionsMenu.c
См. документацию.
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
12 protected ref GameOptions m_Options;
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
27 #ifdef PLATFORM_MSSTORE
28 protected ButtonWidget m_GamepadControls;
29 protected ButtonWidget m_KeyboardBindings;
30 #endif
31
33 {
34
35 }
36
37 override Widget Init()
38 {
39 m_Options = new GameOptions();
40
41 #ifdef PLATFORM_MSSTORE
42 layoutRoot = g_Game.GetWorkspace().CreateWidgets("gui/layouts/new_ui/options/msstore/options_menu.layout", null);
43 #else
44 #ifdef PLATFORM_XBOX
45 layoutRoot = g_Game.GetWorkspace().CreateWidgets("gui/layouts/new_ui/options/xbox/options_menu.layout", null);
46 #else
47 #ifdef PLATFORM_PS4
48 layoutRoot = g_Game.GetWorkspace().CreateWidgets("gui/layouts/new_ui/options/ps/options_menu.layout", null);
49 #else
50 #ifdef PLATFORM_WINDOWS
51 layoutRoot = g_Game.GetWorkspace().CreateWidgets("gui/layouts/new_ui/options/pc/options_menu.layout", null);
52 #endif
53 #endif
54 #endif
55 #endif
56
57 layoutRoot.FindAnyWidget("Tabber").GetScript(m_Tabber);
58
59 m_Details = layoutRoot.FindAnyWidget("settings_details");
60 m_Version = TextWidget.Cast(layoutRoot.FindAnyWidget("version"));
61
62 m_GameTab = new OptionsMenuGame(layoutRoot.FindAnyWidget("Tab_0"), m_Details, m_Options, this);
63 m_SoundsTab = new OptionsMenuSounds(layoutRoot.FindAnyWidget("Tab_1"), m_Details, m_Options, this);
64
65 #ifdef PLATFORM_MSSTORE
66 m_VideoTab = new OptionsMenuVideo(layoutRoot.FindAnyWidget("Tab_2"), m_Details, m_Options, this);
67 m_ControlsTab = new OptionsMenuControls(layoutRoot.FindAnyWidget("Tab_3"), m_Details, m_Options, this);
68 m_GamepadControls = ButtonWidget.Cast(layoutRoot.FindAnyWidget("gamepad_controls"));
69 m_KeyboardBindings = ButtonWidget.Cast(layoutRoot.FindAnyWidget("keyboard_bindings"));
70 #else
71 #ifdef PLATFORM_XBOX
72 m_ControlsTab = new OptionsMenuControls(layoutRoot.FindAnyWidget("Tab_2"), m_Details, m_Options, this);
73 #else
74 m_VideoTab = new OptionsMenuVideo(layoutRoot.FindAnyWidget("Tab_2"), m_Details, m_Options, this);
75 m_ControlsTab = new OptionsMenuControls(layoutRoot.FindAnyWidget("Tab_3"), m_Details, m_Options, this);
76 #endif
77 #endif
78
79 m_Apply = ButtonWidget.Cast(layoutRoot.FindAnyWidget("apply"));
80 m_Back = ButtonWidget.Cast(layoutRoot.FindAnyWidget("back"));
81 m_Reset = ButtonWidget.Cast(layoutRoot.FindAnyWidget("reset"));
82 m_Defaults = ButtonWidget.Cast(layoutRoot.FindAnyWidget("defaults"));
83
84 m_ModalLock = false;
85 m_CanApplyOrReset = false;
86 m_CanToggle = false;
87
88 string version;
89 g_Game.GetVersion(version);
90 #ifdef PLATFORM_CONSOLE
91 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
92 #else
93 version = "#main_menu_version" + " " + version;
94 #endif
95 m_Version.SetText(version);
96
97 #ifdef PLATFORM_WINDOWS
98 SetFocus(layoutRoot);
99 #else
100 ToggleFocus();
101 #endif
102
103 m_Tabber.m_OnTabSwitch.Insert(OnTabSwitch);
104 m_Tabber.m_OnAttemptTabSwitch.Insert(OnAttemptTabSwitch);
105
106 g_Game.GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
107 g_Game.GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
108 OnChanged();
109
110 return layoutRoot;
111 }
112
114 {
115 }
116
117 protected void OnInputPresetChanged()
118 {
119 #ifdef PLATFORM_CONSOLE
121 #endif
122 }
123
124 protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
125 {
126 #ifdef PLATFORM_CONSOLE
127 bool mk = g_Game.GetInput().IsEnabledMouseAndKeyboard();
128 bool mkServer = g_Game.GetInput().IsEnabledMouseAndKeyboardEvenOnServer();
129
130 switch (pInputDeviceType)
131 {
132 case EInputDeviceType.CONTROLLER:
133 if (mk && mkServer)
134 {
135 g_Game.GetUIManager().ShowUICursor(false);
136 }
137 if (!GetFocus())
138 {
140 }
141 break;
142
143 default:
144 if (mk && mkServer)
145 {
146 g_Game.GetUIManager().ShowUICursor(true);
147 }
148 break;
149 }
150
152 #endif
153 }
154
155 override bool OnClick(Widget w, int x, int y, int button)
156 {
157 if (button == MouseState.LEFT)
158 {
159 switch (w)
160 {
161 #ifdef PLATFORM_MSSTORE
162 case m_GamepadControls:
163 {
164 EnterScriptedMenu(MENU_XBOX_CONTROLS);
165 return true;
166 }
167
168 case m_KeyboardBindings:
169 {
170 EnterScriptedMenu( MENU_KEYBINDINGS );
171 return true;
172 }
173 #endif
174
175 case m_Apply:
176 {
177 Apply();
178 return true;
179 }
180 case m_Back:
181 {
182 Back();
183 return true;
184 }
185 case m_Reset:
186 {
188 return true;
189 }
190 case m_Defaults:
191 {
192 //SetToDefaults();
194 return true;
195 }
196 }
197 }
198 return false;
199 }
200
201 void OnTabSwitch(int tab)
202 {
203 switch (tab)
204 {
205 case 0:
206 {
207 m_GameTab.Focus();
208 break;
209 }
210 case 1:
211 {
212 m_SoundsTab.Focus();
213 break;
214 }
215 case 2:
216 {
217 #ifdef PLATFORM_XBOX
218 m_ControlsTab.Focus();
219 #else
220 m_VideoTab.Focus();
221 #endif
222 break;
223 }
224 case 3:
225 {
226 #ifndef PLATFORM_XBOX
227 m_ControlsTab.Focus();
228 #endif
229 break;
230 }
231 }
232
233 m_ActiveTabIdx = tab;
234 }
235
236 void Apply()
237 {
238 if (m_ControlsTab.IsChanged())
239 m_ControlsTab.Apply();
240
241 if (m_SoundsTab.IsChanged())
242 m_SoundsTab.Apply();
243
244 if (m_GameTab.IsChanged())
245 m_GameTab.Apply();
246
247 if (m_Options.IsChanged() || m_GameTab.IsChanged())
248 {
249 m_Options.Test();
250 m_Options.Apply();
251 }
252
253 // save input configuration
254 GetUApi().Export();
255
256 if (g_Game.GetInput().IsEnabledMouseAndKeyboard()) //useless on consoles
257 {
258 m_Apply.SetFlags(WidgetFlags.IGNOREPOINTER);
260 m_Reset.SetFlags(WidgetFlags.IGNOREPOINTER);
262 }
263
264 m_CanApplyOrReset = false;
265 #ifdef PLATFORM_CONSOLE
268
269 IngameHud hud;
270 if (g_Game.GetMission() && Class.CastTo(hud,g_Game.GetMission().GetHud()))
271 {
272 hud.ShowQuickBar(g_Game.GetInput().IsEnabledMouseAndKeyboardEvenOnServer());
273 }
274 #endif
275
276 if (m_Options.NeedRestart())
277 g_Game.GetUIManager().ShowDialog("#main_menu_configure", "#menu_restart_needed", 117, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
278 }
279
280 void Back()
281 {
282 if (!g_Game.GetUIManager().IsDialogVisible() && !g_Game.GetUIManager().IsModalVisible())
283 {
284 if (IsAnyTabChanged())
285 {
286 g_Game.GetUIManager().ShowDialog("#main_menu_configure", "#main_menu_configure_desc", 1337, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
287 #ifdef PLATFORM_CONSOLE
289 #endif
290 }
291 else
292 {
293 m_Options.Revert();
294 g_Game.EndOptionsVideo();
295 g_Game.GetUIManager().Back();
296 }
297 }
298 }
299
300 void OnAttemptTabSwitch(int source, int target)
301 {
302 bool changed = IsAnyTabChanged();
303 if (changed)
304 {
305 if (!g_Game.GetUIManager().IsDialogVisible() && !g_Game.GetUIManager().IsModalVisible())
306 {
307 int id = target + DIALOG_TAB_OFFSET;
308 g_Game.GetUIManager().ShowDialog("#main_menu_configure", "#main_menu_configure_desc", id, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
309 #ifdef PLATFORM_CONSOLE
311 #endif
312 }
313 }
314 else
315 {
317 }
318
319 m_Tabber.SetCanSwitch(!changed);
320 }
321
323 {
324 bool changed = (m_Options.IsChanged() || m_GameTab.IsChanged() || m_SoundsTab.IsChanged() || m_ControlsTab.IsChanged());
325 #ifndef PLATFORM_XBOX
326 changed |= m_VideoTab.IsChanged();
327 #endif
328
329 return changed;
330 }
331
333 {
334 bool changed = IsAnyTabChanged();
335
336 if (g_Game.GetInput().IsEnabledMouseAndKeyboard())
337 {
338 if (changed)
339 {
340 m_Reset.ClearFlags(WidgetFlags.IGNOREPOINTER);
342 m_Apply.ClearFlags(WidgetFlags.IGNOREPOINTER);
344 }
345 else
346 {
347 m_Apply.SetFlags(WidgetFlags.IGNOREPOINTER);
349 m_Reset.SetFlags(WidgetFlags.IGNOREPOINTER);
351 }
352 }
353
354 m_CanApplyOrReset = changed;
355 #ifdef PLATFORM_CONSOLE
358 #endif
359
360 m_Tabber.AlignTabbers();
361 }
362
363 //resets it all
364 void Reset()
365 {
366 m_Options.Revert();
367 m_GameTab.Revert();
368 m_SoundsTab.Revert();
369 m_ControlsTab.Revert();
370 #ifndef PLATFORM_XBOX
371 m_VideoTab.Revert();
372 #endif
373
374 if (m_Options.IsChanged())
375 m_Options.Revert();
376
377 if (g_Game.GetInput().IsEnabledMouseAndKeyboard())
378 {
379 m_Apply.SetFlags(WidgetFlags.IGNOREPOINTER);
381 m_Reset.SetFlags(WidgetFlags.IGNOREPOINTER);
383 }
384
385 m_CanApplyOrReset = false;
386 #ifdef PLATFORM_CONSOLE
389 #endif
390 }
391
393 {
394 if (m_Options.IsChanged())
395 {
396 m_Options.Revert();
397 }
398
399 switch (m_ActiveTabIdx)
400 {
401 case 0:
402 {
403 m_GameTab.Revert();
404 break;
405 }
406 case 1:
407 {
408 m_SoundsTab.Revert();
409 break;
410 }
411 case 2:
412 {
413 #ifdef PLATFORM_XBOX
414 m_ControlsTab.Revert();
415 #else
416 m_VideoTab.Revert();
417 #endif
418 break;
419 }
420 case 3:
421 {
422 #ifndef PLATFORM_XBOX
423 m_ControlsTab.Revert();
424 #endif
425 break;
426 }
427 }
428
429 if (m_Options.IsChanged())
430 {
431 m_Options.Revert();
432 }
433
434 if (g_Game.GetInput().IsEnabledMouseAndKeyboard())
435 {
436 m_Apply.SetFlags(WidgetFlags.IGNOREPOINTER);
438 m_Reset.SetFlags(WidgetFlags.IGNOREPOINTER);
440 }
441
442 m_CanApplyOrReset = false;
443 #ifdef PLATFORM_CONSOLE
446 #endif
447
448 m_Tabber.AlignTabbers();
449 }
450
452 {
453 if (!g_Game.GetUIManager().IsDialogVisible() && !g_Game.GetUIManager().IsModalVisible())
454 {
455 g_Game.GetUIManager().ShowDialog("#menu_default_cap", "TODO - reset options to default", MODAL_ID_DEFAULT, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
456 }
457 }
458
460 {
461 switch (m_ActiveTabIdx)
462 {
463 case 0:
464 m_GameTab.Focus();
465 break;
466
467 case 1:
468 m_SoundsTab.Focus();
469 break;
470
471 case 2:
472 #ifdef PLATFORM_XBOX
473 m_ControlsTab.Focus();
474 #else
475 m_VideoTab.Focus();
476 #endif
477 break;
478
479 case 3:
480 #ifndef PLATFORM_XBOX
481 m_ControlsTab.Focus();
482 #endif
483 break;
484 }
485 }
486
488 {
489 switch (m_ActiveTabIdx)
490 {
491 case 0:
492 m_GameTab.SetToDefaults();
493 break;
494
495 case 1:
496 m_SoundsTab.SetToDefaults();
497 break;
498
499 case 2:
500 #ifdef PLATFORM_XBOX
501 m_ControlsTab.SetToDefaults();
502 #else
503 m_VideoTab.SetToDefaults();
504 #endif
505 break;
506
507 case 3:
508 #ifndef PLATFORM_XBOX
509 m_ControlsTab.SetToDefaults();
510 #endif
511 break;
512 }
513
514 if (g_Game.GetInput().IsEnabledMouseAndKeyboard())
515 {
516 m_Reset.ClearFlags(WidgetFlags.IGNOREPOINTER);
518 m_Apply.ClearFlags(WidgetFlags.IGNOREPOINTER);
520 }
521
522 m_CanApplyOrReset = true;
523 #ifdef PLATFORM_CONSOLE
526 #endif
527 }
528
530 {
531 #ifdef PLATFORM_CONSOLE
532 m_CanToggle = false;
534 #endif
535 }
536
538 {
539 #ifdef PLATFORM_CONSOLE
540 m_CanToggle = true;
542 #endif
543 }
544
546 {
547 m_Options = new GameOptions();
548
549 if (m_GameTab)
550 m_GameTab.SetOptions(m_Options);
551 if (m_SoundsTab)
552 m_SoundsTab.SetOptions(m_Options);
553 if (m_ControlsTab)
554 m_ControlsTab.SetOptions(m_Options);
555
556 #ifndef PLATFORM_XBOX
557 if (m_VideoTab)
558 m_VideoTab.SetOptions(m_Options);
559 #endif
560 }
561
563 {
564 #ifndef PLATFORM_XBOX
565 if (m_VideoTab)
566 m_VideoTab.SetOptions(m_Options);
567 #endif
568 }
569
570 override bool OnModalResult(Widget w, int x, int y, int code, int result)
571 {
572 bool ret = false;
573
574 if (code == 1337)
575 {
576 if (result == 2)
577 {
578 m_Options.Revert();
579 g_Game.EndOptionsVideo();
580 g_Game.GetUIManager().Back();
581 }
582 ret = true;
583 }
584 else if (code == 117)
585 {
586 g_Game.RequestRestart(IDC_MAIN_QUIT);
587 }
588 else if (code == MODAL_ID_DEFAULT)
589 {
590 if (result == 2)
591 {
593 }
594 }
595 else if (code >= DIALOG_TAB_OFFSET)
596 {
597 if (result == 2)
598 {
599 int id = code - DIALOG_TAB_OFFSET;
600 //m_Options.Revert();
602 m_Tabber.PerformSwitchTab(id);
603 }
604 ret = true;
605 }
606
607 m_ModalLock = ret; //prevents dialog being shown on the next update
608 return ret;
609 }
610
611 override bool OnMouseEnter(Widget w, int x, int y)
612 {
613 if (w && IsFocusable(w))
614 {
616 return true;
617 }
618 return false;
619 }
620
621 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
622 {
623 if (w && IsFocusable(w))
624 {
625 ColorNormal(w);
626 return true;
627 }
628 return false;
629 }
630
631 override bool OnFocus(Widget w, int x, int y)
632 {
633 if (w && IsFocusable(w))
634 {
636 return true;
637 }
638 else if (y == 1)
639 {
640 SliderFocus();
641 }
642 else
643 {
644 ToggleFocus();
645 }
646
647 return false;
648 }
649
650 override bool OnFocusLost(Widget w, int x, int y)
651 {
652 if (w && IsFocusable(w))
653 {
654 ColorNormal(w);
655 return true;
656 }
657 return false;
658 }
659
661 {
662 if (w)
663 {
664 return (w == m_Apply || w == m_Back || w == m_Reset || w == m_Defaults);
665 }
666 return false;
667 }
668
669 override void Refresh()
670 {
671 string version;
672 g_Game.GetVersion(version);
673 #ifdef PLATFORM_CONSOLE
674 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
675 #else
676 version = "#main_menu_version" + " " + version;
677 #endif
678
679 m_Version.SetText(version);
680
681 #ifdef PLATFORM_CONSOLE
682 OnInputDeviceChanged(g_Game.GetInput().GetCurrentInputDevice());
684 #endif
685 }
686
687 override void OnShow()
688 {
689 super.OnShow();
690 #ifdef PLATFORM_MSSTORE
691 // MSStore: When going back from keybindings/gamepad controls, game tab somehow gained focus.
692 // Focus last active tab
694 #else
695 m_GameTab.Focus();
696 #endif
697 Refresh();
698 }
699
700 override void Update(float timeslice)
701 {
702 super.Update(timeslice);
703
704 if (m_ModalLock)
705 {
706 m_ModalLock = false;
707 #ifdef PLATFORM_CONSOLE
709 #endif
710 return;
711 }
712
713 if (g_Game.GetUIManager().IsDialogVisible())
714 {
715 return;
716 }
717
718 if (GetUApi().GetInputByID(UAUITabLeft).LocalPress())
719 {
720 m_Tabber.PreviousTab();
721 }
722 else if (GetUApi().GetInputByID(UAUITabRight).LocalPress())
723 {
724 m_Tabber.NextTab();
725 }
726 else if (GetUApi().GetInputByID(UAUICtrlX).LocalPress())
727 {
729 {
730 Apply();
731 }
732 }
733 else if (GetUApi().GetInputByID(UAUICredits).LocalPress())
734 {
736 {
738 }
739
740 }
741 else if (GetUApi().GetInputByID(UAUICtrlY).LocalPress())
742 {
744 }
745 else if (GetUApi().GetInputByID(UAUIBack).LocalPress())
746 {
747 Back();
748 }
749 }
750
751 //Coloring functions (Until WidgetStyles are useful)
753 {
754 if ((w.GetFlags() & WidgetFlags.IGNOREPOINTER) == WidgetFlags.IGNOREPOINTER)
755 {
756 return;
757 }
758
759 if (w.IsInherited(ButtonWidget))
760 {
761 ButtonWidget button = ButtonWidget.Cast(w);
762 button.SetTextColor(ARGB(255, 200, 0, 0));
763 }
764
765 w.SetColor(ARGB(255, 0, 0, 0));
766
767 TextWidget text1 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
768 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
769 TextWidget text3 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
770 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() + "_image"));
771 Widget option = Widget.Cast(w.FindAnyWidget(w.GetName() + "_option_wrapper"));
772 Widget option_label = w.FindAnyWidget("option_label");
773
774 if (text1)
775 {
776 text1.SetColor(ARGB(255, 255, 0, 0));
777 }
778
779 if (text2)
780 {
781 text2.SetColor(ARGB(255, 255, 0, 0));
782 }
783
784 if (text3)
785 {
786 text3.SetColor(ARGB(255, 255, 0, 0));
787 w.SetAlpha(1);
788 }
789
790 if (image)
791 {
792 image.SetColor(ARGB(255, 200, 0, 0));
793 }
794
795 if (option)
796 {
797 option.SetColor(ARGB(255, 255, 0, 0));
798 }
799
800 if (option_label)
801 {
802 option_label.SetColor(ARGB(255, 255, 0, 0));
803 }
804 }
805
807 {
808 if ((w.GetFlags() & WidgetFlags.IGNOREPOINTER) == WidgetFlags.IGNOREPOINTER)
809 {
810 return;
811 }
812
813 if (w.IsInherited(ButtonWidget))
814 {
815 ButtonWidget button = ButtonWidget.Cast(w);
816 button.SetTextColor(ARGB(255, 255, 255, 255));
817 }
818
819 TextWidget text1 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
820 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
821 TextWidget text3 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
822 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() + "_image"));
823 Widget option = w.FindAnyWidget(w.GetName() + "_option_wrapper");
824 Widget option_label = w.FindAnyWidget("option_label");
825
826 if (text1)
827 {
828 text1.SetColor(ARGB(255, 255, 255, 255));
829 }
830
831 if (text2)
832 {
833 text2.SetColor(ARGB(255, 255, 255, 255));
834 }
835
836 if (text3)
837 {
838 text3.SetColor(ARGB(255, 255, 255, 255));
839 w.SetAlpha(0);
840 }
841
842 if (image)
843 {
844 image.SetColor(ARGB(255, 255, 255, 255));
845 }
846
847 if (option)
848 {
849 option.SetColor(ARGB(150, 255, 255, 255));
850 }
851
852 if (option_label)
853 {
854 option_label.SetColor(ARGB(255, 255, 255, 255));
855 }
856 }
857
859 {
860 #ifdef PLATFORM_WINDOWS
861 SetFocus(null);
862 #endif
863
864 if (w)
865 {
866 ButtonWidget button = ButtonWidget.Cast(w);
867 if (button)
868 {
869 button.SetTextColor(ColorManager.COLOR_DISABLED_TEXT);
870 }
871 }
872 }
873
874 protected void UpdateControlsElements()
875 {
876 #ifdef PLATFORM_CONSOLE
877 RichTextWidget toolbar_text = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
878 string text = "";
879 if (g_Game.GetUIManager().IsDialogVisible() || g_Game.GetUIManager().IsDialogQueued())
880 {
881 text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#dialog_confirm", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
882
883 }
884 else
885 {
886 if (m_CanToggle)
887 {
888 text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#dialog_change", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
889 }
891 {
892 text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlX", "#STR_settings_menu_root_toolbar_bg_ConsoleToolbar_Apply_ApplyText0", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
893 }
894 text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlY", "#menu_default", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
896 {
897 text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUICredits", "#menu_undo", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
898 }
899 }
900 text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "#STR_settings_menu_root_toolbar_bg_ConsoleToolbar_Back_BackText0", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
901 toolbar_text.SetText(text);
902 #endif
903 }
904
906 {
907 bool toolbarShow = false;
908 #ifdef PLATFORM_CONSOLE
909 toolbarShow = !g_Game.GetInput().IsEnabledMouseAndKeyboardEvenOnServer() || g_Game.GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
910 #endif
911
912 layoutRoot.FindAnyWidget("toolbar_bg").Show(toolbarShow);
913 layoutRoot.FindAnyWidget("play_panel_root").Show(!toolbarShow);
914 }
915
917 [Obsolete("1.29: No replacement")]
918 void ToggleDependentOptions(int mode, bool state);
919}
DayZGame g_Game
Определения DayZGame.c:4074
Icon x
Icon y
proto native UAInputAPI GetUApi()
Super root of all classes in Enforce script.
Определения EnScript.c:11
static int COLOR_DISABLED_TEXT
Определения ColorManager.c:11
Определения ColorManager.c:2
Определения gameplay.c:1461
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Определения InputUtils.c:167
static const float ICON_SCALE_TOOLBAR
Определения InputUtils.c:15
Определения InputUtils.c:2
Определения gameplay.c:317
Определения EnWidgets.c:220
proto native void Export()
void FocusLastActiveTab()
Определения OptionsMenu.c:459
void UpdateControlsElementVisibility()
Определения ControlsXboxNew.c:545
override bool OnMouseEnter(Widget w, int x, int y)
Определения OptionsMenu.c:611
override void OnShow()
Определения OptionsMenu.c:687
void ColorDisable(Widget w)
Определения InGameMenu.c:383
override bool OnFocus(Widget w, int x, int y)
Определения OptionsMenu.c:631
override void Update(float timeslice)
Определения OptionsMenu.c:700
void ReloadVideoOptions()
Определения OptionsMenu.c:562
override void Refresh()
Определения OptionsMenu.c:669
TabberUI m_Tabber
Определения KeybindingsMenu.c:3
TextWidget m_Version
Определения InGameMenuXbox.c:36
const int MODAL_ID_DEFAULT
Определения KeybindingsMenu.c:23
void OnAttemptTabSwitch(int source, int target)
Определения OptionsMenu.c:300
void Reset()
Определения OptionsMenu.c:364
void ColorHighlight(Widget w)
Определения ControlsXboxNew.c:454
bool IsFocusable(Widget w)
Определения CameraToolsMenu.c:960
void ~OptionsMenu()
Определения OptionsMenu.c:113
Widget m_Apply
Определения CharacterCreationMenu.c:14
Widget m_Details
Определения OptionsMenu.c:19
void OnChanged()
Определения OptionsMenu.c:332
void Apply()
renames character
Определения CharacterCreationMenu.c:191
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Определения ControlsXboxNew.c:71
void SetToDefaults()
Определения OptionsMenu.c:451
bool m_CanApplyOrReset
Определения OptionsMenu.c:24
void ResetCurrentTab()
Определения OptionsMenu.c:392
bool m_CanToggle
Определения OptionsMenu.c:25
override bool OnFocusLost(Widget w, int x, int y)
Определения OptionsMenu.c:650
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
Определения OptionsMenu.c:621
void Back()
Определения ControlsXboxNew.c:96
void ReloadOptions()
Определения OptionsMenu.c:545
void SliderFocus()
Определения OptionsMenu.c:529
ref OptionsMenuGame m_GameTab
Определения OptionsMenu.c:7
Widget m_Options
Определения MainMenuConsoles.c:21
ref OptionsMenuSounds m_SoundsTab
Определения OptionsMenu.c:8
void ToggleDependentOptions(int mode, bool state)
DEPRECATED BELOW.
bool IsAnyTabChanged()
Определения OptionsMenu.c:322
const int DIALOG_TAB_OFFSET
Определения OptionsMenu.c:4
int m_ActiveTabIdx
Определения OptionsMenu.c:22
ButtonWidget m_Defaults
Определения KeybindingsMenu.c:13
void UpdateControlsElements()
Определения ControlsXboxNew.c:535
void OnTabSwitch(int tab)
Определения OptionsMenu.c:201
ref OptionsMenuVideo m_VideoTab
Определения OptionsMenu.c:9
ButtonWidget m_Back
Определения ControlsXboxNew.c:35
override Widget Init()
Определения OptionsMenu.c:37
override bool OnClick(Widget w, int x, int y, int button)
Определения OptionsMenu.c:155
void OptionsMenu()
Определения OptionsMenu.c:32
override bool OnModalResult(Widget w, int x, int y, int code, int result)
Определения OptionsMenu.c:570
void ColorNormal(Widget w)
Определения ControlsXboxNew.c:471
ButtonWidget m_Reset
Определения CameraToolsMenu.c:45
bool m_ModalLock
Определения OptionsMenu.c:23
void ToggleFocus()
Определения OptionsMenu.c:537
ref OptionsMenuControls m_ControlsTab
Определения OptionsMenu.c:10
void PerformSetToDefaults()
deprecated, resets all (as before ~1.20)
Определения KeybindingsMenu.c:544
void OnInputPresetChanged()
Определения ControlsXboxNew.c:63
Определения DayZGame.c:64
Определения EnWidgets.c:190
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
void Obsolete(string msg="")
Определения EnScript.c:371
const int MENU_KEYBINDINGS
Определения 3_Game/DayZ/constants.c:209
const int MENU_XBOX_CONTROLS
Определения 3_Game/DayZ/constants.c:203
MouseState
Определения EnSystem.c:311
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.
const int IDC_MAIN_QUIT
Определения 3_Game/DayZ/constants.c:150
WidgetFlags
Определения EnWidgets.c:58
proto native Widget GetFocus()
proto native void SetFocus(Widget w)
EInputDeviceType
Определения input.c:3
int ARGB(int a, int r, int g, int b)
Определения proto.c:322