spaceship/tests/_lab_menu_preview.gd
Loïc Wisniewski 42535c7320 Fix UI overlaps: SpeedFader vs status labels, packed ship lab layout (#67, #71)
SpeedFader was missing anchor_top/anchor_bottom = 1.0 in both Main.tscn
and PlanetSurface.tscn, so it rendered TOP-anchored at a fixed y while
its siblings (LaserStatus, GasBombStatus) are bottom-anchored - on a
720x1280 viewport both landed in the same screen region, directly on
top of each other. Properly bottom-anchored SpeedFader now, positioned
above both status labels instead.

Separately, the ship lab's 7 vessel-name labels (#57-#59 grew the
roster from 4 to 7 without widening their row) were laid out 120px wide
on only a 90px pitch - a fixed 30px overlap between adjacent labels
regardless of text length, worse for genuinely long names like
"Interceptor"/"Transporter". Narrowed each label to fit its own lane
with real gaps, dropped the font size, and enabled word-wrap; shifted
the upgrade-card rows below down to give the now-taller label row room.
2026-08-17 19:47:09 +02:00

29 lines
952 B
GDScript

extends Node2D
# Preview, not a test - #71's ship lab layout with all 7 vessels present,
# checking the vessel-name row no longer overlaps itself.
#
# bash tests/screenshot.sh res://tests/_lab_menu_preview.tscn /tmp/lab.png 20 720x1280
var configured: bool = false
func _process(_delta: float) -> void:
if configured:
return
configured = true
GameState.buildings.clear()
GameState.extractors.clear()
GameState.transporters.clear()
GameState.rocks = 500
GameState.research_points = 5
var main: Node = load("res://Main.tscn").instantiate()
add_child(main)
main.get_node("EnemySpawner").set_process(false)
main.get_node("AsteroidField").set_process(false)
main.get_node("BuildingField").place(GameState.BUILDING_SHIP_LAB, Vector2(400.0, 0.0))
var lab_id: int = int(GameState.buildings[-1].id)
var bc: Node = main.get_node("BuildController")
bc.lab_building_id = lab_id
main.get_node("UI/LabMenu").visible = true
bc._refresh_lab()