From 0a1634bedf17f7b27a3781d8e5ac6bafb20cd546 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sat, 18 Jan 2020 11:19:32 -0600 Subject: InputCommon: Allow Wii remote extension to be set with an input expression. --- .../InputCommon/ControllerEmu/ControlGroup/Attachments.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.cpp') diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.cpp index e104918fe2..6f980d8c60 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.cpp @@ -17,12 +17,22 @@ void Attachments::AddAttachment(std::unique_ptr att) u32 Attachments::GetSelectedAttachment() const { - return m_selected_attachment; + const u32 value = m_selection_value.GetValue(); + + if (value < m_attachments.size()) + return value; + + return 0; } void Attachments::SetSelectedAttachment(u32 val) { - m_selected_attachment = val; + m_selection_setting.SetValue(val); +} + +NumericSetting& Attachments::GetSelectionSetting() +{ + return m_selection_setting; } const std::vector>& Attachments::GetAttachmentList() const -- cgit v1.2.3