From f1c77affae4254d765faf55a424591f030793bc8 Mon Sep 17 00:00:00 2001 From: Malte Langkabel Date: Mon, 13 Jul 2026 21:38:37 +0200 Subject: [PATCH] Tint not-yet-buildable asteroid area Asteroid columns left of the buildable edge (x < -currentAsteroidWidth) are reachable by the camera but not yet unlocked by expansion. Paint a semi-transparent grey overlay over them so the locked area reads as distinct from the buildable asteroid. The tint colour is config-driven via overlays.locked_asteroid, matching the other overlay visuals. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps --- bin/app/data/config/visuals.toml | 1 + src/ui/GameWorldView.cpp | 12 +++++++++++- src/ui/VisualsConfig.h | 1 + src/ui/VisualsLoader.cpp | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/app/data/config/visuals.toml b/bin/app/data/config/visuals.toml index fc5e624..45380b6 100644 --- a/bin/app/data/config/visuals.toml +++ b/bin/app/data/config/visuals.toml @@ -349,6 +349,7 @@ selection_rect = "#00ff00" # box-drag selection rectangle (REQ-UI-MULTI-SELE tile_highlight = "#ffffff22" # tile under cursor selected_outline = "#ffff00" # outline drawn around currently-selected building(s) copy_config = "#33ccff66" # copy-settings eligible-target tint + copy/paste flash (REQ-BLD-COPY-CONFIG-FEEDBACK) +locked_asteroid = "#0000007f" # tint over the asteroid left of the buildable edge (not yet unlocked by expansion) # ----------------------------------------------------------------------------- # Schematic-drop toasts (REQ-UI-SCHEMATIC-TOAST) diff --git a/src/ui/GameWorldView.cpp b/src/ui/GameWorldView.cpp index 62edce3..76cb3f7 100644 --- a/src/ui/GameWorldView.cpp +++ b/src/ui/GameWorldView.cpp @@ -918,15 +918,25 @@ void GameWorldView::drawTiles(QPainter& painter) const int rightTile = leftTile + static_cast(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); + } } } } diff --git a/src/ui/VisualsConfig.h b/src/ui/VisualsConfig.h index 3d4842c..3c40c7f 100644 --- a/src/ui/VisualsConfig.h +++ b/src/ui/VisualsConfig.h @@ -49,6 +49,7 @@ struct OverlayVisuals QColor tileHighlight; QColor selectedOutline; QColor copyConfig; + QColor lockedAsteroid; }; struct ToastVisuals diff --git a/src/ui/VisualsLoader.cpp b/src/ui/VisualsLoader.cpp index 08d529f..5833419 100644 --- a/src/ui/VisualsLoader.cpp +++ b/src/ui/VisualsLoader.cpp @@ -225,6 +225,7 @@ VisualsConfig VisualsLoader::load(const std::string& path) cfg.overlays.tileHighlight = parseColor(requireString(ov, "tile_highlight", "overlays"), "overlays.tile_highlight"); cfg.overlays.selectedOutline = parseColor(requireString(ov, "selected_outline", "overlays"), "overlays.selected_outline"); cfg.overlays.copyConfig = parseColor(requireString(ov, "copy_config", "overlays"), "overlays.copy_config"); + cfg.overlays.lockedAsteroid = parseColor(requireString(ov, "locked_asteroid", "overlays"), "overlays.locked_asteroid"); } // Toast