cli: Add option to boot a game with a specific pad profile

This commit is contained in:
Megamouse 2023-02-07 21:51:32 +01:00
parent 088ac71930
commit bc487f43f7
2 changed files with 28 additions and 2 deletions

View file

@ -28,6 +28,7 @@ LOG_CHANNEL(input_log, "Input");
LOG_CHANNEL(sys_log, "SYS");
extern bool is_input_allowed();
extern std::string g_pad_profile_override;
namespace pad
{
@ -102,10 +103,16 @@ void pad_thread::Init()
g_cfg_profile.load();
std::string active_profile = g_cfg_profile.active_profiles.get_value(pad::g_title_id);
std::string active_profile = g_pad_profile_override;
if (active_profile.empty())
{
active_profile = g_cfg_profile.active_profiles.get_value(g_cfg_profile.global_key);
active_profile = g_cfg_profile.active_profiles.get_value(pad::g_title_id);
if (active_profile.empty())
{
active_profile = g_cfg_profile.active_profiles.get_value(g_cfg_profile.global_key);
}
}
input_log.notice("Using pad profile: '%s'", active_profile);