Tint not-yet-buildable asteroid area
This commit is contained in:
@@ -918,15 +918,25 @@ void GameWorldView::drawTiles(QPainter& painter)
|
||||
const int rightTile = leftTile + static_cast<int>(std::ceil(viewportWidthTiles())) + 2;
|
||||
const int bottomTile = m_config->world.heightTiles;
|
||||
|
||||
// Asteroid columns left of the buildable edge are not yet unlocked by
|
||||
// expansion; tint them so the player sees the reachable-but-locked area.
|
||||
const int buildableLeftX = -m_sim->currentAsteroidWidth_tiles();
|
||||
|
||||
painter.setPen(Qt::NoPen);
|
||||
for (int x = leftTile; x <= rightTile; ++x)
|
||||
{
|
||||
const QColor& fill = (x < 0)
|
||||
? m_visuals->asteroid.fill
|
||||
: m_visuals->space.fill;
|
||||
const bool locked = (x < buildableLeftX);
|
||||
for (int y = 0; y < bottomTile; ++y)
|
||||
{
|
||||
painter.fillRect(tileRect(QPoint(x, y)), fill);
|
||||
const QRectF rect = tileRect(QPoint(x, y));
|
||||
painter.fillRect(rect, fill);
|
||||
if (locked)
|
||||
{
|
||||
painter.fillRect(rect, m_visuals->overlays.lockedAsteroid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user