Commit graph spaceship/tests/test_hud_layout.gd.uid
Author SHA1 Message Date
Loïc Wisniewski
6a62b6f5f8 Derive the context action row from the build button, not a fixed y
Seating the HUD columns below the resource readout moved the build button
from the scene-authored 160 to 288. _layout_context_buttons() then wrote the
action row straight back to a hardcoded 324 on the next context change - and
it runs on the first frame, so the action button overlapped the build button
immediately.

Same shape of bug as the overlap that seating fixed: a literal coordinate
that meant "directly below the thing above me" and silently stopped being
true when that thing moved. It now measures instead:

    row_top = build_button.position.y + build_button.size.y + HUD_ROW_GAP

Both the action button and the expanded context row derive from that, so
wherever the build button ends up, the row below follows.

tests/test_hud_layout.gd asserts the RELATIONSHIP rather than any
coordinate, so a freshly hardcoded y fails whatever value someone picks:
every HUD button clears the readout's real bottom, and no two
simultaneously-usable buttons overlap - checked at load, collapsed and
expanded, which is the path that broke. BuildingActionButton and
HangarButton are excluded as a deliberately exclusive pair.

Verified to fail against the previous code with the reported symptom:
build_button y288..436 overlapping action_button y324.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 12:09:44 +02:00