mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
input: fix pad profile override with existing custom pad configs
This commit is contained in:
parent
6d2f7f6e54
commit
292d3faa9e
2 changed files with 14 additions and 11 deletions
|
@ -4,20 +4,28 @@
|
||||||
|
|
||||||
LOG_CHANNEL(input_log, "Input");
|
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)
|
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);
|
input_log.notice("Loading pad config (title_id='%s', profile='%s', strict=%d)", title_id, profile, strict);
|
||||||
|
|
||||||
std::string cfg_name;
|
std::string cfg_name;
|
||||||
|
|
||||||
// Check custom config first
|
// Check profile override first
|
||||||
if (!title_id.empty())
|
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);
|
cfg_name = rpcs3::utils::get_custom_input_config_path(title_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check active global profile next
|
// 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";
|
cfg_name = rpcs3::utils::get_input_config_dir() + profile + ".yml";
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,19 +103,14 @@ void pad_thread::Init()
|
||||||
|
|
||||||
g_cfg_profile.load();
|
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())
|
if (active_profile.empty())
|
||||||
{
|
{
|
||||||
active_profile = g_cfg_profile.active_profiles.get_value(pad::g_title_id);
|
active_profile = g_cfg_profile.active_profiles.get_value(g_cfg_profile.global_key);
|
||||||
|
|
||||||
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);
|
input_log.notice("Using pad profile: '%s' (override='%s')", active_profile, g_pad_profile_override);
|
||||||
|
|
||||||
// Load in order to get the pad handlers
|
// Load in order to get the pad handlers
|
||||||
if (!g_cfg_input.load(pad::g_title_id, active_profile))
|
if (!g_cfg_input.load(pad::g_title_id, active_profile))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue