From 5efb717873691fa42447ca0d9d9810b5ad501b42 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Tue, 26 Mar 2019 19:31:03 -0500 Subject: InputCommon: Clean up how numeric settings are handled. Add units of measure to UI. Eliminate hidden magic values of the IR cursor. --- .../ControllerEmu/Setting/NumericSetting.cpp | 31 ++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp') diff --git a/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp b/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp index a15dd13f2f..3459040824 100644 --- a/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp +++ b/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp @@ -6,20 +6,35 @@ namespace ControllerEmu { -NumericSetting::NumericSetting(const std::string& setting_name, const ControlState default_value, - const u32 low, const u32 high, const SettingType setting_type) - : m_type(setting_type), m_name(setting_name), m_default_value(default_value), m_low(low), - m_high(high), m_value(default_value) +NumericSettingBase::NumericSettingBase(const NumericSettingDetails& details) : m_details(details) { } -ControlState NumericSetting::GetValue() const +const char* NumericSettingBase::GetUIName() const { - return m_value; + return m_details.ui_name; } -void NumericSetting::SetValue(ControlState value) + +const char* NumericSettingBase::GetUISuffix() const +{ + return m_details.ui_suffix; +} + +const char* NumericSettingBase::GetUIDescription() const +{ + return m_details.ui_description; +} + +template <> +SettingType NumericSetting::GetType() const +{ + return SettingType::Double; +} + +template <> +SettingType NumericSetting::GetType() const { - m_value = value; + return SettingType::Bool; } } // namespace ControllerEmu -- cgit v1.2.3