mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-19 00:35:46 -04:00
Controller: Add invert and button deadzone options
This commit is contained in:
@ -3018,6 +3018,10 @@ void FullscreenUI::DrawControllerSettingsPage()
|
||||
DrawIntRangeSetting(bsi, title, si.description, section.c_str(), si.name, si.IntegerDefaultValue(),
|
||||
si.IntegerMinValue(), si.IntegerMaxValue(), si.format, true);
|
||||
break;
|
||||
case SettingInfo::Type::IntegerList:
|
||||
DrawIntListSetting(bsi, title, si.description, section.c_str(), si.name, si.IntegerDefaultValue(),
|
||||
si.options, 0, si.IntegerMinValue(), true);
|
||||
break;
|
||||
case SettingInfo::Type::Float:
|
||||
DrawFloatRangeSetting(bsi, title, si.description, section.c_str(), si.name, si.FloatDefaultValue(),
|
||||
si.FloatMinValue(), si.FloatMaxValue(), si.format, si.multiplier, true);
|
||||
|
@ -962,12 +962,28 @@ void InputManager::CopyConfiguration(SettingsInterface* dest_si, const SettingsI
|
||||
|
||||
if (copy_pad_config)
|
||||
{
|
||||
dest_si->CopyFloatValue(src_si, section.c_str(), "AxisScale");
|
||||
|
||||
if (info->vibration_caps != Controller::VibrationCapabilities::NoVibration)
|
||||
for (u32 i = 0; i < info->num_settings; i++)
|
||||
{
|
||||
dest_si->CopyFloatValue(src_si, section.c_str(), "LargeMotorScale");
|
||||
dest_si->CopyFloatValue(src_si, section.c_str(), "SmallMotorScale");
|
||||
const SettingInfo& csi = info->settings[i];
|
||||
switch (csi.type)
|
||||
{
|
||||
case SettingInfo::Type::Boolean:
|
||||
dest_si->CopyBoolValue(src_si, section.c_str(), csi.name);
|
||||
break;
|
||||
case SettingInfo::Type::Integer:
|
||||
case SettingInfo::Type::IntegerList:
|
||||
dest_si->CopyIntValue(src_si, section.c_str(), csi.name);
|
||||
break;
|
||||
case SettingInfo::Type::Float:
|
||||
dest_si->CopyFloatValue(src_si, section.c_str(), csi.name);
|
||||
break;
|
||||
case SettingInfo::Type::String:
|
||||
case SettingInfo::Type::Path:
|
||||
dest_si->CopyStringValue(src_si, section.c_str(), csi.name);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1350,12 +1366,10 @@ void InputManager::ReloadBindings(SettingsInterface& si, SettingsInterface& bind
|
||||
{
|
||||
// From lilypad: 1 mouse pixel = 1/8th way down.
|
||||
const float default_scale = (axis <= static_cast<u32>(InputPointerAxis::Y)) ? 8.0f : 1.0f;
|
||||
const float invert =
|
||||
si.GetBoolValue("Pad", fmt::format("Pointer{}Invert", s_pointer_axis_names[axis]).c_str(), false) ? -1.0f : 1.0f;
|
||||
s_pointer_axis_scale[axis] =
|
||||
invert / std::max(si.GetFloatValue("Pad", fmt::format("Pointer{}Scale", s_pointer_axis_names[axis]).c_str(),
|
||||
default_scale),
|
||||
1.0f);
|
||||
1.0f / std::max(si.GetFloatValue("Pad", fmt::format("Pointer{}Scale", s_pointer_axis_names[axis]).c_str(),
|
||||
default_scale),
|
||||
1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user