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.
This commit is contained in:
Loïc Wisniewski 2026-08-17 19:47:09 +02:00
commit 42535c7320
3 changed files with 74 additions and 71 deletions

View file

@ -1,37 +1,29 @@
extends Node2D
# Preview, not a test. The ship lab's upgrade screen (#5), so its layout can
# be checked on a real viewport - headless draws no pixels.
# 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 _ready() -> void:
func _process(_delta: float) -> void:
if configured:
return
configured = true
GameState.buildings.clear()
GameState.extractors.clear()
GameState.transporters.clear()
GameState.reset_progression()
GameState.rocks = 240
GameState.gas = 36
GameState.unlocked = ["shipyards", "vessel_science"]
GameState.rocks = 500
GameState.research_points = 5
var main: Node = load("res://Main.tscn").instantiate()
add_child(main)
main.get_node("BackgroundLayer").visible = false
main.get_node("Fleet").visible = false
main.get_node("AsteroidField").visible = false
main.get_node("PlanetField").visible = false
main.get_node("BuildingField").visible = false
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)
GameState.deposit_to_building(lab_id, 18)
GameState.fleet_cargo = 12
GameState.fleet_gas_cargo = 8
var bc: Node = main.get_node("BuildController")
# The shared header (#24) hides its HERE column when it has no building,
# so bind it the way opening the panel from the building does.
for bar in bc.resource_bars:
bar.building_id = lab_id
bc.lab_building_id = lab_id
main.get_node("UI/LabMenu").visible = true
bc.lab_vessel = GameState.VESSEL_GAS_BOMBER
bc._refresh_lab()