diff --git a/src/input/input_handler.cpp b/src/input/input_handler.cpp index adc7b76eb..5394e4818 100644 --- a/src/input/input_handler.cpp +++ b/src/input/input_handler.cpp @@ -198,8 +198,8 @@ InputBinding GetBindingFromString(std::string& line) { } void ParseInputConfig(const std::string game_id = "") { - std::string config_file = Config::GetUseUnifiedInputConfig() ? "default" : game_id; - const auto config_file = Config::GetFoolproofKbmConfigFile(config_file); + std::string config_type = Config::GetUseUnifiedInputConfig() ? "default" : game_id; + const auto config_file = Config::GetFoolproofKbmConfigFile(config_type); // we reset these here so in case the user fucks up or doesn't include some of these, // we can fall back to default diff --git a/src/qt_gui/kbm_config_dialog.cpp b/src/qt_gui/kbm_config_dialog.cpp index af198f79d..2051fcf62 100644 --- a/src/qt_gui/kbm_config_dialog.cpp +++ b/src/qt_gui/kbm_config_dialog.cpp @@ -13,6 +13,7 @@ #include "src/sdl_window.h" #include +#include #include #include #include @@ -50,7 +51,16 @@ EditorDialog::EditorDialog(QWidget* parent) : QDialog(parent) { // Load all installed games loadInstalledGames(); + QCheckBox* unifiedInputCheckBox = new QCheckBox("Use Per-Game configs", this); + unifiedInputCheckBox->setChecked(!Config::GetUseUnifiedInputConfig()); + + // Connect checkbox signal + connect(unifiedInputCheckBox, &QCheckBox::toggled, this, [](bool checked) { + Config::SetUseUnifiedInputConfig(!checked); + Config::save(Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "config.toml"); + }); // Create Save, Cancel, and Help buttons + Config::SetUseUnifiedInputConfig(!Config::GetUseUnifiedInputConfig()); QPushButton* saveButton = new QPushButton("Save", this); QPushButton* cancelButton = new QPushButton("Cancel", this); QPushButton* helpButton = new QPushButton("Help", this); @@ -58,6 +68,7 @@ EditorDialog::EditorDialog(QWidget* parent) : QDialog(parent) { // Layout for the game selection and buttons QHBoxLayout* topLayout = new QHBoxLayout(); + topLayout->addWidget(unifiedInputCheckBox); topLayout->addWidget(gameComboBox); topLayout->addStretch(); topLayout->addWidget(saveButton); diff --git a/src/qt_gui/kbm_help_dialog.h b/src/qt_gui/kbm_help_dialog.h index 8d543b7e7..c482d2b5c 100644 --- a/src/qt_gui/kbm_help_dialog.h +++ b/src/qt_gui/kbm_help_dialog.h @@ -70,6 +70,12 @@ A: The code recognises the line as wrong, and skip it, so the rest of the file w Q: I want to bind to , but your code doesn't support ! A: Some keys are intentionally omitted, but if you read the bindings through, and you're sure it is not there and isn't one of the intentionally disabled ones, open an issue on https://github.com/shadps4-emu/shadPS4. + +Q: What does default.ini do? +A: If you're using per-game configs, it's the base from which all new games generate their config file. If you use the unified config, then this is used for every game directly instead. + +Q: What does the use Per-game Config checkbox do? +A: It controls whether the config is loaded from CUSAXXXXX.ini for a game, or from default.ini. This way, if you only want to manage one set of bindings, you can do so, but if you want to use a different setup for every game, that's possible as well. )"; } QString syntax() {