diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 15e91baaf..4362b0465 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -48,6 +48,10 @@ GuiMenu::GuiMenu(Window* window) : GuiComponent(window), addEntry("SOUND SETTINGS", 0x777777FF, true, [this] { openSoundOptions(); }); + if (isFullUI) + addEntry("INPUT DEVICE SETTINGS", 0x777777FF, true, [this] { + openInputDeviceOptions(); }); + if (isFullUI) addEntry("GAME COLLECTION SETTINGS", 0x777777FF, true, [this] { openCollectionSystemOptions(); }); @@ -55,9 +59,6 @@ GuiMenu::GuiMenu(Window* window) : GuiComponent(window), if (isFullUI) addEntry("OTHER SETTINGS", 0x777777FF, true, [this] { openOtherOptions(); }); - if (isFullUI) - addEntry("CONFIGURE INPUT", 0x777777FF, true, [this] { openConfigInput(); }); - if (!Settings::getInstance()->getBool("ForceKiosk") && Settings::getInstance()->getString("UIMode") != "kiosk") { if (Settings::getInstance()->getBool("ShowQuitMenu")) @@ -750,6 +751,40 @@ void GuiMenu::openSoundOptions() mWindow->pushGui(s); } +void GuiMenu::openInputDeviceOptions() +{ + auto s = new GuiSettings(mWindow, "INPUT DEVICE SETTINGS"); + + // Configure keyboard and controllers. + ComponentListRow configure_input_row; + configure_input_row.elements.clear(); + configure_input_row.addElement(std::make_shared + (mWindow, "CONFIGURE KEYBOARD AND CONTROLLERS", + Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true); + configure_input_row.addElement(makeArrow(mWindow), false); + configure_input_row.makeAcceptInputHandler(std::bind(&GuiMenu::openConfigInput, this)); + s->addRow(configure_input_row); + + mWindow->pushGui(s); +} + +void GuiMenu::openConfigInput() +{ + std::string message = + "THE KEYBOARD AND ANY CONNECTED CONTROLLERS\n" + "ARE AUTOMATICALLY CONFIGURED ON STARTUP, BUT\n" + "USING THIS CONFIGURATION TOOL YOU ARE ABLE TO\n" + "OVERRIDE THE DEFAULT BUTTON MAPPINGS (NOTE\n" + "THAT THIS WILL NOT AFFECT THE HELP PROMPTS)\n" + "CONTINUE?"; + + Window* window = mWindow; + window->pushGui(new GuiMsgBox(window, getHelpStyle(), + message, "YES", [window] { + window->pushGui(new GuiDetectDevice(window, false, false, nullptr)); + }, "NO", nullptr)); +} + void GuiMenu::openOtherOptions() { auto s = new GuiSettings(mWindow, "OTHER SETTINGS"); @@ -1090,16 +1125,6 @@ void GuiMenu::openOtherOptions() mWindow->pushGui(s); } -void GuiMenu::openConfigInput() -{ - Window* window = mWindow; - window->pushGui(new GuiMsgBox(window, getHelpStyle(), - "ARE YOU SURE YOU WANT TO CONFIGURE INPUT?", "YES", [window] { - window->pushGui(new GuiDetectDevice(window, false, false, nullptr)); - }, "NO", nullptr) - ); -} - void GuiMenu::openQuitMenu() { if (!Settings::getInstance()->getBool("ShowQuitMenu")) { diff --git a/es-app/src/guis/GuiMenu.h b/es-app/src/guis/GuiMenu.h index 5332a9b68..d255f9ccf 100644 --- a/es-app/src/guis/GuiMenu.h +++ b/es-app/src/guis/GuiMenu.h @@ -35,9 +35,10 @@ private: void openMediaViewerOptions(); void openScreensaverOptions(); void openSoundOptions(); + void openInputDeviceOptions(); + void openConfigInput(); void openCollectionSystemOptions(); void openOtherOptions(); - void openConfigInput(); void openQuitMenu(); MenuComponent mMenu;