make selection box use the selection or deconstruct color to indicate the mode

This commit is contained in:
2026-08-14 21:49:55 +02:00
parent 9bbade2420
commit d36e59fd26
6 changed files with 19 additions and 8 deletions

View File

@@ -1028,7 +1028,17 @@ void WorldRenderer::drawOverlays(QPainter& painter, const WorldCoordinates& coor
std::max(frame.boxStartTile.y(), frame.boxCurrentTile.y()) + 1);
const QRectF selRect(coordinates.tileToWidget(tl),
coordinates.tileToWidget(br));
painter.setPen(QPen(m_visuals.overlays.selectionRect, 1));
// In deconstruct mode the box marks buildings for demolition, so it is
// drawn in the deconstruct red instead of the selection color; the
// tint's alpha governs only the fills it tints, never this outline
// (REQ-UI-MULTI-SELECT, REQ-BLD-DECONSTRUCT-BOX).
QColor rectColor = m_visuals.overlays.selectedOutline;
if (frame.buildMode.isDeconstructMode())
{
rectColor = m_visuals.overlays.deconstructTint;
rectColor.setAlpha(255);
}
painter.setPen(QPen(rectColor, 1));
painter.setBrush(Qt::NoBrush);
painter.drawRect(selRect);
}