mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
InputCommon: Clean up how numeric settings are handled. Add units of measure to UI. Eliminate hidden magic values of the IR cursor.
This commit is contained in:
@ -13,7 +13,6 @@
|
||||
#include "InputCommon/ControllerEmu/Control/Control.h"
|
||||
#include "InputCommon/ControllerEmu/Control/Input.h"
|
||||
#include "InputCommon/ControllerEmu/ControllerEmu.h"
|
||||
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
|
||||
|
||||
namespace ControllerEmu
|
||||
{
|
||||
@ -23,7 +22,7 @@ Slider::Slider(const std::string& name_, const std::string& ui_name_)
|
||||
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Left")));
|
||||
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Right")));
|
||||
|
||||
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
|
||||
AddDeadzoneSetting(&m_deadzone_setting, 50);
|
||||
}
|
||||
|
||||
Slider::Slider(const std::string& name_) : Slider(name_, name_)
|
||||
@ -32,7 +31,7 @@ Slider::Slider(const std::string& name_) : Slider(name_, name_)
|
||||
|
||||
Slider::StateData Slider::GetState()
|
||||
{
|
||||
const ControlState deadzone = numeric_settings[0]->GetValue();
|
||||
const ControlState deadzone = m_deadzone_setting.GetValue() / 100;
|
||||
const ControlState state = controls[1]->control_ref->State() - controls[0]->control_ref->State();
|
||||
|
||||
if (fabs(state) > deadzone)
|
||||
|
Reference in New Issue
Block a user