implement blueprint compatible overlap and configuration transfer
Implements the two rules specified in128bf81, which restore the copy-settings capability removed in648241bas 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
This commit is contained in:
@@ -348,6 +348,7 @@ 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)
|
||||
|
||||
Reference in New Issue
Block a user