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

@ -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;