Clear designation tile-highlight when jobs complete

Each entity completion handler (wall/floor/door/bed/torch/workbench/crate
/tree/rock/big_rock/grave_slot) now calls World.clear_designation_at(tile)
so the orange/blue/etc. highlight overlay disappears with the job.
BigRock iterates its footprint to clear all four tiles.

World.designation_ctl is set during the scene boot wire-up; the helper
no-ops when the controller is absent (e.g. headless tests).
This commit is contained in:
megaproxy 2026-05-15 19:31:55 +01:00
parent 6abd53c6f5
commit f67c12c51f
13 changed files with 29 additions and 0 deletions

View file

@ -143,6 +143,7 @@ func on_build_tick() -> void:
if build_progress >= BUILD_TICKS:
_completed = true
emit_signal("contents_changed")
World.clear_designation_at(tile)
Audit.log("crate", "built at %s (capacity %d)" % [tile, CAPACITY])
queue_redraw()

View file

@ -185,6 +185,9 @@ func _ready() -> void:
# Designation: bind the paint surface + the Selection guard.
designation_ctl.bind(designation_layer, selection)
# Expose on the autoload so entities can clear their ghost stamp on
# completion (Tree.fell, Wall._complete, etc.).
World.designation_ctl = designation_ctl
# Register all 10 providers — Decision iterates by .priority desc.
# doctor=9 > sleep=8 > eat=7 > construction=6 > chop=5 ≈ plant=5 > mine=4