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:
parent
fe1c721d64
commit
b6427b080d
27 changed files with 1085 additions and 275 deletions
|
|
@ -1,8 +1,8 @@
|
|||
extends Node2D
|
||||
|
||||
# Preview, not a test. Opens the SkillMenu so its layout can be checked on a
|
||||
# real viewport - the mothership's "Load ore" label was falling off the bottom
|
||||
# of shorter screens, which no headless test can see.
|
||||
# real viewport - the tree lost vertical room to the shared resource header
|
||||
# (#24), and whether it still fits is a thing only pixels can answer.
|
||||
#
|
||||
# bash tests/screenshot.sh res://tests/_skill_menu_preview.tscn /tmp/m.png 20 720x1280
|
||||
# ... and again at 720x960 to check a shorter screen format.
|
||||
|
|
@ -17,15 +17,13 @@ func _ready() -> void:
|
|||
GameState.unlocked = ["shipyards", "logistics", "freight"]
|
||||
var main: Node = load("res://Main.tscn").instantiate()
|
||||
add_child(main)
|
||||
main.get_node("BuildingField").place(GameState.BUILDING_TRANSPORT_HUB, Vector2(400.0, 0.0))
|
||||
main.get_node("BuildingField").place(GameState.BUILDING_MOTHERSHIP, Vector2(400.0, 0.0))
|
||||
var mothership_id: int = int(GameState.buildings[-1].id)
|
||||
var bc: Node = main.get_node("BuildController")
|
||||
bc.craft_building_id = 1
|
||||
for bar in bc.resource_bars:
|
||||
bar.building_id = mothership_id
|
||||
main.get_node("UI/SkillMenu").visible = true
|
||||
if "Skill" == "Craft":
|
||||
bc._refresh_craft_status()
|
||||
else:
|
||||
bc._refresh_load_ore()
|
||||
# Select a node so the description, price and status all have text -
|
||||
# an empty description cannot collide with anything.
|
||||
bc.skill_tree.selected_id = "freight"
|
||||
bc._refresh_skill_menu("freight")
|
||||
# Select a node so the description, price and status all have text - an
|
||||
# empty description cannot collide with anything.
|
||||
bc.skill_tree.selected_id = "freight"
|
||||
bc._refresh_skill_menu("freight")
|
||||
|
|
|
|||
Loading…
Reference in a new issue