add visuals config

This commit is contained in:
2026-04-19 10:05:13 +02:00
parent e3e188a24c
commit 1e1f2d7816
3 changed files with 192 additions and 1 deletions

View File

@@ -19,6 +19,13 @@ inputs = [{item = "iron_ore", amount = 2}]
outputs = [{item = "iron_ingot", amount = 1}] outputs = [{item = "iron_ingot", amount = 1}]
duration_seconds = 2.0 duration_seconds = 2.0
[[recipe]]
id = "copper_ingot"
building = "smelter"
inputs = [{item = "copper_ore", amount = 2}]
outputs = [{item = "copper_ingot", amount = 1}]
duration_seconds = 2.5
[[recipe]] [[recipe]]
id = "circuit_board" id = "circuit_board"
building = "assembler" building = "assembler"

184
bin/config/visuals.toml Normal file
View File

@@ -0,0 +1,184 @@
# visuals.toml
#
# Rendering-only configuration, loaded once at startup by the UI.
# The simulation does not read this file.
#
# Every BuildingType, ItemType, ship role, and station type must have an
# entry here; missing or malformed entries abort startup (see architecture.md
# "Visual Parameters").
#
# Colors are "#rrggbb" or "#rrggbbaa" (alpha optional, last byte).
# -----------------------------------------------------------------------------
# Tile backgrounds
# -----------------------------------------------------------------------------
[tiles.asteroid]
fill = "#4a4038"
[tiles.space]
fill = "#0a0a15"
# -----------------------------------------------------------------------------
# Buildings
#
# One section per BuildingType enum value. `fill` colors every footprint tile
# of the building; `outline` is drawn around the building's bounding box;
# `glyph` is a short label drawn centered on the building.
# -----------------------------------------------------------------------------
[buildings.hq]
fill = "#2e5fb8"
outline = "#ffffff"
glyph = "HQ"
[buildings.miner]
fill = "#6b4a2c"
outline = "#ffffff"
glyph = "M"
[buildings.smelter]
fill = "#b85a1e"
outline = "#ffffff"
glyph = "Sm"
[buildings.assembler]
fill = "#3a6fa8"
outline = "#ffffff"
glyph = "A"
[buildings.reprocessing_plant]
fill = "#6a3a8a"
outline = "#ffffff"
glyph = "R"
[buildings.shipyard]
fill = "#385870"
outline = "#ffffff"
glyph = "Y"
[buildings.salvage_bay]
fill = "#b8a23a"
outline = "#ffffff"
glyph = "Sb"
[buildings.belt]
fill = "#5a5a5a"
outline = "#7a7a7a"
glyph = ""
[buildings.splitter]
fill = "#7a7a5a"
outline = "#9a9a7a"
glyph = ""
# -----------------------------------------------------------------------------
# Stations
#
# Player and enemy defence stations have their own entries rather than going
# through [buildings.*] so the two sides can be color-coded at a glance.
# -----------------------------------------------------------------------------
[stations.player]
fill = "#2e5fb8"
outline = "#ffffff"
glyph = "P"
[stations.enemy]
fill = "#b82e2e"
outline = "#ffffff"
glyph = "E"
# -----------------------------------------------------------------------------
# Items
#
# Items on belts are 10x10 squares. `fill` is the square color; `outline` is
# drawn around it. One section per ItemType.
# -----------------------------------------------------------------------------
[items.iron_ore]
fill = "#8a5a4a"
outline = "#201010"
[items.copper_ore]
fill = "#c47a3a"
outline = "#3a1a0a"
[items.iron_ingot]
fill = "#b0b0b8"
outline = "#202028"
[items.copper_ingot]
fill = "#d48a4a"
outline = "#402010"
[items.circuit_board]
fill = "#2ea35a"
outline = "#0a2a14"
[items.advanced_alloy]
fill = "#a06acc"
outline = "#201030"
[items.building_block]
fill = "#c8b070"
outline = "#302810"
[items.scrap]
fill = "#7a7268"
outline = "#201a14"
# -----------------------------------------------------------------------------
# Ships
#
# Ships are drawn as oriented triangles/arrows. Color is keyed to role, not
# blueprint (architecture.md, "Layer Order").
# -----------------------------------------------------------------------------
[ships.player_combat]
fill = "#3366ff"
outline = "#ffffff"
[ships.salvage]
fill = "#33cc66"
outline = "#ffffff"
[ships.repair]
fill = "#66ccff"
outline = "#ffffff"
[ships.enemy]
fill = "#cc3333"
outline = "#ffffff"
# -----------------------------------------------------------------------------
# Laser beams (REQ-SHP-FIRING-BEAM)
# -----------------------------------------------------------------------------
[beams]
color = "#ff6600"
width_px = 2
# -----------------------------------------------------------------------------
# Build / demolish / selection overlays
#
# All overlay colors carry an alpha channel so they composite over the
# underlying scene.
# -----------------------------------------------------------------------------
[overlays]
ghost_valid = "#ffffff44" # builder-mode ghost, placement allowed (REQ-BLD-GHOST)
ghost_invalid = "#ff000044" # builder-mode ghost, placement invalid (REQ-BLD-PLACE-VALID)
demolish_tint = "#ff000033" # demolish-mode hover tint
selection_rect = "#00ff00" # box-drag selection rectangle (REQ-UI-MULTI-SELECT)
tile_highlight = "#ffffff22" # tile under cursor
selected_outline = "#ffff00" # outline drawn around currently-selected building(s)
# -----------------------------------------------------------------------------
# Blueprint-drop toasts (REQ-UI-BLUEPRINT-TOAST)
# -----------------------------------------------------------------------------
[toast]
bg = "#000000cc"
fg = "#ffffff"
font_size = 14

View File

@@ -9,7 +9,7 @@ Config files use the TOML format. The following config files drive game paramete
- **recipes.toml** — crafting recipes: inputs, outputs, quantities, durations, and reprocessing plant probabilities. - **recipes.toml** — crafting recipes: inputs, outputs, quantities, durations, and reprocessing plant probabilities.
- **ships.toml** — per blueprint: a human-readable display name (used in toasts and UI), ship stats (HP, speed, damage, attack range, attack rate, sensor range) as formulas of ship level, required build materials, threat cost formula, player production level, and whether the blueprint is available from game start. - **ships.toml** — per blueprint: a human-readable display name (used in toasts and UI), ship stats (HP, speed, damage, attack range, attack rate, sensor range) as formulas of ship level, required build materials, threat cost formula, player production level, and whether the blueprint is available from game start.
- **stations.toml** — HP, damage, range, fire rate, and scrap drop for player and enemy defence stations, defined as formulas of station level. - **stations.toml** — HP, damage, range, fire rate, and scrap drop for player and enemy defence stations, defined as formulas of station level.
- **visuals.toml** — rendering-only config (not game parameters): fill and outline colors, glyphs, and tile tints for every building type, item type, ship role, and station type; beam color and width; overlay and toast colors. Loaded by the UI at startup; the simulation does not read it. - **visuals.toml** — rendering-only config (not game parameters): fill and outline colors and glyphs for every building type, item type, ship role, and station type; beam color and width; overlay and toast colors. Loaded by the UI at startup; the simulation does not read it.
### Surface Mask Format ### Surface Mask Format