From 5c5cc8453dd6738017043bbffd15b5e4ff61505a Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Thu, 2 Feb 2023 21:48:33 +0100 Subject: [PATCH] RMG: correct remove duplicate keybindings in SettingsDialog --- .../UserInterface/Dialog/SettingsDialog.cpp | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Source/RMG/UserInterface/Dialog/SettingsDialog.cpp b/Source/RMG/UserInterface/Dialog/SettingsDialog.cpp index 5a0cff91..c59b8d60 100644 --- a/Source/RMG/UserInterface/Dialog/SettingsDialog.cpp +++ b/Source/RMG/UserInterface/Dialog/SettingsDialog.cpp @@ -1139,16 +1139,22 @@ void SettingsDialog::on_KeybindButton_KeybindingChanged(KeybindButton* button) return; } - KeybindButton* keybindButtons[] = + QList rombrowserKeybindButtons = { this->startRomKeyButton, this->startComboKeyButton, this->shutdownKeyButton, - this->refreshRomListKeyButton, this->exitKeyButton, + this->settingsKeyButton, + this->refreshRomListKeyButton, + }; + + QList emulationKeybindButtons = + { + this->shutdownKeyButton, this->softResetKeyButton, this->hardResetKeyButton, - this->pauseKeyButton, + this->pauseKeyButton, this->generateBitmapKeyButton, this->limitFPSKeyButton, this->saveStateKeyButton, @@ -1167,10 +1173,22 @@ void SettingsDialog::on_KeybindButton_KeybindingChanged(KeybindButton* button) this->saveState7KeyButton, this->saveState8KeyButton, this->saveState9KeyButton, + this->exitKeyButton, this->settingsKeyButton, this->fullscreenKeyButton, }; - + + QList keybindButtons; + + if (rombrowserKeybindButtons.contains(button)) + { + keybindButtons.append(rombrowserKeybindButtons); + } + if (emulationKeybindButtons.contains(button)) + { + keybindButtons.append(emulationKeybindButtons); + } + for (KeybindButton* keybindButton : keybindButtons) { if (keybindButton != button)