input: fix custom pad config loading

This commit is contained in:
Megamouse 2021-09-05 03:12:23 +02:00
parent 17fb601c02
commit aca9884e76
2 changed files with 19 additions and 8 deletions

View file

@ -91,8 +91,14 @@ void pad_thread::Init()
g_cfg_profile.load();
std::string 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);
}
// Load in order to get the pad handlers
if (!g_cfg_input.load(pad::g_title_id, g_cfg_profile.active_profiles.get_value(pad::g_title_id)))
if (!g_cfg_input.load(pad::g_title_id, active_profile))
{
input_log.notice("Loaded empty pad config");
}
@ -105,7 +111,7 @@ void pad_thread::Init()
}
// Reload with proper defaults
if (!g_cfg_input.load(pad::g_title_id, g_cfg_profile.active_profiles.get_value(pad::g_title_id)))
if (!g_cfg_input.load(pad::g_title_id, active_profile))
{
input_log.notice("Reloaded empty pad config");
}