mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -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:
@ -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
|
||||
{
|
||||
m_value = value;
|
||||
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
|
||||
{
|
||||
return SettingType::Bool;
|
||||
}
|
||||
|
||||
} // namespace ControllerEmu
|
||||
|
Reference in New Issue
Block a user