mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01:00
input: fix custom pad config loading
This commit is contained in:
parent
17fb601c02
commit
aca9884e76
@ -6,18 +6,23 @@ LOG_CHANNEL(input_log, "Input");
|
||||
|
||||
bool cfg_input::load(const std::string& title_id, const std::string& profile, bool strict)
|
||||
{
|
||||
// Check custom config first
|
||||
input_log.notice("Loading pad config (title_id='%s', profile='%s', strict=%d)", title_id, profile, strict);
|
||||
|
||||
std::string cfg_name;
|
||||
|
||||
if (title_id.empty())
|
||||
{
|
||||
cfg_name = rpcs3::utils::get_input_config_dir() + profile + ".yml";
|
||||
}
|
||||
else
|
||||
// Check custom config first
|
||||
if (!title_id.empty())
|
||||
{
|
||||
cfg_name = rpcs3::utils::get_custom_input_config_path(title_id);
|
||||
}
|
||||
|
||||
// Check active global profile next
|
||||
if ((title_id.empty() || !strict) && !fs::is_file(cfg_name))
|
||||
{
|
||||
cfg_name = rpcs3::utils::get_input_config_dir() + profile + ".yml";
|
||||
}
|
||||
|
||||
// Fallback to default profile
|
||||
if (!strict && !fs::is_file(cfg_name))
|
||||
{
|
||||
cfg_name = rpcs3::utils::get_input_config_dir() + g_cfg_profile.default_profile + ".yml";
|
||||
|
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user