30 lines
1.2 KiB
GDScript
30 lines
1.2 KiB
GDScript
extends Node2D
|
|
|
|
# Preview, not a test. Opens the TransferMenu (#24) so its layout can be
|
|
# checked on a real viewport - four buttons, two captions and the shared
|
|
# header have to coexist without collisions, which no headless test can see.
|
|
#
|
|
# bash tests/screenshot.sh res://tests/_transfer_menu_preview.tscn /tmp/m.png 20 720x1280
|
|
# ... and again at 720x960 to check a shorter screen format.
|
|
|
|
|
|
func _ready() -> void:
|
|
GameState.buildings.clear()
|
|
GameState.extractors.clear()
|
|
GameState.transporters.clear()
|
|
GameState.rocks = 180
|
|
GameState.gas = 36
|
|
GameState.fleet_cargo = 24
|
|
GameState.fleet_gas_cargo = 12
|
|
GameState.unlocked = ["shipyards", "logistics", "freight"]
|
|
var main: Node = load("res://Main.tscn").instantiate()
|
|
add_child(main)
|
|
main.get_node("BuildingField").place(GameState.BUILDING_SHIP_CRAFTER, Vector2(400.0, 0.0))
|
|
var crafter_id: int = int(GameState.buildings[-1].id)
|
|
GameState.deposit_to_building(crafter_id, 42)
|
|
GameState.find_building(crafter_id).gas_stock = 18
|
|
var bc: Node = main.get_node("BuildController")
|
|
bc.transfer_building_id = crafter_id
|
|
main.get_node("UI/TransferMenu").visible = true
|
|
bc._refresh_transfer()
|
|
bc.transfer_status.text = "Moved 25 ore into this building"
|