diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2018-05-26 17:19:13 -0500 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2018-07-07 13:02:39 -0500 |
| commit | bce8041cce88926adf68c7b35b4e79d72420bb36 (patch) | |
| tree | 958a7aab549b6880769aa6ef354fad7b8632051a /Source/Core/InputCommon/InputConfig.cpp | |
| parent | 3b11066e6168a4c266ab30dd2805f8148c00f1a1 (diff) | |
Input: Allow per-game configuration to specify directories for input-profiles. If specified, the directories are searched recursively for inis
Diffstat (limited to 'Source/Core/InputCommon/InputConfig.cpp')
| -rw-r--r-- | Source/Core/InputCommon/InputConfig.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Source/Core/InputCommon/InputConfig.cpp b/Source/Core/InputCommon/InputConfig.cpp index 1ba44c047e..ac74c0ea7e 100644 --- a/Source/Core/InputCommon/InputConfig.cpp +++ b/Source/Core/InputCommon/InputConfig.cpp @@ -15,6 +15,7 @@ #include "InputCommon/ControllerEmu/ControllerEmu.h" #include "InputCommon/ControllerInterface/ControllerInterface.h" #include "InputCommon/InputConfig.h" +#include "InputCommon/InputProfile.h" InputConfig::InputConfig(const std::string& ini_name, const std::string& gui_name, const std::string& profile_name) @@ -56,22 +57,21 @@ bool InputConfig::LoadConfig(bool isGC) std::string profile_setting; if (control_section->Get(type + "Profile" + num[i], &profile_setting)) { - // Setting can contain commas, which means there are multiple profiles specified - // this is used for controller cycling - const auto& profile_options = SplitString(profile_setting, ','); + auto profiles = InputProfile::GetProfilesFromSetting( + profile_setting, File::GetUserPath(D_CONFIG_IDX) + path); - // Use the first profile by default - profile[i] = profile_options[0]; - - if (File::Exists(File::GetUserPath(D_CONFIG_IDX) + path + profile[i] + ".ini")) - { - useProfile[i] = true; - } - else + if (profiles.empty()) { + const std::string error = + "No profiles found for game setting '" + profile_setting + "'"; // TODO: PanicAlert shouldn't be used for this. - PanicAlertT("Selected controller profile does not exist"); + PanicAlertT("%s", error.c_str()); + continue; } + + // Use the first profile by default + profile[i] = profiles[0]; + useProfile[i] = true; } } } |
