From 9e2f9db94c67332bc1af6d111d9fd2c68cb536d2 Mon Sep 17 00:00:00 2001 From: spycrab Date: Sun, 13 May 2018 21:17:46 +0200 Subject: [PATCH] Qt/Mapping: Fix mapping changes not being applied instantly --- Source/Core/DolphinQt2/Config/Mapping/MappingBool.cpp | 4 ++++ Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp | 1 + Source/Core/DolphinQt2/Config/Mapping/MappingNumeric.cpp | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingBool.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingBool.cpp index 31529a8887..d1fc4f951d 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingBool.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingBool.cpp @@ -5,7 +5,10 @@ #include "DolphinQt2/Config/Mapping/MappingBool.h" #include "DolphinQt2/Config/Mapping/MappingWidget.h" + +#include "InputCommon/ControllerEmu/ControllerEmu.h" #include "InputCommon/ControllerEmu/Setting/BooleanSetting.h" +#include "InputCommon/ControllerInterface/ControllerInterface.h" MappingBool::MappingBool(MappingWidget* widget, ControllerEmu::BooleanSetting* setting) : QCheckBox(tr(setting->m_ui_name.c_str())), m_parent(widget), m_setting(setting) @@ -19,6 +22,7 @@ void MappingBool::Connect() connect(this, &QCheckBox::stateChanged, this, [this](int value) { m_setting->SetValue(value); m_parent->SaveSettings(); + m_parent->GetController()->UpdateReferences(g_controller_interface); }); } diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp index 8224a39e2a..5e2aa189fa 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp @@ -117,6 +117,7 @@ void MappingButton::Detect() m_reference->SetExpression(expr.toStdString()); m_parent->SaveSettings(); Update(); + m_parent->GetController()->UpdateReferences(g_controller_interface); if (m_parent->IsIterativeInput()) m_parent->NextButton(this); diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingNumeric.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingNumeric.cpp index c896c3d998..7073e8fffb 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingNumeric.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingNumeric.cpp @@ -5,7 +5,10 @@ #include "DolphinQt2/Config/Mapping/MappingNumeric.h" #include "DolphinQt2/Config/Mapping/MappingWidget.h" + +#include "InputCommon/ControllerEmu/ControllerEmu.h" #include "InputCommon/ControllerEmu/Setting/NumericSetting.h" +#include "InputCommon/ControllerInterface/ControllerInterface.h" MappingNumeric::MappingNumeric(MappingWidget* widget, ControllerEmu::NumericSetting* setting) : m_parent(widget), m_setting(setting) @@ -21,6 +24,7 @@ void MappingNumeric::Connect() [this](int value) { m_setting->SetValue(static_cast(value) / 100); m_parent->SaveSettings(); + m_parent->GetController()->UpdateReferences(g_controller_interface); }); }