Files
dota_factory/bin/app/data/config/visuals.toml
Malte Langkabel 3cf35b669e implement blueprint compatible overlap and configuration transfer
Implements the two rules specified in 128bf81, which restore the
copy-settings capability removed in 648241b as a property of blueprint
placement: press C on one configured building, then click same-type
buildings to stamp its settings across the factory.

The ghost colour and the click path already shared one predicate,
canPlaceBuilding, which is what kept preview and outcome from disagreeing.
The new rules make that answer four-valued, so the shared predicate becomes
a shared classifier: resolveBlueprintGhost in PlacementRules returns
PlaceNew / CompatibleOverlap / Transfer / Invalid, and both callers switch
on it. Putting it in lib rather than in the view is the whole testability
story -- src/ui is off the test include path.

findRotateInPlaceTarget is now the tunnel guard plus a shared
findCoincidingSameTypeBuilding core, so the two rules cannot drift apart;
its existing tests pass untouched. Blueprint placement no longer emits
RotateInPlaceCommand at all. Builder mode and the belt drag are unchanged.

transferConfigTo sends every field unconditionally, so a field the
blueprint stores nothing for clears the target's rather than leaving it.
The simulation's unchanged-value guards absorb the no-op case, which is
what keeps clicking an already-matching building free of buffer and
production-progress loss.

drawBuildingGhost's bool valid becomes GhostTint{Normal,Invalid,Transfer};
the transfer colour is taken at full RGB like the invalid one so it does
not double-dim against the ghost opacity. visuals.toml regains the overlay
colour under the name config_transfer, with its VisualsConfig field and
loader line -- overlay keys are mandatory, so the three move together.

The six new resolveBlueprintGhost cases failed on first run because the
test buildings were anchored in space: BuildingSystem::place skips the
terrain rules, resolveBlueprintGhost applies them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JcReq7hVk4KUPhTDKWAG7K
2026-08-06 19:20:34 +02:00

378 lines
8.4 KiB
TOML

# 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 = "#1a1a1a"
outline = "#7a7a7a"
glyph = ""
[buildings.splitter]
fill = "#7a7a5a"
outline = "#9a9a7a"
glyph = ""
[buildings.tunnel_entry]
fill = "#4a6a5a"
outline = "#8aaa9a"
glyph = "Te"
[buildings.tunnel_exit]
fill = "#5a6a4a"
outline = "#9aaa8a"
glyph = "Tx"
# -----------------------------------------------------------------------------
# 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.
# -----------------------------------------------------------------------------
# --- ores ---
[items.iron_ore]
fill = "#8a5a4a"
outline = "#201010"
[items.copper_ore]
fill = "#c47a3a"
outline = "#3a1a0a"
[items.quartz]
fill = "#e0d4f0"
outline = "#40345a"
# --- smelted basics ---
[items.iron_ingot]
fill = "#b0b0b8"
outline = "#202028"
[items.copper_ingot]
fill = "#d48a4a"
outline = "#402010"
[items.silicon]
fill = "#33415e"
outline = "#0e1420"
# --- salvage loop ---
[items.scrap]
fill = "#7a7268"
outline = "#201a14"
[items.voidsteel]
fill = "#4a3a6a"
outline = "#151020"
# --- basic components ---
[items.copper_wire]
fill = "#e09a50"
outline = "#3a2008"
[items.steel_plate]
fill = "#8a92a0"
outline = "#22262c"
[items.copper_coil]
fill = "#d07030"
outline = "#381808"
[items.building_block]
fill = "#c8b070"
outline = "#302810"
# --- advanced components ---
[items.control_chip]
fill = "#2ea35a"
outline = "#0a2a14"
[items.capacitor_bank]
fill = "#d0a030"
outline = "#302408"
[items.hardened_steel]
fill = "#6a7280"
outline = "#181c22"
[items.ceramic_plate]
fill = "#e0d8c8"
outline = "#3a3428"
[items.drive_unit]
fill = "#4a6ad0"
outline = "#101a38"
# --- capital components ---
[items.voidsteel_plate]
fill = "#7a5aaa"
outline = "#1c1038"
[items.capital_core]
fill = "#b040d0"
outline = "#280c30"
# --- module items ---
[items.railgun_s_module]
fill = "#691313"
outline = "#f3ff4f"
[items.railgun_m_module]
fill = "#892020"
outline = "#f3ff4f"
[items.railgun_l_module]
fill = "#a92d2d"
outline = "#f3ff4f"
[items.salvager_module]
fill = "#b2cfdd"
outline = "#236137"
[items.repair_tool_module]
fill = "#2e9ba3"
outline = "#689275"
[items.armor_plates_module]
fill = "#808080"
outline = "#202020"
[items.sensor_booster_module]
fill = "#40a0ff"
outline = "#102840"
[items.maneuvering_thrusters_module]
fill = "#5090e0"
outline = "#142438"
[items.afterburner_module]
fill = "#6080c0"
outline = "#182030"
[items.weapon_upgrade_module]
fill = "#ff4040"
outline = "#401010"
[items.weapon_primer_module]
fill = "#e03838"
outline = "#380e0e"
[items.weapon_stabilizer_module]
fill = "#c03030"
outline = "#300c0c"
[items.drone_bay_module]
fill = "#cc66ff"
outline = "#331040"
[items.drone_hangar_module]
fill = "#9933cc"
outline = "#260c33"
# --- ship hulls (outline matches the ship's fleet color in [ships.*]) ---
[items.drone_hull]
fill = "#1b1b1b"
outline = "#3366ff"
[items.frigate_hull]
fill = "#1b1b1b"
outline = "#44aaff"
[items.destroyer_hull]
fill = "#1b1b1b"
outline = "#33ccaa"
[items.cruiser_hull]
fill = "#1b1b1b"
outline = "#66cc33"
[items.battlecruiser_hull]
fill = "#1b1b1b"
outline = "#cccc33"
[items.battleship_hull]
fill = "#1b1b1b"
outline = "#ff9933"
[items.dreadnought_hull]
fill = "#1b1b1b"
outline = "#ff5533"
[items.carrier_hull]
fill = "#1b1b1b"
outline = "#cc66ff"
# -----------------------------------------------------------------------------
# Ships
#
# Ships are drawn as oriented triangles/arrows. Color is keyed to schematic id.
# -----------------------------------------------------------------------------
[ships.drone]
fill = "#3366ff"
outline = "#ffffff"
[ships.frigate]
fill = "#44aaff"
outline = "#ffffff"
[ships.destroyer]
fill = "#33ccaa"
outline = "#ffffff"
[ships.cruiser]
fill = "#66cc33"
outline = "#ffffff"
[ships.battlecruiser]
fill = "#cccc33"
outline = "#ffffff"
[ships.battleship]
fill = "#ff9933"
outline = "#ffffff"
[ships.dreadnought]
fill = "#ff5533"
outline = "#ffffff"
[ships.carrier]
fill = "#cc66ff"
outline = "#ffffff"
# -----------------------------------------------------------------------------
# Laser beams (REQ-SHP-FIRING-BEAM)
# -----------------------------------------------------------------------------
[beams]
weapon_color = "#ff6600"
repair_color = "#33ff66"
salvage_color = "#33ccff"
width_px = 2
# -----------------------------------------------------------------------------
# Build / deconstruct / 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)
deconstruct_tint = "#ff000033" # deconstruct-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)
config_transfer = "#33ccff66" # blueprint ghost over a configuration-transfer target (REQ-UI-BLUEPRINT-TRANSFER)
locked_asteroid = "#0000007f" # tint over the asteroid left of the buildable edge (not yet unlocked by expansion)
modal_dim = "#00000099" # semi-transparent black dim behind modal dialogs/menus (REQ-UI-MODAL-DIM)
tunnel_preview = "#00ff0055" # tunnel connection preview: matched end + tiles between (REQ-BLD-TUNNEL-MODE)
# -----------------------------------------------------------------------------
# Schematic-drop toasts (REQ-UI-SCHEMATIC-TOAST)
# -----------------------------------------------------------------------------
[toast]
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"