Implement building status light (REQ-UI-STATUS-LIGHT)

Add a per-building status light: a small circle drawn in the operational
building's upper-right corner (rotating with the building) so production
state is readable without selecting it.

- Sim: BuildingSystem::getProductionStatus classifies each building into
  Unconfigured/Producing/Starved/Blocked (nullopt for non-production
  types); Salvage Bay is a two-state special case (Producing with scrap,
  Starved when empty). Extracted shared predicates (gatherCandidateRecipes,
  recipeInputsAvailable, computeShipyardRequiredMaterials, hasInputsToStart)
  so tickProduction / tickShipyardProduction and the classifier stay in sync.
- UI: GameWorldView draws the circle, mapping status -> color from a new
  visuals.toml [status_light] section (grey/green/red/yellow + outline).
- Tests: getProductionStatus cases for every state, including red-over-yellow
  precedence and the auto-recipe/salvage-bay specials.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
This commit is contained in:
2026-07-20 21:50:08 +02:00
parent 1f6663e49f
commit ee71be549a
7 changed files with 375 additions and 56 deletions

View File

@@ -360,3 +360,17 @@ modal_dim = "#00000099" # semi-transparent black dim behind modal dialogs
bg = "#000000cc"
fg = "#ffffff"
font_size = 14
# -----------------------------------------------------------------------------
# Building status light (REQ-UI-STATUS-LIGHT)
#
# Fill color per production state, drawn as a small circle in the building's
# upper-right corner, plus the constant outline color.
# -----------------------------------------------------------------------------
[status_light]
grey = "#808080" # no recipe/schematic selected
green = "#33cc33" # producing (Salvage Bay: holding scrap)
red = "#cc3333" # idle, input missing (Salvage Bay: empty)
yellow = "#e6c619" # idle, output buffer full
outline = "#000000"