Remove the one-way ore API superseded by the transfer menu

The loose end from #24. withdraw_to_fleet, unload_into_building and
deliver_cargo were the old one-way moves behind "Load ore" and "Store
ore here"; every one of them is a special case of transfer_to_building /
transfer_to_fleet, and none had a caller left outside tests. The
cargo_delivered signal had no listeners at all.

Not just tidying: unload_into_building routed through
deposit_to_building, which does NOT special-case the mothership - it
writes b.stock, while building_holdings() returns `rocks` for a
mothership and ignores stock entirely. So unload_into_building(
mothership_id) would have parked ore in a field nothing reads, with no
error. Nothing called it that way, but it is a plausibly-named function
sitting there to be reached for later. transfer_to_building handles it.

CARGO_LOAD_BATCH stays - the transfer menu's batch buttons use it; only
its role as withdraw_to_fleet's default argument is gone.

The #24 note expected folding these in to be costly for
test_cargo_readout, which places no buildings. It is not: the transfer
primitives work off GameState records rather than spawned nodes, so a
single add_building() in setup is enough and it stays a display test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Loïc Wisniewski 2026-08-12 13:07:52 +02:00
commit b6427b080d
27 changed files with 1085 additions and 275 deletions

328
Main.tscn
View file

@ -1,4 +1,4 @@
[gd_scene load_steps=20 format=3]
[gd_scene load_steps=21 format=3]
[ext_resource type="Script" path="res://Starfield.gd" id="1"]
[ext_resource type="Script" path="res://Fleet.gd" id="2"]
@ -23,6 +23,7 @@
[ext_resource type="Script" path="res://SkillTreeView.gd" id="21"]
[ext_resource type="Script" path="res://CargoCounter.gd" id="22"]
[ext_resource type="Script" path="res://TransporterField.gd" id="23"]
[ext_resource type="Script" path="res://ResourceBar.gd" id="24"]
[sub_resource type="ShaderMaterial" id="1"]
shader = ExtResource("5")
@ -144,6 +145,18 @@ offset_bottom = -572
script = ExtResource("10")
icon = 2
[node name="TransferButton" type="Control" parent="UI"]
visible = false
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 24
offset_right = 172
offset_top = -600
offset_bottom = -452
script = ExtResource("10")
icon = 14
glow_color = Color(1, 0.78, 0.25, 1)
[node name="MapButton" type="Control" parent="UI"]
anchor_left = 1.0
anchor_right = 1.0
@ -633,19 +646,27 @@ color = Color(0.03, 0.03, 0.08, 0.94)
mouse_filter = 2
anchor_right = 1.0
offset_left = 24
offset_top = 60
offset_right = -24
offset_bottom = 170
offset_top = 36
offset_right = -200
offset_bottom = 166
text = "Ship Lab"
horizontal_alignment = 1
[node name="Bar" type="Control" parent="UI/LabMenu"]
mouse_filter = 2
offset_left = 24
offset_top = 180
offset_right = 520
offset_bottom = 260
script = ExtResource("24")
[node name="VesselA" type="Control" parent="UI/LabMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = -290
offset_right = -170
offset_top = 190
offset_bottom = 310
offset_top = 274
offset_bottom = 394
script = ExtResource("10")
icon = 2
glow_color = Color(0.25, 0.85, 1, 1)
@ -655,8 +676,8 @@ anchor_left = 0.5
anchor_right = 0.5
offset_left = -60
offset_right = 60
offset_top = 190
offset_bottom = 310
offset_top = 274
offset_bottom = 394
script = ExtResource("10")
icon = 2
glow_color = Color(0.45, 0.8, 1, 1)
@ -666,8 +687,8 @@ anchor_left = 0.5
anchor_right = 0.5
offset_left = 170
offset_right = 290
offset_top = 190
offset_bottom = 310
offset_top = 274
offset_bottom = 394
script = ExtResource("10")
icon = 12
glow_color = Color(0.95, 0.55, 0.85, 1)
@ -676,9 +697,9 @@ glow_color = Color(0.95, 0.55, 0.85, 1)
mouse_filter = 2
anchor_right = 1.0
offset_left = 24
offset_top = 318
offset_top = 402
offset_right = -24
offset_bottom = 380
offset_bottom = 460
theme_override_font_sizes/font_size = 34
horizontal_alignment = 1
text = ""
@ -688,7 +709,7 @@ mouse_filter = 2
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 32
offset_top = 396
offset_top = 470
offset_right = -32
offset_bottom = -470
theme_override_font_sizes/font_size = 30
@ -788,20 +809,28 @@ color = Color(0.03, 0.03, 0.08, 0.94)
mouse_filter = 2
anchor_right = 1.0
offset_left = 24
offset_top = 70
offset_right = -24
offset_bottom = 196
offset_top = 36
offset_right = -200
offset_bottom = 166
text = "Build a ship"
horizontal_alignment = 1
[node name="Bar" type="Control" parent="UI/CraftMenu"]
mouse_filter = 2
offset_left = 24
offset_top = 180
offset_right = 520
offset_bottom = 260
script = ExtResource("24")
[node name="StatusLabel" type="Label" parent="UI/CraftMenu"]
mouse_filter = 2
anchor_right = 1.0
offset_left = 24
offset_top = 206
offset_top = 274
offset_right = -24
offset_bottom = 360
theme_override_font_sizes/font_size = 40
offset_bottom = 420
theme_override_font_sizes/font_size = 36
autowrap_mode = 2
text = ""
horizontal_alignment = 1
@ -813,8 +842,8 @@ anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -234
offset_right = -86
offset_top = -74
offset_bottom = 74
offset_top = 60
offset_bottom = 208
script = ExtResource("10")
icon = 2
@ -826,8 +855,8 @@ anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -300
offset_right = -20
offset_top = 100
offset_bottom = 200
offset_top = 216
offset_bottom = 296
theme_override_font_sizes/font_size = 32
text = "Interceptor"
horizontal_alignment = 1
@ -839,8 +868,8 @@ anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 86
offset_right = 234
offset_top = -74
offset_bottom = 74
offset_top = 60
offset_bottom = 208
script = ExtResource("10")
icon = 12
glow_color = Color(0.95, 0.55, 0.85, 1)
@ -853,8 +882,8 @@ anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 20
offset_right = 300
offset_top = 96
offset_bottom = 176
offset_top = 216
offset_bottom = 296
theme_override_font_sizes/font_size = 32
autowrap_mode = 2
text = "Transporter"
@ -867,8 +896,8 @@ anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -74
offset_right = 74
offset_top = -260
offset_bottom = -112
offset_top = -200
offset_bottom = -52
script = ExtResource("10")
icon = 2
glow_color = Color(0.45, 0.8, 1, 1)
@ -881,41 +910,13 @@ anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -160
offset_right = 160
offset_top = -104
offset_bottom = -44
offset_top = -44
offset_bottom = 16
theme_override_font_sizes/font_size = 32
autowrap_mode = 2
text = "Shield Vessel"
horizontal_alignment = 1
[node name="StoreOreButton" type="Control" parent="UI/CraftMenu"]
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -74
offset_top = -304
offset_right = 74
offset_bottom = -156
script = ExtResource("10")
icon = 3
glow_color = Color(1, 0.78, 0.25, 1)
[node name="StoreOreLabel" type="Label" parent="UI/CraftMenu"]
mouse_filter = 2
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -260
offset_top = -148
offset_right = 260
offset_bottom = -24
theme_override_font_sizes/font_size = 32
autowrap_mode = 2
text = "Store ore here"
horizontal_alignment = 1
[node name="CloseButton" type="Control" parent="UI/CraftMenu"]
anchor_left = 1.0
anchor_right = 1.0
@ -926,6 +927,171 @@ offset_bottom = 172
script = ExtResource("10")
icon = 1
[node name="TransferMenu" type="Control" parent="UI" groups=["modal_menus"]]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Backdrop" type="ColorRect" parent="UI/TransferMenu"]
anchor_right = 1.0
anchor_bottom = 1.0
color = Color(0.03, 0.03, 0.08, 0.94)
[node name="TitleLabel" type="Label" parent="UI/TransferMenu"]
mouse_filter = 2
anchor_right = 1.0
offset_left = 24
offset_top = 36
offset_right = -200
offset_bottom = 166
text = "Move ore"
horizontal_alignment = 1
[node name="Bar" type="Control" parent="UI/TransferMenu"]
mouse_filter = 2
offset_left = 24
offset_top = 180
offset_right = 520
offset_bottom = 260
script = ExtResource("24")
[node name="StatusLabel" type="Label" parent="UI/TransferMenu"]
mouse_filter = 2
anchor_right = 1.0
offset_left = 24
offset_top = 274
offset_right = -24
offset_bottom = 396
theme_override_font_sizes/font_size = 34
autowrap_mode = 2
text = ""
horizontal_alignment = 1
[node name="ToBuildingLabel" type="Label" parent="UI/TransferMenu"]
mouse_filter = 2
anchor_right = 1.0
offset_left = 24
offset_top = 400
offset_right = -24
offset_bottom = 452
theme_override_font_sizes/font_size = 34
text = ""
horizontal_alignment = 1
[node name="ToBuildingBatchButton" type="Control" parent="UI/TransferMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = -184
offset_right = -36
offset_top = 462
offset_bottom = 610
script = ExtResource("10")
icon = 3
glow_color = Color(0.45, 0.9, 0.55, 1)
[node name="ToBuildingBatchLabel" type="Label" parent="UI/TransferMenu"]
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -230
offset_right = 10
offset_top = 616
offset_bottom = 668
theme_override_font_sizes/font_size = 30
text = ""
horizontal_alignment = 1
[node name="ToBuildingAllButton" type="Control" parent="UI/TransferMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = 36
offset_right = 184
offset_top = 462
offset_bottom = 610
script = ExtResource("10")
icon = 3
glow_color = Color(0.45, 0.9, 0.55, 1)
[node name="ToBuildingAllLabel" type="Label" parent="UI/TransferMenu"]
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -10
offset_right = 230
offset_top = 616
offset_bottom = 668
theme_override_font_sizes/font_size = 30
text = "All"
horizontal_alignment = 1
[node name="ToFleetLabel" type="Label" parent="UI/TransferMenu"]
mouse_filter = 2
anchor_right = 1.0
offset_left = 24
offset_top = 694
offset_right = -24
offset_bottom = 746
theme_override_font_sizes/font_size = 34
text = ""
horizontal_alignment = 1
[node name="ToFleetBatchButton" type="Control" parent="UI/TransferMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = -184
offset_right = -36
offset_top = 756
offset_bottom = 904
script = ExtResource("10")
icon = 4
glow_color = Color(1, 0.78, 0.25, 1)
[node name="ToFleetBatchLabel" type="Label" parent="UI/TransferMenu"]
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -230
offset_right = 10
offset_top = 910
offset_bottom = 962
theme_override_font_sizes/font_size = 30
text = ""
horizontal_alignment = 1
[node name="ToFleetAllButton" type="Control" parent="UI/TransferMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = 36
offset_right = 184
offset_top = 756
offset_bottom = 904
script = ExtResource("10")
icon = 4
glow_color = Color(1, 0.78, 0.25, 1)
[node name="ToFleetAllLabel" type="Label" parent="UI/TransferMenu"]
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -10
offset_right = 230
offset_top = 910
offset_bottom = 962
theme_override_font_sizes/font_size = 30
text = "All"
horizontal_alignment = 1
[node name="CloseButton" type="Control" parent="UI/TransferMenu"]
anchor_left = 1.0
anchor_right = 1.0
offset_left = -172
offset_right = -24
offset_top = 24
offset_bottom = 172
script = ExtResource("10")
icon = 1
glow_color = Color(1, 0.78, 0.25, 1)
[node name="FormationMenu" type="Control" parent="UI" groups=["modal_menus"]]
visible = false
mouse_filter = 2
@ -1026,18 +1192,26 @@ color = Color(0.03, 0.03, 0.08, 0.94)
mouse_filter = 2
anchor_right = 1.0
offset_left = 24.0
offset_top = 70.0
offset_right = -24.0
offset_bottom = 196.0
offset_top = 36.0
offset_right = -200.0
offset_bottom = 166.0
text = "Research"
horizontal_alignment = 1
[node name="Bar" type="Control" parent="UI/SkillMenu"]
mouse_filter = 2
offset_left = 24.0
offset_top = 180.0
offset_right = 520.0
offset_bottom = 260.0
script = ExtResource("24")
[node name="Tree" type="Control" parent="UI/SkillMenu"]
mouse_filter = 2
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 24.0
offset_top = 210.0
offset_top = 274.0
offset_right = -24.0
offset_bottom = -620.0
script = ExtResource("21")
@ -1096,34 +1270,6 @@ script = ExtResource("10")
icon = 5
glow_color = Color(0.45, 0.9, 0.55, 1)
[node name="LoadOreButton" type="Control" parent="UI/SkillMenu"]
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -256.0
offset_top = -304.0
offset_right = -108.0
offset_bottom = -156.0
script = ExtResource("10")
icon = 4
glow_color = Color(1, 0.78, 0.25, 1)
[node name="LoadOreLabel" type="Label" parent="UI/SkillMenu"]
mouse_filter = 2
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -330.0
offset_top = -150.0
offset_right = -30.0
offset_bottom = -14.0
theme_override_font_sizes/font_size = 28
horizontal_alignment = 1
autowrap_mode = 2
text = "Load ore"
[node name="CloseButton" type="Control" parent="UI/SkillMenu"]
anchor_left = 1.0
anchor_right = 1.0