PAD: Split set default controller and hotkey settings

This commit is contained in:
Connor McLaughlin 2022-09-06 23:00:57 +10:00 committed by refractionpcsx2
parent 291063bd98
commit 1b3bf89ee8
5 changed files with 12 additions and 5 deletions

View File

@ -251,7 +251,8 @@ void QtHost::SetDefaultConfig()
}
EmuFolders::Save(si);
PAD::SetDefaultConfig(si);
PAD::SetDefaultControllerConfig(si);
PAD::SetDefaultHotkeyConfig(si);
}
void QtHost::SetBaseBoolSettingValue(const char* section, const char* key, bool value)

View File

@ -206,7 +206,8 @@ void ControllerSettingsDialog::onRestoreDefaultsClicked()
// actually restore it
{
auto lock = Host::GetSettingsLock();
PAD::SetDefaultConfig(*Host::Internal::GetBaseSettingsLayer());
PAD::SetDefaultControllerConfig(*Host::Internal::GetBaseSettingsLayer());
PAD::SetDefaultHotkeyConfig(*Host::Internal::GetBaseSettingsLayer());
QtHost::QueueSettingsSave();
}

View File

@ -2918,7 +2918,8 @@ void FullscreenUI::ResetControllerSettings()
{
SettingsInterface* dsi = GetEditingSettingsInterface();
PAD::SetDefaultConfig(*dsi);
PAD::SetDefaultControllerConfig(*dsi);
PAD::SetDefaultHotkeyConfig(*dsi);
ShowToast(std::string(), "Controller settings reset to default.");
}

View File

@ -290,7 +290,7 @@ const char* PAD::GetDefaultPadType(u32 pad)
return (pad == 0) ? "DualShock2" : "None";
}
void PAD::SetDefaultConfig(SettingsInterface& si)
void PAD::SetDefaultControllerConfig(SettingsInterface& si)
{
si.ClearSection("InputSources");
si.ClearSection("Hotkeys");
@ -324,7 +324,10 @@ void PAD::SetDefaultConfig(SettingsInterface& si)
// PCSX2 Controller Settings - Controller 1 / Controller 2 / ...
// Use the automapper to set this up.
MapController(si, 0, InputManager::GetGenericBindingMapping("Keyboard"));
}
void PAD::SetDefaultHotkeyConfig(SettingsInterface& si)
{
// PCSX2 Controller Settings - Hotkeys
// PCSX2 Controller Settings - Hotkeys - General

View File

@ -137,7 +137,8 @@ namespace PAD
void LoadConfig(const SettingsInterface& si);
/// Restores default configuration.
void SetDefaultConfig(SettingsInterface& si);
void SetDefaultControllerConfig(SettingsInterface& si);
void SetDefaultHotkeyConfig(SettingsInterface& si);
/// Clears all bindings for a given port.
void ClearPortBindings(SettingsInterface& si, u32 port);