InputConfigDialog: more DRY (#1238)

This commit is contained in:
scurest 2021-10-10 15:51:08 -05:00 committed by GitHub
parent e0052049b0
commit a8613af2bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -201,19 +201,19 @@ void InputConfigDialog::populatePage(QWidget* page, int num, const char** labels
void InputConfigDialog::on_InputConfigDialog_accepted() void InputConfigDialog::on_InputConfigDialog_accepted()
{ {
for (int i = 0; i < 12; i++) for (int i = 0; i < keypad_num; i++)
{ {
Config::KeyMapping[dskeyorder[i]] = keypadKeyMap[i]; Config::KeyMapping[dskeyorder[i]] = keypadKeyMap[i];
Config::JoyMapping[dskeyorder[i]] = keypadJoyMap[i]; Config::JoyMapping[dskeyorder[i]] = keypadJoyMap[i];
} }
for (int i = 0; i < 2; i++) for (int i = 0; i < hk_addons_num; i++)
{ {
Config::HKKeyMapping[hk_addons[i]] = addonsKeyMap[i]; Config::HKKeyMapping[hk_addons[i]] = addonsKeyMap[i];
Config::HKJoyMapping[hk_addons[i]] = addonsJoyMap[i]; Config::HKJoyMapping[hk_addons[i]] = addonsJoyMap[i];
} }
for (int i = 0; i < 9; i++) for (int i = 0; i < hk_general_num; i++)
{ {
Config::HKKeyMapping[hk_general[i]] = hkGeneralKeyMap[i]; Config::HKKeyMapping[hk_general[i]] = hkGeneralKeyMap[i];
Config::HKJoyMapping[hk_general[i]] = hkGeneralJoyMap[i]; Config::HKJoyMapping[hk_general[i]] = hkGeneralJoyMap[i];