built building should appear on the map #11
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Done. Buildings the player has placed now appear on the world map.
Buildings are placed freely in space rather than being tied to a chunk, so they could not ride along with the existing chunk markers and get their own pass in
WorldMapContent._draw(). Each type is drawn as its own shape and colour, mirroringBuilding.gd's own constants so a marker reads as the same building you built:Color(0.45, 0.9, 0.55))Color(1.0, 0.72, 0.25))Color(0.55, 0.6, 1.0))The positioning step is factored out into
building_markers(), which turnsGameState.buildingsinto map-local marker data, so a headless test can check it ---headlesshas no GPU and draws no pixels, so there is nothing to assert on in_draw()itself.Test
tests/test_map_building_markers.gdchecks that nothing built means no markers (so a passing count is not just "always 3"), that every placed building produces exactly one marker, that markers land at the building's world position scaled into map space, and that the three types are actually told apart by colour.I mutation-tested the assertions rather than trusting that they pass:
Looked at it
Headless renders no pixels, so a test cannot tell whether a marker is visible.
tests/_marker_preview.tscn+tests/screenshot.shrender the map for real (Xvfb + Mesa softpipe) - all three markers show up distinctly against the chunk grid, next to the fleet's cyan triangle.One fix along the way:
screenshot.shnow clears a stale/tmp/.X99-lock. A run killed mid-screenshot leaves the lock behind, Xvfb then silently refuses to claim:99, and it resurfaces much later as Godot's misleadingX11 Display is not available.Full suite: 40/40 passing.