mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 20:15:38 +00:00
Added an input device settings entry to the main menu.
This commit is contained in:
parent
83b764cf1f
commit
8f3ea88b7a
|
@ -48,6 +48,10 @@ GuiMenu::GuiMenu(Window* window) : GuiComponent(window),
|
||||||
|
|
||||||
addEntry("SOUND SETTINGS", 0x777777FF, true, [this] { openSoundOptions(); });
|
addEntry("SOUND SETTINGS", 0x777777FF, true, [this] { openSoundOptions(); });
|
||||||
|
|
||||||
|
if (isFullUI)
|
||||||
|
addEntry("INPUT DEVICE SETTINGS", 0x777777FF, true, [this] {
|
||||||
|
openInputDeviceOptions(); });
|
||||||
|
|
||||||
if (isFullUI)
|
if (isFullUI)
|
||||||
addEntry("GAME COLLECTION SETTINGS", 0x777777FF, true, [this] {
|
addEntry("GAME COLLECTION SETTINGS", 0x777777FF, true, [this] {
|
||||||
openCollectionSystemOptions(); });
|
openCollectionSystemOptions(); });
|
||||||
|
@ -55,9 +59,6 @@ GuiMenu::GuiMenu(Window* window) : GuiComponent(window),
|
||||||
if (isFullUI)
|
if (isFullUI)
|
||||||
addEntry("OTHER SETTINGS", 0x777777FF, true, [this] { openOtherOptions(); });
|
addEntry("OTHER SETTINGS", 0x777777FF, true, [this] { openOtherOptions(); });
|
||||||
|
|
||||||
if (isFullUI)
|
|
||||||
addEntry("CONFIGURE INPUT", 0x777777FF, true, [this] { openConfigInput(); });
|
|
||||||
|
|
||||||
if (!Settings::getInstance()->getBool("ForceKiosk") &&
|
if (!Settings::getInstance()->getBool("ForceKiosk") &&
|
||||||
Settings::getInstance()->getString("UIMode") != "kiosk") {
|
Settings::getInstance()->getString("UIMode") != "kiosk") {
|
||||||
if (Settings::getInstance()->getBool("ShowQuitMenu"))
|
if (Settings::getInstance()->getBool("ShowQuitMenu"))
|
||||||
|
@ -750,6 +751,40 @@ void GuiMenu::openSoundOptions()
|
||||||
mWindow->pushGui(s);
|
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<TextComponent>
|
||||||
|
(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()
|
void GuiMenu::openOtherOptions()
|
||||||
{
|
{
|
||||||
auto s = new GuiSettings(mWindow, "OTHER SETTINGS");
|
auto s = new GuiSettings(mWindow, "OTHER SETTINGS");
|
||||||
|
@ -1090,16 +1125,6 @@ void GuiMenu::openOtherOptions()
|
||||||
mWindow->pushGui(s);
|
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()
|
void GuiMenu::openQuitMenu()
|
||||||
{
|
{
|
||||||
if (!Settings::getInstance()->getBool("ShowQuitMenu")) {
|
if (!Settings::getInstance()->getBool("ShowQuitMenu")) {
|
||||||
|
|
|
@ -35,9 +35,10 @@ private:
|
||||||
void openMediaViewerOptions();
|
void openMediaViewerOptions();
|
||||||
void openScreensaverOptions();
|
void openScreensaverOptions();
|
||||||
void openSoundOptions();
|
void openSoundOptions();
|
||||||
|
void openInputDeviceOptions();
|
||||||
|
void openConfigInput();
|
||||||
void openCollectionSystemOptions();
|
void openCollectionSystemOptions();
|
||||||
void openOtherOptions();
|
void openOtherOptions();
|
||||||
void openConfigInput();
|
|
||||||
void openQuitMenu();
|
void openQuitMenu();
|
||||||
|
|
||||||
MenuComponent mMenu;
|
MenuComponent mMenu;
|
||||||
|
|
Loading…
Reference in a new issue