diff options
| author | JMC47 <JMC4789@gmail.com> | 2019-04-09 19:30:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-09 19:30:26 -0400 |
| commit | e10a472134fdf557ec35505eb5fb7c74ba9f2af7 (patch) | |
| tree | 9593eb71abc3f724159693d46eb8504ede9529f0 /Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp | |
| parent | 0b8ac0a22f2fcebb7cbd00bbb36fd0c89191d34a (diff) | |
| parent | 5efb717873691fa42447ca0d9d9810b5ad501b42 (diff) | |
Merge pull request #7936 from jordan-woyak/numeric-setting-cleanup
InputCommon: Clean up how numeric settings are handled.
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp | 31 |
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 |
