mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 13:20:27 -06:00
DolphinQt/ControllerEmu: Replace Input Radius/Shape settings with an input calibration "wizard".
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user