summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2019-02-04 18:50:07 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2019-02-10 07:55:47 -0600
commit0064f70c8a17cd40c15486ac385508ce0ee20cf1 (patch)
treea7e5dce2d6b8a6882362be3a696b5457bfb64e16 /Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp
parent46918f420d443c3a32bd27170e3fa0e4f7bc5255 (diff)
DolphinQt/ControllerEmu: Replace Input Radius/Shape settings with an input calibration "wizard".
Diffstat (limited to 'Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp
index 5e7e0b0024..c8d185a2fe 100644
--- a/Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp
+++ b/Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp
@@ -21,6 +21,7 @@
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
#include "InputCommon/ControllerEmu/Setting/BooleanSetting.h"
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
+#include "InputCommon/ControllerEmu/StickGate.h"
MappingWidget::MappingWidget(MappingWindow* window) : m_parent(window)
{
@@ -74,10 +75,14 @@ QGroupBox* MappingWidget::CreateGroupBox(const QString& name, ControllerEmu::Con
group_box->setLayout(form_layout);
- bool need_indicator = group->type == ControllerEmu::GroupType::Cursor ||
- group->type == ControllerEmu::GroupType::Stick ||
- group->type == ControllerEmu::GroupType::Tilt ||
- group->type == ControllerEmu::GroupType::MixedTriggers;
+ const bool need_indicator = group->type == ControllerEmu::GroupType::Cursor ||
+ group->type == ControllerEmu::GroupType::Stick ||
+ group->type == ControllerEmu::GroupType::Tilt ||
+ group->type == ControllerEmu::GroupType::MixedTriggers;
+
+ const bool need_calibration = group->type == ControllerEmu::GroupType::Cursor ||
+ group->type == ControllerEmu::GroupType::Stick ||
+ group->type == ControllerEmu::GroupType::Tilt;
for (auto& control : group->controls)
{
@@ -136,7 +141,19 @@ QGroupBox* MappingWidget::CreateGroupBox(const QString& name, ControllerEmu::Con
}
if (need_indicator)
- form_layout->addRow(new MappingIndicator(group));
+ {
+ auto const indicator = new MappingIndicator(group);
+
+ if (need_calibration)
+ {
+ const auto calibrate =
+ new CalibrationWidget(*static_cast<ControllerEmu::ReshapableInput*>(group), *indicator);
+
+ form_layout->addRow(calibrate);
+ }
+
+ form_layout->addRow(indicator);
+ }
return group_box;
}