Changed the menu position for the button swap setting

This commit is contained in:
Leon Styhre 2024-01-17 22:31:10 +01:00
parent 0e636f1bb3
commit 8244b4229b
2 changed files with 12 additions and 12 deletions

View file

@ -1280,6 +1280,17 @@ void GuiMenu::openInputDeviceOptions()
}
});
// Whether to swap the A/B and X/Y buttons.
auto inputSwapButtons = std::make_shared<SwitchComponent>();
inputSwapButtons->setState(Settings::getInstance()->getBool("InputSwapButtons"));
s->addWithLabel("SWAP A/B AND X/Y BUTTONS", inputSwapButtons);
s->addSaveFunc([inputSwapButtons, s] {
if (Settings::getInstance()->getBool("InputSwapButtons") != inputSwapButtons->getState()) {
Settings::getInstance()->setBool("InputSwapButtons", inputSwapButtons->getState());
s->setNeedsSaving();
}
});
// Whether to ignore keyboard input (except the quit shortcut).
auto inputIgnoreKeyboard = std::make_shared<SwitchComponent>();
inputIgnoreKeyboard->setState(Settings::getInstance()->getBool("InputIgnoreKeyboard"));
@ -1293,17 +1304,6 @@ void GuiMenu::openInputDeviceOptions()
}
});
// Whether to swap the A/B and X/Y buttons.
auto inputSwapButtons = std::make_shared<SwitchComponent>();
inputSwapButtons->setState(Settings::getInstance()->getBool("InputSwapButtons"));
s->addWithLabel("SWAP A/B AND X/Y BUTTONS", inputSwapButtons);
s->addSaveFunc([inputSwapButtons, s] {
if (Settings::getInstance()->getBool("InputSwapButtons") != inputSwapButtons->getState()) {
Settings::getInstance()->setBool("InputSwapButtons", inputSwapButtons->getState());
s->setNeedsSaving();
}
});
// Configure keyboard and controllers.
ComponentListRow configureInputRow;
configureInputRow.elements.clear();

View file

@ -245,8 +245,8 @@ void Settings::setDefaults()
mBoolMap["InputTouchOverlay"] = {true, true};
#endif
mBoolMap["InputOnlyFirstController"] = {false, false};
mBoolMap["InputIgnoreKeyboard"] = {false, false};
mBoolMap["InputSwapButtons"] = {false, false};
mBoolMap["InputIgnoreKeyboard"] = {false, false};
// Game collection settings.
mStringMap["CollectionSystemsAuto"] = {"", ""};