3 const int MODAL_ID_DEFAULT = 100;
15 protected ButtonWidget
m_Back;
42 #ifdef PLATFORM_WINDOWS
48 layoutRoot.FindAnyWidget(
"Tabber").GetScript(
m_Tabber);
50 m_Details = layoutRoot.FindAnyWidget(
"settings_details");
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"));
74 #ifdef PLATFORM_CONSOLE
75 version =
"#main_menu_version" +
" " + version +
" (" +
g_Game.GetDatabaseID() +
")";
77 version =
"#main_menu_version" +
" " + version;
81 #ifdef PLATFORM_WINDOWS
103 #ifdef PLATFORM_CONSOLE
110 #ifdef PLATFORM_CONSOLE
114 switch (pInputDeviceType)
192 #ifndef PLATFORM_XBOX
222 if (
GetGame().GetInput().IsEnabledMouseAndKeyboard())
231 #ifdef PLATFORM_CONSOLE
238 hud.ShowQuickBar(
GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer());
243 g_Game.GetUIManager().ShowDialog(
"#main_menu_configure",
"#menu_restart_needed", 117, DBT_YESNO, DBB_YES, DMT_QUESTION,
this);
248 if (!
g_Game.GetUIManager().IsDialogVisible() && !
g_Game.GetUIManager().IsModalVisible())
252 g_Game.GetUIManager().ShowDialog(
"#main_menu_configure",
"#main_menu_configure_desc", 1337, DBT_YESNO, DBB_YES, DMT_QUESTION,
this);
253 #ifdef PLATFORM_CONSOLE
271 if (!
g_Game.GetUIManager().IsDialogVisible() && !
g_Game.GetUIManager().IsModalVisible())
274 g_Game.GetUIManager().ShowDialog(
"#main_menu_configure",
"#main_menu_configure_desc",
id, DBT_YESNO, DBB_YES, DMT_QUESTION,
this);
275 #ifdef PLATFORM_CONSOLE
291 #ifndef PLATFORM_XBOX
302 if (
GetGame().GetInput().IsEnabledMouseAndKeyboard())
321 #ifdef PLATFORM_CONSOLE
336 #ifndef PLATFORM_XBOX
343 if (
GetGame().GetInput().IsEnabledMouseAndKeyboard())
352 #ifdef PLATFORM_CONSOLE
388 #ifndef PLATFORM_XBOX
400 if (
GetGame().GetInput().IsEnabledMouseAndKeyboard())
409 #ifdef PLATFORM_CONSOLE
419 if (!
g_Game.GetUIManager().IsDialogVisible() && !
g_Game.GetUIManager().IsModalVisible())
421 g_Game.GetUIManager().ShowDialog(
"#menu_default_cap",
"TODO - reset options to default",
MODAL_ID_DEFAULT, DBT_YESNO, DBB_YES, DMT_QUESTION,
this);
446 #ifndef PLATFORM_XBOX
452 if (
GetGame().GetInput().IsEnabledMouseAndKeyboard())
461 #ifdef PLATFORM_CONSOLE
469 #ifdef PLATFORM_CONSOLE
477 #ifdef PLATFORM_CONSOLE
486 m_GameTab.ToggleDependentOptions(mode,state);
489 #ifndef PLATFORM_XBOX
490 m_VideoTab.ToggleDependentOptions(mode,state);
505 #ifndef PLATFORM_XBOX
513 #ifndef PLATFORM_XBOX
533 else if (code == 117)
622 #ifdef PLATFORM_CONSOLE
623 version =
"#main_menu_version" +
" " + version +
" (" +
g_Game.GetDatabaseID() +
")";
625 version =
"#main_menu_version" +
" " + version;
630 #ifdef PLATFORM_CONSOLE
645 super.Update(timeslice);
650 #ifdef PLATFORM_CONSOLE
656 if (
g_Game.GetUIManager().IsDialogVisible())
661 if (
GetUApi().GetInputByID(UAUITabLeft).LocalPress())
665 else if (
GetUApi().GetInputByID(UAUITabRight).LocalPress())
669 else if (
GetUApi().GetInputByID(UAUICtrlX).LocalPress())
676 else if (
GetUApi().GetInputByID(UAUICredits).LocalPress())
684 else if (
GetUApi().GetInputByID(UAUICtrlY).LocalPress())
688 else if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
702 if (w.IsInherited(ButtonWidget))
704 ButtonWidget button = ButtonWidget.Cast(w);
705 button.SetTextColor(
ARGB(255, 200, 0, 0));
708 w.SetColor(
ARGB(255, 0, 0, 0));
713 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() +
"_image"));
714 Widget option =
Widget.Cast(w.FindAnyWidget(w.GetName() +
"_option_wrapper"));
715 Widget option_label = w.FindAnyWidget(
"option_label");
719 text1.SetColor(
ARGB(255, 255, 0, 0));
724 text2.SetColor(
ARGB(255, 255, 0, 0));
729 text3.SetColor(
ARGB(255, 255, 0, 0));
735 image.SetColor(
ARGB(255, 200, 0, 0));
740 option.SetColor(
ARGB(255, 255, 0, 0));
745 option_label.SetColor(
ARGB(255, 255, 0, 0));
756 if (w.IsInherited(ButtonWidget))
758 ButtonWidget button = ButtonWidget.Cast(w);
759 button.SetTextColor(
ARGB(255, 255, 255, 255));
765 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() +
"_image"));
766 Widget option = w.FindAnyWidget(w.GetName() +
"_option_wrapper");
767 Widget option_label = w.FindAnyWidget(
"option_label");
771 text1.SetColor(
ARGB(255, 255, 255, 255));
776 text2.SetColor(
ARGB(255, 255, 255, 255));
781 text3.SetColor(
ARGB(255, 255, 255, 255));
787 image.SetColor(
ARGB(255, 255, 255, 255));
792 option.SetColor(
ARGB(150, 255, 255, 255));
797 option_label.SetColor(
ARGB(255, 255, 255, 255));
803 #ifdef PLATFORM_WINDOWS
809 ButtonWidget button = ButtonWidget.Cast(w);
819 #ifdef PLATFORM_CONSOLE
822 if (
g_Game.GetUIManager().IsDialogVisible() ||
g_Game.GetUIManager().IsDialogQueued())
844 toolbar_text.SetText(text);
859 bool toolbarShow =
false;
860 #ifdef PLATFORM_CONSOLE
864 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(toolbarShow);
865 layoutRoot.FindAnyWidget(
"play_panel_root").Show(!toolbarShow);
proto native UIManager GetUIManager()
proto native WorkspaceWidget GetWorkspace()
proto native void EndOptionsVideo()
proto void GetVersion(out string version)
proto native Input GetInput()
proto native Mission GetMission()
Super root of all classes in Enforce script.
static int COLOR_DISABLED_TEXT
ScriptInvoker GetOnInputDeviceChanged()
ScriptInvoker GetOnInputPresetChanged()
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
void ShowUICursor(bool visible)
bool Back()
Close top window on windows stack, returns true when any window is closed.
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
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.
int ARGB(int a, int r, int g, int b)