32 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/options/pc/keybinding_menu.layout", null);
34 m_Version = TextWidget.Cast(layoutRoot.FindAnyWidget(
"version"));
35 m_Apply = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"apply"));
36 m_Back = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"back"));
37 m_Undo = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"undo"));
38 m_Defaults = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"reset"));
39 m_HardReset = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"reset_all"));
41 layoutRoot.FindAnyWidget(
"Tabber").GetScript(m_Tabber);
45 #ifdef PLATFORM_CONSOLE
46 version =
"#main_menu_version" +
" " + version +
" (" +
g_Game.GetDatabaseID() +
")";
48 version =
"#main_menu_version" +
" " + version;
50 m_Version.SetText(version);
53 string back =
"circle";
57 ImageWidget toolbar_b = ImageWidget.Cast(layoutRoot.FindAnyWidget(
"BackIcon"));
58 toolbar_b.LoadImageFile(0,
"set:playstation_buttons image:" + back);
65 InitPresets(-1, layoutRoot.FindAnyWidget(
"group_header"), input);
66 m_Tabber.m_OnTabSwitch.Insert(UpdateTabContent);
67 m_Tabber.SelectTabControl(0);
68 m_Tabber.SelectTabPanel(0);
69 g_Game.SetKeyboardHandle(
this);
70 m_Tabber.RefreshTab(
true);
233 if (m_CurrentSettingKeyIndex != -1)
239 if (m_CurrentSettingAlternateKeyIndex != -1)
245 bool changed = m_GroupsContainer.IsChanged();
249 g_Game.GetUIManager().ShowDialog(
"#main_menu_configure",
"#main_menu_configure_desc", MODAL_ID_BACK, DBT_YESNO, DBB_YES, DMT_QUESTION,
this);
253 GetGame().GetUIManager().Back();
301 if (code == MODAL_ID_BACK)
303 if (result == DBB_YES)
306 GetGame().GetUIManager().Back();
310 else if (code == MODAL_ID_DEFAULT)
312 if (result == DBB_YES)
318 else if (code == MODAL_ID_DEFAULT_ALL)
320 if (result == DBB_YES)
325 else if (code == MODAL_ID_PRESET_CHANGE)
327 if (result == DBB_YES)
330 m_PresetSelector.PerformSetOption(m_TargetPresetIndex);
470 Widget kb_root = parent.FindAnyWidget(
"keyboard_dropown");
479 for (
int i = 0; i < input.GetProfilesCount(); i++)
481 input.GetProfileName(i, profile_text);
482 opt1.Insert(profile_text);
485 int current_idx = input.GetCurrentProfile();
486 m_OriginalPresetIndex = current_idx;
487 m_PresetSelector =
new OptionSelectorMultistate(layoutRoot.FindAnyWidget(
"profile_setting_option"), current_idx, null,
false, opt1);
488 m_PresetSelector.m_AttemptOptionChange.Insert(OnAttemptSelectPreset);
489 m_PresetSelector.m_OptionChanged.Insert(OnSelectKBPreset);
494 bool changed = m_GroupsContainer.IsChanged() && m_OriginalPresetIndex != index;
495 m_TargetPresetIndex = index;
499 g_Game.GetUIManager().ShowDialog(
"#main_menu_configure",
"#main_menu_configure_desc", MODAL_ID_PRESET_CHANGE, DBT_YESNO, DBB_YES, DMT_QUESTION,
this);
502 m_PresetSelector.SetCanSwitch(!changed);