diff --git a/pcsx2/VMManager.cpp b/pcsx2/VMManager.cpp index 77955fdcdd..91691d90df 100644 --- a/pcsx2/VMManager.cpp +++ b/pcsx2/VMManager.cpp @@ -439,8 +439,13 @@ bool VMManager::UpdateGameSettingsLayer() } std::string input_profile_name; + bool use_game_settings_for_controller = false; if (new_interface) - new_interface->GetStringValue("EmuCore", "InputProfileName", &input_profile_name); + { + new_interface->GetBoolValue("Pad", "UseGameSettingsForController", &use_game_settings_for_controller); + if (!use_game_settings_for_controller) + new_interface->GetStringValue("EmuCore", "InputProfileName", &input_profile_name); + } if (!s_game_settings_interface && !new_interface && s_input_profile_name == input_profile_name) return false; @@ -449,32 +454,39 @@ bool VMManager::UpdateGameSettingsLayer() s_game_settings_interface = std::move(new_interface); std::unique_ptr input_interface; - if (!input_profile_name.empty()) + if (!use_game_settings_for_controller) { - const std::string filename(GetInputProfilePath(input_profile_name)); - if (FileSystem::FileExists(filename.c_str())) + if (!input_profile_name.empty()) { - Console.WriteLn("Loading input profile from '%s'...", filename.c_str()); - input_interface = std::make_unique(std::move(filename)); - if (!input_interface->Load()) + const std::string filename(GetInputProfilePath(input_profile_name)); + if (FileSystem::FileExists(filename.c_str())) { - Console.Error("Failed to parse input profile ini '%s'", input_interface->GetFileName().c_str()); - input_interface.reset(); + Console.WriteLn("Loading input profile from '%s'...", filename.c_str()); + input_interface = std::make_unique(std::move(filename)); + if (!input_interface->Load()) + { + Console.Error("Failed to parse input profile ini '%s'", input_interface->GetFileName().c_str()); + input_interface.reset(); + input_profile_name = {}; + } + } + else + { + DevCon.WriteLn("No game settings found (tried '%s')", filename.c_str()); input_profile_name = {}; } } - else - { - DevCon.WriteLn("No game settings found (tried '%s')", filename.c_str()); - input_profile_name = {}; - } + + Host::Internal::SetInputSettingsLayer(input_interface.get()); + } + else + { + // using game settings for bindings too + Host::Internal::SetInputSettingsLayer(s_game_settings_interface.get()); } - Host::Internal::SetInputSettingsLayer(input_interface.get()); s_input_settings_interface = std::move(input_interface); s_input_profile_name = std::move(input_profile_name); - - return true; }