settings: Fix Debug controller type options

This commit is contained in:
german77
2021-10-31 10:41:44 -05:00
committed by Narr the Reg
parent 2b1b0c2a30
commit 730f078302
13 changed files with 77 additions and 95 deletions

View File

@ -38,8 +38,6 @@ const std::array<std::string, ConfigureInputPlayer::ANALOG_SUB_BUTTONS_NUM>
namespace {
constexpr std::size_t HANDHELD_INDEX = 8;
QString GetKeyName(int key_code) {
switch (key_code) {
case Qt::Key_Shift:

View File

@ -89,31 +89,6 @@
<height>21</height>
</size>
</property>
<item>
<property name="text">
<string>Pro Controller</string>
</property>
</item>
<item>
<property name="text">
<string>Dual Joycons</string>
</property>
</item>
<item>
<property name="text">
<string>Left Joycon</string>
</property>
</item>
<item>
<property name="text">
<string>Right Joycon</string>
</property>
</item>
<item>
<property name="text">
<string>Handheld</string>
</property>
</item>
</widget>
</item>
</layout>

View File

@ -118,7 +118,7 @@ void PlayerControlPreview::ResetInputs() {
});
trigger_values.fill({
.analog = {.value = 0, .properties = {0, 1, 0}},
.pressed = false,
.pressed = {.value = false},
});
update();
}
@ -2001,11 +2001,11 @@ void PlayerControlPreview::DrawGCTriggers(QPainter& p, const QPointF center,
// Left trigger
p.setPen(colors.outline);
p.setBrush(left_trigger.pressed ? colors.highlight : colors.button);
p.setBrush(left_trigger.pressed.value ? colors.highlight : colors.button);
DrawPolygon(p, qleft_trigger);
// Right trigger
p.setBrush(right_trigger.pressed ? colors.highlight : colors.button);
p.setBrush(right_trigger.pressed.value ? colors.highlight : colors.button);
DrawPolygon(p, qright_trigger);
// Draw L text
@ -2587,15 +2587,17 @@ void PlayerControlPreview::DrawArrowButton(QPainter& p, const QPointF center,
case Direction::Up:
arrow_button[point] = center + QPointF(up_arrow_x * size, up_arrow_y * size);
break;
case Direction::Left:
arrow_button[point] = center + QPointF(up_arrow_y * size, up_arrow_x * size);
break;
case Direction::Right:
arrow_button[point] = center + QPointF(-up_arrow_y * size, up_arrow_x * size);
break;
case Direction::Down:
arrow_button[point] = center + QPointF(up_arrow_x * size, -up_arrow_y * size);
break;
case Direction::Left:
// Compiler doesn't optimize this correctly
arrow_button[point] = center + QPointF(up_arrow_button[point * 2 + 1] * size,
up_arrow_button[point * 2 + 0] * size);
break;
case Direction::None:
break;
}
@ -2610,15 +2612,15 @@ void PlayerControlPreview::DrawArrowButton(QPainter& p, const QPointF center,
case Direction::Up:
offset = QPoint(0, -20 * size);
break;
case Direction::Left:
offset = QPoint(-20 * size, 0);
break;
case Direction::Right:
offset = QPoint(20 * size, 0);
break;
case Direction::Down:
offset = QPoint(0, 20 * size);
break;
case Direction::Left:
offset = QPoint(-20 * size, 0);
break;
case Direction::None:
offset = QPoint(0, 0);
break;