Remapping: Documentation and defaults update + add option to use a unified config (#2302)

* Add a toggle to use unified or per-game configs, and add a deadzone example to the default config

* Add a checkbox to toggle config type

* clang
This commit is contained in:
kalaposfos13 2025-01-31 17:41:11 +01:00 committed by GitHub
parent c4bfaa6031
commit 9aa6c5b951
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 36 additions and 6 deletions

View file

@ -12,6 +12,7 @@
#include "game_info.h"
#include "src/sdl_window.h"
#include <QCheckBox>
#include <QCloseEvent>
#include <QComboBox>
#include <QFile>
@ -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);