Fix the stop stutter, and hide unresearched buildings from the menu

Forgejo #13: releasing the stick paused, then moved again before
settling. stop() aims each ship at a braking point ahead of it, but the
ship's own velocity was ~0 - the anchor had been carrying it - so it
started from REST, accelerated into its own stopping distance, and
halted a second time. Measured: 0 -> 45 -> 90 -> 135 -> 180 -> brake.
stop() now hands the fleet's motion to the ship, so the release is one
continuous decelerating coast (222 -> 0) to the identical endpoint.
test_joystick_control now asserts the speed one frame after release is a
real fraction of cruise, and never rises afterwards.

Forgejo #21: unresearched structures are no longer listed greyed out.
They are hidden, and the menu repacks around what is left - a fixed grid
with entries hidden would otherwise leave holes where they used to be.
An entry alone on its row is centred rather than hanging in the left
column. Researched-but-not-usable is still shown greyed: an extractor
with no planet under the fleet is "not now", not "not yet".

This reverses a documented decision (the old comment argued that always
listing everything stops the player wondering whether the game has it at
all), so test_skill_tree's matching assertion was updated from
greyed-but-listed to hidden. The gate itself is unchanged and still
refuses a build forced past the menu.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Loïc Wisniewski 2026-08-11 21:38:17 +02:00
commit 0e071877e2
6 changed files with 261 additions and 18 deletions

View file

@ -8,8 +8,8 @@ extends SceneTree
#
# Verifies:
# 1. from a fresh start only the mothership is buildable - the others are
# greyed, and pressing one explains which research opens it rather than
# silently failing
# not in the menu at all (#21 changed this from greyed-but-listed), and
# the gate still holds if the build is forced past the menu
# 2. a locked option cannot be built even if the confirm is forced
# 3. research costs rocks, needs its prerequisite, and unlocks its building
# 4. the mothership's action button opens the tree (it used to have no
@ -69,16 +69,16 @@ func _process(delta: float) -> bool:
return true
controller._on_build_pressed()
var greyed: bool = not scene.get_node("UI/BuildMenu/CrafterButton").enabled
# Since #21 an unresearched structure is not listed at all, rather
# than listed and greyed. It is therefore unreachable from the
# menu - but the popup must still refuse if something calls
# _on_place_crafter() by another route.
var hidden: bool = not scene.get_node("UI/BuildMenu/CrafterButton").visible
controller._on_place_crafter()
var explains: bool = popup.visible \
and "research" in popup.get_node("Panel/MessageLabel").text.to_lower()
var offered: bool = popup.get_node("Panel/BuildButton").visible
print("locked crafter: greyed=%s explains=%s confirm_offered=%s" % [
greyed, explains, offered
])
if not (greyed and explains) or offered:
print("TEST_SKILL_TREE: FAIL (locked option did not explain itself)")
print("locked crafter: hidden_from_menu=%s confirm_offered=%s" % [hidden, offered])
if not hidden or offered:
print("TEST_SKILL_TREE: FAIL (unresearched option still on offer)")
quit(1)
return true