Add motion controls toggle (#2029)

* Add motion controls toggle

* clang
This commit is contained in:
kalaposfos13 2025-01-07 10:50:54 +01:00 committed by GitHub
parent 86038e6a71
commit c3ecf599ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 39 additions and 17 deletions

View file

@ -339,6 +339,8 @@ void SettingsDialog::LoadValuesFromConfig() {
toml::find_or<std::string>(data, "Input", "backButtonBehavior", "left"));
int index = ui->backButtonBehaviorComboBox->findData(backButtonBehavior);
ui->backButtonBehaviorComboBox->setCurrentIndex(index != -1 ? index : 0);
ui->motionControlsCheckBox->setChecked(
toml::find_or<bool>(data, "Input", "isMotionControlsEnabled", true));
ui->removeFolderButton->setEnabled(!ui->gameFoldersListWidget->selectedItems().isEmpty());
ResetInstallFolders();
@ -532,6 +534,7 @@ void SettingsDialog::UpdateSettings() {
const QVector<std::string> TouchPadIndex = {"left", "center", "right", "none"};
Config::setBackButtonBehavior(TouchPadIndex[ui->backButtonBehaviorComboBox->currentIndex()]);
Config::setIsMotionControlsEnabled(ui->motionControlsCheckBox->isChecked());
Config::setFullscreenMode(ui->fullscreenCheckBox->isChecked());
Config::setisTrophyPopupDisabled(ui->disableTrophycheckBox->isChecked());
Config::setPlayBGM(ui->playBGMCheckBox->isChecked());

View file

@ -815,6 +815,13 @@
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="motionControlsCheckBox">
<property name="text">
<string>Enable Motion Controls</string>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="controllerWidgetSpacer" native="true">
<property name="enabled">