InputCommon: Use distinct values for profile key

Because the last commit made us use separate folders for GCPad and
GCKey profiles, we should also use separate game INI keys for them.
Otherwise setting e.g. PadProfile1 in a game INI will make both GCPad
and GCKey try to load it, typically with one of them succeeding and the
other one showing a panic alert due to the profile not existing in its
folder.

Better do this breaking change for GCKeys in the same PR as the other
breaking change rather than later.
This commit is contained in:
JosJuice 2024-02-04 17:36:15 +01:00
parent 6cf55ab1ee
commit 1315b54ffa
8 changed files with 11 additions and 33 deletions

View file

@ -20,9 +20,9 @@
#include "InputCommon/InputProfile.h"
InputConfig::InputConfig(const std::string& ini_name, const std::string& gui_name,
const std::string& profile_directory_name, InputClass input_class)
const std::string& profile_directory_name, const std::string& profile_key)
: m_ini_name(ini_name), m_gui_name(gui_name), m_profile_directory_name(profile_directory_name),
m_input_class(input_class)
m_profile_key(profile_key)
{
}
@ -159,20 +159,6 @@ bool InputConfig::ControllersNeedToBeCreated() const
return m_controllers.empty();
}
std::string InputConfig::GetProfileKey() const
{
switch (m_input_class)
{
case InputClass::GBA:
return "GBA";
case InputClass::Wii:
return "Wiimote";
case InputClass::GC:
default:
return "Pad";
}
}
std::string InputConfig::GetUserProfileDirectoryPath() const
{
return fmt::format("{}Profiles/{}/", File::GetUserPath(D_CONFIG_IDX), GetProfileDirectoryName());