mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
78a9bdf04a
Make "Clear" button reset "Modifier" "Range" settings to 50%.
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
// Copyright 2017 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
|
|
#include "InputCommon/ControllerEmu/StickGate.h"
|
|
#include "InputCommon/ControllerInterface/CoreDevice.h"
|
|
|
|
namespace ControllerEmu
|
|
{
|
|
class AnalogStick : public ReshapableInput
|
|
{
|
|
public:
|
|
using StateData = ReshapeData;
|
|
|
|
AnalogStick(const char* name, std::unique_ptr<StickGate>&& stick_gate);
|
|
AnalogStick(const char* name, const char* ui_name, std::unique_ptr<StickGate>&& stick_gate);
|
|
|
|
ReshapeData GetReshapableState(bool adjusted) const final override;
|
|
ControlState GetGateRadiusAtAngle(double ang) const override;
|
|
|
|
StateData GetState() const;
|
|
|
|
private:
|
|
Control* GetModifierInput() const override;
|
|
|
|
std::unique_ptr<StickGate> m_stick_gate;
|
|
};
|
|
|
|
// An AnalogStick with an OctagonStickGate
|
|
class OctagonAnalogStick : public AnalogStick
|
|
{
|
|
public:
|
|
OctagonAnalogStick(const char* name, ControlState gate_radius);
|
|
OctagonAnalogStick(const char* name, const char* ui_name, ControlState gate_radius);
|
|
|
|
ControlState GetVirtualNotchSize() const override;
|
|
|
|
private:
|
|
SettingValue<double> m_virtual_notch_setting;
|
|
};
|
|
|
|
} // namespace ControllerEmu
|