mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-28 08:37:06 +00:00
input: fix pad profile override with existing custom pad configs
This commit is contained in:
parent
6d2f7f6e54
commit
292d3faa9e
@ -4,20 +4,28 @@
|
||||
|
||||
LOG_CHANNEL(input_log, "Input");
|
||||
|
||||
extern std::string g_pad_profile_override;
|
||||
|
||||
bool cfg_input::load(const std::string& title_id, const std::string& profile, bool strict)
|
||||
{
|
||||
input_log.notice("Loading pad config (title_id='%s', profile='%s', strict=%d)", title_id, profile, strict);
|
||||
|
||||
std::string cfg_name;
|
||||
|
||||
// Check custom config first
|
||||
if (!title_id.empty())
|
||||
// Check profile override first
|
||||
if (!strict && !g_pad_profile_override.empty())
|
||||
{
|
||||
cfg_name = rpcs3::utils::get_input_config_dir() + g_pad_profile_override + ".yml";
|
||||
}
|
||||
|
||||
// Check custom config next
|
||||
if (!title_id.empty() && !fs::is_file(cfg_name))
|
||||
{
|
||||
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))
|
||||
if ((title_id.empty() || !strict) && !profile.empty() && !fs::is_file(cfg_name))
|
||||
{
|
||||
cfg_name = rpcs3::utils::get_input_config_dir() + profile + ".yml";
|
||||
}
|
||||
|
@ -103,19 +103,14 @@ void pad_thread::Init()
|
||||
|
||||
g_cfg_profile.load();
|
||||
|
||||
std::string active_profile = g_pad_profile_override;
|
||||
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(pad::g_title_id);
|
||||
|
||||
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(g_cfg_profile.global_key);
|
||||
}
|
||||
|
||||
input_log.notice("Using pad profile: '%s'", active_profile);
|
||||
input_log.notice("Using pad profile: '%s' (override='%s')", active_profile, g_pad_profile_override);
|
||||
|
||||
// Load in order to get the pad handlers
|
||||
if (!g_cfg_input.load(pad::g_title_id, active_profile))
|
||||
|
Loading…
x
Reference in New Issue
Block a user