summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2019-03-26 19:31:03 -0500
committerJordan Woyak <jordan.woyak@gmail.com>2019-04-07 09:32:49 -0500
commit5efb717873691fa42447ca0d9d9810b5ad501b42 (patch)
tree4d3f306850c0a1f876489327d7de98ca1c0cba6a /Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp
parent75e74315e69df1dc03bbda4373528e9e26274d7d (diff)
InputCommon: Clean up how numeric settings are handled. Add units of measure to UI. Eliminate hidden magic values of the IR cursor.
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp31
1 files changed, 23 insertions, 8 deletions
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<double>::GetType() const
+{
+ return SettingType::Double;
+}
+
+template <>
+SettingType NumericSetting<bool>::GetType() const
{
- m_value = value;
+ return SettingType::Bool;
}
} // namespace ControllerEmu