| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h" |
| 7 |
#include "InputCommon/ControllerEmu/StickGate.h" |
| 8 |
#include "InputCommon/ControllerInterface/CoreDevice.h" |
| 9 |
|
| 10 |
namespace ControllerEmu |
| 11 |
{ |
| 12 |
class AnalogStick : public ReshapableInput |
| 13 |
{ |
| 14 |
public: |
| 15 |
using StateData = ReshapeData; |
| 16 |
|
| 17 |
AnalogStick(const char* name, std::unique_ptr<StickGate>&& stick_gate); |
| 18 |
AnalogStick(const char* name, const char* ui_name, std::unique_ptr<StickGate>&& stick_gate); |
| 19 |
|
| 20 |
ReshapeData GetReshapableState(bool adjusted) const final; |
| 21 |
ControlState GetGateRadiusAtAngle(double ang) const override; |
| 22 |
|
| 23 |
StateData GetState() const; |
| 24 |
StateData GetState(const InputOverrideFunction& override_func) const; |
| 25 |
|
| 26 |
private: |
| 27 |
Control* GetModifierInput() const override; |
| 28 |
|
| 29 |
std::unique_ptr<StickGate> m_stick_gate; |
| 30 |
}; |
| 31 |
|
| 32 |
|
| 33 |
class OctagonAnalogStick : public AnalogStick |
| 34 |
{ |
| 35 |
public: |
| 36 |
OctagonAnalogStick(const char* name, ControlState gate_radius); |
| 37 |
OctagonAnalogStick(const char* name, const char* ui_name, ControlState gate_radius); |
| 38 |
|
| 39 |
ControlState GetVirtualNotchSize() const override; |
| 40 |
ControlState GetGateRadiusAtAngle(double ang) const override; |
| 41 |
|
| 42 |
private: |
| 43 |
SettingValue<double> m_virtual_notch_setting; |
| 44 |
SettingValue<double> m_gate_size_setting; |
| 45 |
}; |
| 46 |
|
| 47 |
} |