diff options
| author | Filoppi <filippotarpini@hotmail.it> | 2021-05-04 23:51:58 +0300 |
|---|---|---|
| committer | Filoppi <filippotarpini@hotmail.it> | 2021-05-12 18:27:24 +0300 |
| commit | 4625359a4fe05c408bfd7d555f880bd7faac5c50 (patch) | |
| tree | 56ce9d8096194e0f1c97bde3bbebd0f5a2fc8b76 /Source/Core/InputCommon/ControllerEmu | |
| parent | f4fec42165f245e8ad35456a25bfada8428ba1f2 (diff) | |
InputCommon: clamp the attachment setting max to its actual enum max
NumericSettings support a max, so let's use it.
It might not do much now, but the max and min values will be used to give visual feeback
in the UI in one of my upcoming input PRs
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu')
| -rw-r--r-- | Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.h b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.h index f92bd8b1fd..77d44df093 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.h +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.h @@ -10,6 +10,7 @@ #include <vector> #include "Common/CommonTypes.h" +#include "Core/HW/WiimoteEmu/ExtensionPort.h" #include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h" #include "InputCommon/ControllerEmu/ControllerEmu.h" #include "InputCommon/ControllerEmu/Setting/NumericSetting.h" @@ -34,7 +35,11 @@ public: private: SettingValue<int> m_selection_value; - NumericSetting<int> m_selection_setting = {&m_selection_value, {""}, 0, 0, 0}; + // This is here and not added to the list of numeric_settings because it's serialized differently, + // by string (to be independent from the enum), and visualized differently in the UI. + // For the rest, it's treated similarly to other numeric_settings in the group. + NumericSetting<int> m_selection_setting = { + &m_selection_value, {""}, 0, 0, WiimoteEmu::ExtensionNumber::MAX - 1}; std::vector<std::unique_ptr<EmulatedController>> m_attachments; }; |
