diff options
| author | Rachel Bryk <RachelBryk@gmail.com> | 2013-01-08 19:15:11 -0500 |
|---|---|---|
| committer | Rachel Bryk <RachelBryk@gmail.com> | 2013-01-08 19:15:11 -0500 |
| commit | b8691df723ab635b3db41e86c9324b3adb952abe (patch) | |
| tree | beee25545995648cf1b32960fc1525c5d984901f /Source/Core/InputCommon/Src/InputConfig.cpp | |
| parent | 4f4aa4860df98f401384f6e598cb649b13882e79 (diff) | |
Allow loading controller profiles from game ini.
Currently loads the same profile for all 4 controllers, and overwrites the default control settings.
Diffstat (limited to 'Source/Core/InputCommon/Src/InputConfig.cpp')
| -rw-r--r-- | Source/Core/InputCommon/Src/InputConfig.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/Src/InputConfig.cpp b/Source/Core/InputCommon/Src/InputConfig.cpp index b9d2a93b99..19be23ec74 100644 --- a/Source/Core/InputCommon/Src/InputConfig.cpp +++ b/Source/Core/InputCommon/Src/InputConfig.cpp @@ -26,10 +26,13 @@ InputPlugin::~InputPlugin() delete *i; } -bool InputPlugin::LoadConfig() +bool InputPlugin::LoadConfig(std::string ini) { IniFile inifile; - if (inifile.Load(File::GetUserPath(D_CONFIG_IDX) + ini_name + ".ini")) + std::string ini2 = ini; + if (ini == "") + ini = ini_name; + if (inifile.Load(File::GetUserPath(D_CONFIG_IDX) + ini + ".ini")) { std::vector< ControllerEmu* >::const_iterator i = controllers.begin(), @@ -37,7 +40,11 @@ bool InputPlugin::LoadConfig() for (; i!=e; ++i) { // load settings from ini - (*i)->LoadConfig(inifile.GetOrCreateSection((*i)->GetName().c_str())); + std::string section; + section = (*i)->GetName(); + if (ini2 != "") + section = "Profile"; + (*i)->LoadConfig(inifile.GetOrCreateSection(section.c_str())); // update refs (*i)->UpdateReferences(g_controller_interface); } |
