mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 13:20:27 -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,10 +13,17 @@
|
||||
|
||||
namespace ControllerEmu
|
||||
{
|
||||
class BooleanSetting;
|
||||
class Control;
|
||||
|
||||
class NumericSettingBase;
|
||||
struct NumericSettingDetails;
|
||||
|
||||
template <typename T>
|
||||
class NumericSetting;
|
||||
|
||||
template <typename T>
|
||||
class SettingValue;
|
||||
|
||||
enum class GroupType
|
||||
{
|
||||
Other,
|
||||
@ -46,12 +53,22 @@ public:
|
||||
|
||||
void SetControlExpression(int index, const std::string& expression);
|
||||
|
||||
template <typename T>
|
||||
void AddSetting(SettingValue<T>* value, const NumericSettingDetails& details,
|
||||
std::common_type_t<T> default_value, std::common_type_t<T> min_value = {},
|
||||
std::common_type_t<T> max_value = T(100))
|
||||
{
|
||||
numeric_settings.emplace_back(
|
||||
std::make_unique<NumericSetting<T>>(value, details, default_value, min_value, max_value));
|
||||
}
|
||||
|
||||
void AddDeadzoneSetting(SettingValue<double>* value, double maximum_deadzone);
|
||||
|
||||
const std::string name;
|
||||
const std::string ui_name;
|
||||
const GroupType type;
|
||||
|
||||
std::vector<std::unique_ptr<Control>> controls;
|
||||
std::vector<std::unique_ptr<NumericSetting>> numeric_settings;
|
||||
std::vector<std::unique_ptr<BooleanSetting>> boolean_settings;
|
||||
std::vector<std::unique_ptr<NumericSettingBase>> numeric_settings;
|
||||
};
|
||||
} // namespace ControllerEmu
|
||||
|
Reference in New Issue
Block a user