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:
parent
6cf55ab1ee
commit
1315b54ffa
|
@ -313,7 +313,7 @@ void FreeLookController::UpdateInput(CameraControllerInput* camera_controller)
|
||||||
namespace FreeLook
|
namespace FreeLook
|
||||||
{
|
{
|
||||||
static InputConfig s_config("FreeLookController", _trans("FreeLook"), "FreeLookController",
|
static InputConfig s_config("FreeLookController", _trans("FreeLook"), "FreeLookController",
|
||||||
InputConfig::InputClass::GC);
|
"FreeLookController");
|
||||||
InputConfig* GetInputConfig()
|
InputConfig* GetInputConfig()
|
||||||
{
|
{
|
||||||
return &s_config;
|
return &s_config;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
namespace Pad
|
namespace Pad
|
||||||
{
|
{
|
||||||
static InputConfig s_config("GBA", _trans("Pad"), "GBA", InputConfig::InputClass::GBA);
|
static InputConfig s_config("GBA", _trans("Pad"), "GBA", "GBA");
|
||||||
InputConfig* GetGBAConfig()
|
InputConfig* GetGBAConfig()
|
||||||
{
|
{
|
||||||
return &s_config;
|
return &s_config;
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
namespace Keyboard
|
namespace Keyboard
|
||||||
{
|
{
|
||||||
static InputConfig s_config("GCKeyNew", _trans("Keyboard"), "GCKey", InputConfig::InputClass::GC);
|
static InputConfig s_config("GCKeyNew", _trans("Keyboard"), "GCKey", "GCKey");
|
||||||
InputConfig* GetConfig()
|
InputConfig* GetConfig()
|
||||||
{
|
{
|
||||||
return &s_config;
|
return &s_config;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
namespace Pad
|
namespace Pad
|
||||||
{
|
{
|
||||||
static InputConfig s_config("GCPadNew", _trans("Pad"), "GCPad", InputConfig::InputClass::GC);
|
static InputConfig s_config("GCPadNew", _trans("Pad"), "GCPad", "Pad");
|
||||||
InputConfig* GetConfig()
|
InputConfig* GetConfig()
|
||||||
{
|
{
|
||||||
return &s_config;
|
return &s_config;
|
||||||
|
|
|
@ -97,8 +97,7 @@ HIDWiimote* GetHIDWiimoteSource(unsigned int index)
|
||||||
|
|
||||||
namespace Wiimote
|
namespace Wiimote
|
||||||
{
|
{
|
||||||
static InputConfig s_config(WIIMOTE_INI_NAME, _trans("Wii Remote"), "Wiimote",
|
static InputConfig s_config(WIIMOTE_INI_NAME, _trans("Wii Remote"), "Wiimote", "Wiimote");
|
||||||
InputConfig::InputClass::Wii);
|
|
||||||
|
|
||||||
InputConfig* GetConfig()
|
InputConfig* GetConfig()
|
||||||
{
|
{
|
||||||
|
|
|
@ -207,7 +207,7 @@ static std::array<u32, NUM_HOTKEY_GROUPS> s_hotkey_down;
|
||||||
static HotkeyStatus s_hotkey;
|
static HotkeyStatus s_hotkey;
|
||||||
static bool s_enabled;
|
static bool s_enabled;
|
||||||
|
|
||||||
static InputConfig s_config("Hotkeys", _trans("Hotkeys"), "Hotkeys", InputConfig::InputClass::GC);
|
static InputConfig s_config("Hotkeys", _trans("Hotkeys"), "Hotkeys", "Hotkeys");
|
||||||
|
|
||||||
InputConfig* GetConfig()
|
InputConfig* GetConfig()
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
#include "InputCommon/InputProfile.h"
|
#include "InputCommon/InputProfile.h"
|
||||||
|
|
||||||
InputConfig::InputConfig(const std::string& ini_name, const std::string& gui_name,
|
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_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();
|
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
|
std::string InputConfig::GetUserProfileDirectoryPath() const
|
||||||
{
|
{
|
||||||
return fmt::format("{}Profiles/{}/", File::GetUserPath(D_CONFIG_IDX), GetProfileDirectoryName());
|
return fmt::format("{}Profiles/{}/", File::GetUserPath(D_CONFIG_IDX), GetProfileDirectoryName());
|
||||||
|
|
|
@ -24,15 +24,8 @@ class EmulatedController;
|
||||||
class InputConfig
|
class InputConfig
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum class InputClass
|
|
||||||
{
|
|
||||||
GC,
|
|
||||||
Wii,
|
|
||||||
GBA,
|
|
||||||
};
|
|
||||||
|
|
||||||
InputConfig(const std::string& ini_name, const std::string& gui_name,
|
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);
|
||||||
|
|
||||||
~InputConfig();
|
~InputConfig();
|
||||||
|
|
||||||
|
@ -51,7 +44,7 @@ public:
|
||||||
bool IsControllerControlledByGamepadDevice(int index) const;
|
bool IsControllerControlledByGamepadDevice(int index) const;
|
||||||
|
|
||||||
std::string GetGUIName() const { return m_gui_name; }
|
std::string GetGUIName() const { return m_gui_name; }
|
||||||
std::string GetProfileKey() const;
|
std::string GetProfileKey() const { return m_profile_key; }
|
||||||
std::string GetProfileDirectoryName() const { return m_profile_directory_name; }
|
std::string GetProfileDirectoryName() const { return m_profile_directory_name; }
|
||||||
std::string GetUserProfileDirectoryPath() const;
|
std::string GetUserProfileDirectoryPath() const;
|
||||||
std::string GetSysProfileDirectoryPath() const;
|
std::string GetSysProfileDirectoryPath() const;
|
||||||
|
@ -69,6 +62,6 @@ private:
|
||||||
const std::string m_ini_name;
|
const std::string m_ini_name;
|
||||||
const std::string m_gui_name;
|
const std::string m_gui_name;
|
||||||
const std::string m_profile_directory_name;
|
const std::string m_profile_directory_name;
|
||||||
const InputClass m_input_class;
|
const std::string m_profile_key;
|
||||||
InputCommon::DynamicInputTextureManager m_dynamic_input_tex_config_manager;
|
InputCommon::DynamicInputTextureManager m_dynamic_input_tex_config_manager;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue