CommonHostInterface: Don't save/load input profile rumble for motorless controller types
This commit is contained in:
parent
7249825c16
commit
a5f04f2a8e
|
@ -14,4 +14,3 @@ ButtonL1 = Keyboard/Q
|
||||||
ButtonL2 = Keyboard/1
|
ButtonL2 = Keyboard/1
|
||||||
ButtonR1 = Keyboard/E
|
ButtonR1 = Keyboard/E
|
||||||
ButtonR2 = Keyboard/3
|
ButtonR2 = Keyboard/3
|
||||||
Rumble = Controller0
|
|
||||||
|
|
|
@ -14,4 +14,3 @@ ButtonL1 = Keyboard/Q
|
||||||
ButtonL2 = Keyboard/1
|
ButtonL2 = Keyboard/1
|
||||||
ButtonR1 = Keyboard/E
|
ButtonR1 = Keyboard/E
|
||||||
ButtonR2 = Keyboard/3
|
ButtonR2 = Keyboard/3
|
||||||
Rumble = Controller0
|
|
||||||
|
|
|
@ -1846,9 +1846,12 @@ void CommonHostInterface::ApplyInputProfile(const char* profile_path, SettingsIn
|
||||||
}
|
}
|
||||||
|
|
||||||
si.DeleteValue(section_name, "Rumble");
|
si.DeleteValue(section_name, "Rumble");
|
||||||
|
if (Controller::GetVibrationMotorCount(*ctype) > 0)
|
||||||
|
{
|
||||||
const std::string rumble_value = profile.GetStringValue(section_name, "Rumble");
|
const std::string rumble_value = profile.GetStringValue(section_name, "Rumble");
|
||||||
if (!rumble_value.empty())
|
if (!rumble_value.empty())
|
||||||
si.SetStringValue(section_name, "Rumble", rumble_value.c_str());
|
si.SetStringValue(section_name, "Rumble", rumble_value.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
Controller::SettingList settings = Controller::GetSettings(*ctype);
|
Controller::SettingList settings = Controller::GetSettings(*ctype);
|
||||||
for (const SettingInfo& ssi : settings)
|
for (const SettingInfo& ssi : settings)
|
||||||
|
@ -1903,9 +1906,12 @@ bool CommonHostInterface::SaveInputProfile(const char* profile_path, SettingsInt
|
||||||
profile.AddToStringList(section_name, key_name, binding.c_str());
|
profile.AddToStringList(section_name, key_name, binding.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Controller::GetVibrationMotorCount(ctype) > 0)
|
||||||
|
{
|
||||||
const std::string rumble_value = si.GetStringValue(section_name, "Rumble");
|
const std::string rumble_value = si.GetStringValue(section_name, "Rumble");
|
||||||
if (!rumble_value.empty())
|
if (!rumble_value.empty())
|
||||||
profile.SetStringValue(section_name, "Rumble", rumble_value.c_str());
|
profile.SetStringValue(section_name, "Rumble", rumble_value.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
Controller::SettingList settings = Controller::GetSettings(ctype);
|
Controller::SettingList settings = Controller::GetSettings(ctype);
|
||||||
for (const SettingInfo& ssi : settings)
|
for (const SettingInfo& ssi : settings)
|
||||||
|
|
Loading…
Reference in New Issue