Transport Hub building

Forgejo #18, part 5 of #12. The building only - the vessels that do the
hauling are #19. Placeable, costed at 30, gated behind a new "Freight
Handling" research node hanging off Logistics, with its own info popup,
build-menu glyph and map marker.

Drawn as an octagonal dock ring with berth arms and a squared-off freight
core: deliberately radial-but-flat so it does not read as a small
mothership, which is the only structure with swept arms. Its stationed
transports are NeonPiece children of one rotating holder, per #10 - the
geometry is rasterised once and only the holder's rotation changes, so
the traffic costs no redraws.

Building._draw()'s match has a catch-all that renders anything
unrecognised as a ship crafter, so a missing case is silent and looks
almost right. The test checks for the hub's own _hub_traffic holder
rather than trusting that something plausible appeared - which caught
exactly that: a _ready() patch had silently not applied and the hub was
rendering through the crafter branch.

The build menu grew a third row. Every button, label and price moved:
the old row occupied 332px against a 372px pitch, and three of those do
not fit above a 1280px screen. Rows are now shorter (128px buttons, 40px
price digits) at a 290px pitch, ending at y=1176. Rendered and looked at
- the first attempt tightened the pitch alone and left every price
overlapping the row beneath it, which no headless test would have seen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Loïc Wisniewski 2026-08-11 17:45:07 +02:00
commit 823828f3b3
10 changed files with 400 additions and 52 deletions

138
Main.tscn
View file

@ -270,10 +270,10 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -214
offset_right = -66
offset_top = -254
offset_bottom = -106
offset_left = -204
offset_right = -76
offset_top = -300
offset_bottom = -172
script = ExtResource("10")
icon = 8
glow_color = Color(0.45, 0.9, 0.55, 1)
@ -286,9 +286,9 @@ anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -290
offset_right = 10
offset_top = -96
offset_bottom = 4
theme_override_font_sizes/font_size = 36
offset_top = -166
offset_bottom = -100
theme_override_font_sizes/font_size = 32
autowrap_mode = 2
text = "Mothership"
horizontal_alignment = 1
@ -299,23 +299,23 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -204
offset_right = -64
offset_top = 14
offset_bottom = 78
offset_left = -200
offset_right = -80
offset_top = -96
offset_bottom = -44
script = ExtResource("19")
amount = 20
digit_height = 52.0
digit_height = 40.0
[node name="CrafterButton" type="Control" parent="UI/BuildMenu"]
anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 66
offset_right = 214
offset_top = -254
offset_bottom = -106
offset_left = 76
offset_right = 204
offset_top = -300
offset_bottom = -172
script = ExtResource("10")
icon = 9
glow_color = Color(1, 0.72, 0.25, 1)
@ -328,9 +328,9 @@ anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -10
offset_right = 290
offset_top = -96
offset_bottom = 4
theme_override_font_sizes/font_size = 36
offset_top = -166
offset_bottom = -100
theme_override_font_sizes/font_size = 32
autowrap_mode = 2
text = "Ship Crafter"
horizontal_alignment = 1
@ -341,23 +341,23 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 76
offset_right = 216
offset_top = 14
offset_bottom = 78
offset_left = 80
offset_right = 200
offset_top = -96
offset_bottom = -44
script = ExtResource("19")
amount = 12
digit_height = 52.0
digit_height = 40.0
[node name="CommandButton" type="Control" parent="UI/BuildMenu"]
anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -214
offset_right = -66
offset_top = 118
offset_bottom = 266
offset_left = -204
offset_right = -76
offset_top = -10
offset_bottom = 118
script = ExtResource("10")
icon = 10
glow_color = Color(0.55, 0.6, 1, 1)
@ -370,9 +370,9 @@ anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -290
offset_right = 10
offset_top = 276
offset_bottom = 376
theme_override_font_sizes/font_size = 36
offset_top = 124
offset_bottom = 190
theme_override_font_sizes/font_size = 32
autowrap_mode = 2
text = "Command Center"
horizontal_alignment = 1
@ -383,23 +383,23 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -204
offset_right = -64
offset_top = 386
offset_bottom = 450
offset_left = -200
offset_right = -80
offset_top = 194
offset_bottom = 246
script = ExtResource("19")
amount = 15
digit_height = 52.0
digit_height = 40.0
[node name="ExtractorButton" type="Control" parent="UI/BuildMenu"]
anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 66
offset_right = 214
offset_top = 118
offset_bottom = 266
offset_left = 76
offset_right = 204
offset_top = -10
offset_bottom = 118
script = ExtResource("10")
icon = 11
glow_color = Color(0, 0.62, 0.7, 1)
@ -412,9 +412,9 @@ anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -10
offset_right = 290
offset_top = 276
offset_bottom = 376
theme_override_font_sizes/font_size = 36
offset_top = 124
offset_bottom = 190
theme_override_font_sizes/font_size = 32
autowrap_mode = 2
text = "Extractor"
horizontal_alignment = 1
@ -425,13 +425,55 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 76
offset_right = 216
offset_top = 386
offset_bottom = 450
offset_left = 80
offset_right = 200
offset_top = 194
offset_bottom = 246
script = ExtResource("19")
amount = 25
digit_height = 52.0
digit_height = 40.0
[node name="TransportHubButton" type="Control" parent="UI/BuildMenu"]
anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -64
offset_right = 64
offset_top = 280
offset_bottom = 408
script = ExtResource("10")
icon = 12
glow_color = Color(0.95, 0.55, 0.85, 1)
[node name="TransportHubLabel" type="Label" parent="UI/BuildMenu"]
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -150
offset_right = 150
offset_top = 414
offset_bottom = 480
theme_override_font_sizes/font_size = 32
autowrap_mode = 2
text = "Transport Hub"
horizontal_alignment = 1
[node name="TransportHubCost" type="Control" parent="UI/BuildMenu"]
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -60
offset_right = 60
offset_top = 484
offset_bottom = 536
script = ExtResource("19")
amount = 30
digit_height = 40.0
[node name="CloseButton" type="Control" parent="UI/BuildMenu"]
anchor_left = 1.0