diff options
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/StickGate.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerEmu/StickGate.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/StickGate.cpp b/Source/Core/InputCommon/ControllerEmu/StickGate.cpp index 5029fd7f1a..ce9259f06f 100644 --- a/Source/Core/InputCommon/ControllerEmu/StickGate.cpp +++ b/Source/Core/InputCommon/ControllerEmu/StickGate.cpp @@ -232,6 +232,15 @@ void ReshapableInput::LoadConfig(IniFile::Section* section, const std::string& d ControlGroup::LoadConfig(section, default_device, base_name); const std::string group(base_name + name + '/'); + + // Special handling for "Modifier" button "Range" settings which default to 50% instead of 100%. + if (const auto* modifier_input = GetModifierInput()) + { + section->Get(group + modifier_input->name + "/Range", &modifier_input->control_ref->range, + 50.0); + modifier_input->control_ref->range /= 100; + } + std::string load_str; section->Get(group + CALIBRATION_CONFIG_NAME, &load_str, ""); const auto load_data = SplitString(load_str, ' '); @@ -313,11 +322,7 @@ ReshapableInput::ReshapeData ReshapableInput::Reshape(ControlState x, ControlSta // This is affected by the modifier's "range" setting which defaults to 50%. if (modifier) { - // TODO: Modifier's range setting gets reset to 100% when the clear button is clicked. - // This causes the modifier to not behave how a user might suspect. - // Retaining the old scale-by-50% behavior until range is fixed to clear to 50%. - dist *= 0.5; - // dist *= modifier; + dist *= modifier; } // Apply deadzone as a percentage of the user-defined calibration shape/size: @@ -330,4 +335,9 @@ ReshapableInput::ReshapeData ReshapableInput::Reshape(ControlState x, ControlSta std::clamp(std::sin(angle) * dist, -clamp, clamp)}; } +Control* ReshapableInput::GetModifierInput() const +{ + return nullptr; +} + } // namespace ControllerEmu |
