From 42535c73208a206ae0ef5bed04e3ab7d9a930ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Wisniewski?= Date: Mon, 17 Aug 2026 19:47:09 +0200 Subject: [PATCH] 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. --- Main.tscn | 107 ++++++++++++++++++++----------------- PlanetSurface.tscn | 6 ++- tests/_lab_menu_preview.gd | 32 +++++------ 3 files changed, 74 insertions(+), 71 deletions(-) diff --git a/Main.tscn b/Main.tscn index e7a1427..536b8f5 100644 --- a/Main.tscn +++ b/Main.tscn @@ -227,10 +227,12 @@ visible = false mouse_filter = 2 anchor_left = 1.0 anchor_right = 1.0 +anchor_top = 1.0 +anchor_bottom = 1.0 offset_left = -94 offset_right = -24 -offset_top = 740 -offset_bottom = 920 +offset_top = -720 +offset_bottom = -560 script = ExtResource("31") [node name="Label" type="Label" parent="UI/SpeedFader"] @@ -1295,11 +1297,12 @@ text = "" mouse_filter = 2 anchor_left = 0.5 anchor_right = 0.5 -offset_left = -330 -offset_right = -210 +offset_left = -310 +offset_right = -230 offset_top = 400 -offset_bottom = 460 -theme_override_font_sizes/font_size = 22 +offset_bottom = 472 +theme_override_font_sizes/font_size = 15 +autowrap_mode = 2 horizontal_alignment = 1 text = "Interceptor" @@ -1307,11 +1310,12 @@ text = "Interceptor" mouse_filter = 2 anchor_left = 0.5 anchor_right = 0.5 -offset_left = -240 -offset_right = -120 +offset_left = -220 +offset_right = -140 offset_top = 400 -offset_bottom = 460 -theme_override_font_sizes/font_size = 22 +offset_bottom = 472 +theme_override_font_sizes/font_size = 15 +autowrap_mode = 2 horizontal_alignment = 1 text = "Shield" @@ -1319,11 +1323,12 @@ text = "Shield" mouse_filter = 2 anchor_left = 0.5 anchor_right = 0.5 -offset_left = -150 -offset_right = -30 +offset_left = -130 +offset_right = -50 offset_top = 400 -offset_bottom = 460 -theme_override_font_sizes/font_size = 22 +offset_bottom = 472 +theme_override_font_sizes/font_size = 15 +autowrap_mode = 2 horizontal_alignment = 1 text = "Gas Bomber" @@ -1331,11 +1336,12 @@ text = "Gas Bomber" mouse_filter = 2 anchor_left = 0.5 anchor_right = 0.5 -offset_left = -60 -offset_right = 60 +offset_left = -40 +offset_right = 40 offset_top = 400 -offset_bottom = 460 -theme_override_font_sizes/font_size = 22 +offset_bottom = 472 +theme_override_font_sizes/font_size = 15 +autowrap_mode = 2 horizontal_alignment = 1 text = "Transporter" @@ -1343,11 +1349,12 @@ text = "Transporter" mouse_filter = 2 anchor_left = 0.5 anchor_right = 0.5 -offset_left = 30 -offset_right = 150 +offset_left = 50 +offset_right = 130 offset_top = 400 -offset_bottom = 460 -theme_override_font_sizes/font_size = 22 +offset_bottom = 472 +theme_override_font_sizes/font_size = 15 +autowrap_mode = 2 horizontal_alignment = 1 text = "Carrier" @@ -1355,11 +1362,12 @@ text = "Carrier" mouse_filter = 2 anchor_left = 0.5 anchor_right = 0.5 -offset_left = 120 -offset_right = 240 +offset_left = 140 +offset_right = 220 offset_top = 400 -offset_bottom = 460 -theme_override_font_sizes/font_size = 22 +offset_bottom = 472 +theme_override_font_sizes/font_size = 15 +autowrap_mode = 2 horizontal_alignment = 1 text = "Laser Ship" @@ -1367,11 +1375,12 @@ text = "Laser Ship" mouse_filter = 2 anchor_left = 0.5 anchor_right = 0.5 -offset_left = 210 -offset_right = 330 +offset_left = 230 +offset_right = 310 offset_top = 400 -offset_bottom = 460 -theme_override_font_sizes/font_size = 22 +offset_bottom = 472 +theme_override_font_sizes/font_size = 15 +autowrap_mode = 2 horizontal_alignment = 1 text = "Distorder" @@ -1379,9 +1388,9 @@ text = "Distorder" mouse_filter = 2 anchor_right = 1.0 offset_left = 48 -offset_top = 462 +offset_top = 480 offset_right = -48 -offset_bottom = 466 +offset_bottom = 484 color = Color(0.25, 0.85, 1, 0.6) [node name="UpgradeList" type="Label" parent="UI/LabMenu"] @@ -1390,7 +1399,7 @@ mouse_filter = 2 anchor_right = 1.0 anchor_bottom = 1.0 offset_left = 32 -offset_top = 470 +offset_top = 488 offset_right = -32 offset_bottom = -470 theme_override_font_sizes/font_size = 30 @@ -1472,8 +1481,8 @@ anchor_left = 0.5 anchor_right = 0.5 offset_left = -240 offset_right = -120 -offset_top = 470 -offset_bottom = 580 +offset_top = 488 +offset_bottom = 598 script = ExtResource("10") icon = 13 glow_color = Color(0.25, 0.85, 1, 1) @@ -1484,8 +1493,8 @@ anchor_left = 0.5 anchor_right = 0.5 offset_left = -310 offset_right = -50 -offset_top = 585 -offset_bottom = 655 +offset_top = 603 +offset_bottom = 673 theme_override_font_sizes/font_size = 22 autowrap_mode = 2 horizontal_alignment = 1 @@ -1496,8 +1505,8 @@ anchor_left = 0.5 anchor_right = 0.5 offset_left = 120 offset_right = 240 -offset_top = 470 -offset_bottom = 580 +offset_top = 488 +offset_bottom = 598 script = ExtResource("10") icon = 13 glow_color = Color(0.25, 0.85, 1, 1) @@ -1508,8 +1517,8 @@ anchor_left = 0.5 anchor_right = 0.5 offset_left = 50 offset_right = 310 -offset_top = 585 -offset_bottom = 655 +offset_top = 603 +offset_bottom = 673 theme_override_font_sizes/font_size = 22 autowrap_mode = 2 horizontal_alignment = 1 @@ -1520,8 +1529,8 @@ anchor_left = 0.5 anchor_right = 0.5 offset_left = -240 offset_right = -120 -offset_top = 660 -offset_bottom = 765 +offset_top = 678 +offset_bottom = 783 script = ExtResource("10") icon = 13 glow_color = Color(0.25, 0.85, 1, 1) @@ -1532,8 +1541,8 @@ anchor_left = 0.5 anchor_right = 0.5 offset_left = -310 offset_right = -50 -offset_top = 770 -offset_bottom = 815 +offset_top = 788 +offset_bottom = 833 theme_override_font_sizes/font_size = 22 autowrap_mode = 2 horizontal_alignment = 1 @@ -1544,8 +1553,8 @@ anchor_left = 0.5 anchor_right = 0.5 offset_left = 120 offset_right = 240 -offset_top = 660 -offset_bottom = 765 +offset_top = 678 +offset_bottom = 783 script = ExtResource("10") icon = 13 glow_color = Color(0.25, 0.85, 1, 1) @@ -1556,8 +1565,8 @@ anchor_left = 0.5 anchor_right = 0.5 offset_left = 50 offset_right = 310 -offset_top = 770 -offset_bottom = 815 +offset_top = 788 +offset_bottom = 833 theme_override_font_sizes/font_size = 22 autowrap_mode = 2 horizontal_alignment = 1 diff --git a/PlanetSurface.tscn b/PlanetSurface.tscn index 709872e..56e8577 100644 --- a/PlanetSurface.tscn +++ b/PlanetSurface.tscn @@ -163,10 +163,12 @@ visible = false mouse_filter = 2 anchor_left = 1.0 anchor_right = 1.0 +anchor_top = 1.0 +anchor_bottom = 1.0 offset_left = -94 offset_right = -24 -offset_top = 740 -offset_bottom = 920 +offset_top = -720 +offset_bottom = -560 script = ExtResource("17") glow_color = Color(0.5, 0.18, 0.6, 1) core_color = Color(0.02, 0.09, 0.15, 1) diff --git a/tests/_lab_menu_preview.gd b/tests/_lab_menu_preview.gd index d78c1b6..80db449 100644 --- a/tests/_lab_menu_preview.gd +++ b/tests/_lab_menu_preview.gd @@ -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()