Correct gas HUD and transfer rows

This commit is contained in:
Loïc Wisniewski 2026-08-13 23:25:46 +02:00
commit ac5b5415f5
3 changed files with 52 additions and 53 deletions

View file

@ -72,6 +72,12 @@ func _tap(button: Control) -> void:
button._gui_input(ev)
func _open_transfer() -> void:
# Contextual choices collapse into one button until it is opened.
_tap(controller.action_button)
_tap(controller.transfer_button)
func _expect(condition: bool, message: String) -> void:
if not condition:
failures.append("stage %d: %s" % [stage, message])
@ -102,9 +108,7 @@ func _process(delta: float) -> bool:
return false
_expect(controller.current_building != null,
"parking on the crafter never registered")
_expect(controller.transfer_button.visible,
"the transfer button did not appear at a building")
_tap(controller.transfer_button)
_open_transfer()
_expect(controller.transfer_menu.visible,
"tapping the transfer button did not open the panel")
_expect(controller.transfer_building_id == crafter_id,
@ -156,9 +160,7 @@ func _process(delta: float) -> bool:
# --- 3. the mothership's holdings are the bank --------------
if elapsed < 1.2:
return false
_expect(controller.transfer_button.visible,
"the transfer button did not appear at the mothership")
_tap(controller.transfer_button)
_open_transfer()
_expect(controller.transfer_building_id == mothership_id,
"panel bound to %d, mothership is %d"
% [controller.transfer_building_id, mothership_id])
@ -178,11 +180,10 @@ func _process(delta: float) -> bool:
# The handler working while the BUTTON is inert is the exact bug
# class this project keeps hitting, so one press goes the long way.
var bank_at_tap: int = game_state.rocks
_tap(scene.get_node("UI/TransferMenu/ToFleetBatchButton"))
_expect(game_state.fleet_cargo == GameState.CARGO_LOAD_BATCH,
"a real tap loaded %d, expected a batch of %d"
% [game_state.fleet_cargo, GameState.CARGO_LOAD_BATCH])
_expect(game_state.rocks == bank_at_tap - GameState.CARGO_LOAD_BATCH,
_tap(scene.get_node("UI/TransferMenu/ToFleetAllButton"))
_expect(game_state.fleet_cargo == bank_at_tap,
"a real tap did not load all banked ore")
_expect(game_state.rocks == 0,
"the bank did not pay for the tapped withdrawal")
# --- 7. conservation ----------------------------------------