UI: Massive revamp, new features and improvements
This commit is contained in:
@@ -39,38 +39,40 @@ public:
|
||||
Count
|
||||
};
|
||||
|
||||
enum class HalfAxis : u8
|
||||
{
|
||||
LLeft,
|
||||
LRight,
|
||||
LDown,
|
||||
LUp,
|
||||
RLeft,
|
||||
RRight,
|
||||
RDown,
|
||||
RUp,
|
||||
Count
|
||||
};
|
||||
|
||||
static const Controller::ControllerInfo INFO;
|
||||
|
||||
AnalogJoystick(u32 index);
|
||||
~AnalogJoystick() override;
|
||||
|
||||
static std::unique_ptr<AnalogJoystick> Create(u32 index);
|
||||
static std::optional<s32> StaticGetAxisCodeByName(std::string_view axis_name);
|
||||
static std::optional<s32> StaticGetButtonCodeByName(std::string_view button_name);
|
||||
static AxisList StaticGetAxisNames();
|
||||
static ButtonList StaticGetButtonNames();
|
||||
static u32 StaticGetVibrationMotorCount();
|
||||
static SettingList StaticGetSettings();
|
||||
|
||||
ControllerType GetType() const override;
|
||||
std::optional<s32> GetAxisCodeByName(std::string_view axis_name) const override;
|
||||
std::optional<s32> GetButtonCodeByName(std::string_view button_name) const override;
|
||||
|
||||
void Reset() override;
|
||||
bool DoState(StateWrapper& sw, bool apply_input_state) override;
|
||||
|
||||
float GetAxisState(s32 axis_code) const override;
|
||||
void SetAxisState(s32 axis_code, float value) override;
|
||||
bool GetButtonState(s32 button_code) const override;
|
||||
void SetButtonState(s32 button_code, bool pressed) override;
|
||||
float GetBindState(u32 index) const override;
|
||||
void SetBindState(u32 index, float value) override;
|
||||
u32 GetButtonStateBits() const override;
|
||||
std::optional<u32> GetAnalogInputBytes() const override;
|
||||
|
||||
void ResetTransferState() override;
|
||||
bool Transfer(const u8 data_in, u8* data_out) override;
|
||||
|
||||
void LoadSettings(const char* section) override;
|
||||
|
||||
void SetAxisState(Axis axis, u8 value);
|
||||
void SetButtonState(Button button, bool pressed);
|
||||
void LoadSettings(SettingsInterface& si, const char* section) override;
|
||||
|
||||
private:
|
||||
enum class TransferState : u8
|
||||
@@ -89,9 +91,8 @@ private:
|
||||
u16 GetID() const;
|
||||
void ToggleAnalogMode();
|
||||
|
||||
u32 m_index;
|
||||
|
||||
float m_axis_scale = 1.00f;
|
||||
float m_analog_deadzone = 0.0f;
|
||||
float m_analog_sensitivity = 1.33f;
|
||||
|
||||
// On original hardware, the mode toggle is a switch rather than a button, so we'll enable Analog Mode by default
|
||||
bool m_analog_mode = true;
|
||||
@@ -101,5 +102,8 @@ private:
|
||||
|
||||
std::array<u8, static_cast<u8>(Axis::Count)> m_axis_state{};
|
||||
|
||||
// both directions of axis state, merged to m_axis_state
|
||||
std::array<u8, static_cast<u32>(HalfAxis::Count)> m_half_axis_state{};
|
||||
|
||||
TransferState m_transfer_state = TransferState::Idle;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user