34 lines
1.3 KiB
GDScript
34 lines
1.3 KiB
GDScript
extends Node2D
|
|
|
|
# Preview, not a test. The ship lab's upgrade screen (#5), so its layout can
|
|
# be checked on a real viewport - headless draws no pixels.
|
|
#
|
|
# bash tests/screenshot.sh res://tests/_lab_menu_preview.tscn /tmp/lab.png 20 720x1280
|
|
|
|
|
|
func _ready() -> void:
|
|
GameState.buildings.clear()
|
|
GameState.extractors.clear()
|
|
GameState.transporters.clear()
|
|
GameState.reset_progression()
|
|
GameState.rocks = 240
|
|
GameState.gas = 36
|
|
GameState.unlocked = ["shipyards", "vessel_science"]
|
|
var main: Node = load("res://Main.tscn").instantiate()
|
|
add_child(main)
|
|
main.get_node("BuildingField").place(GameState.BUILDING_SHIP_LAB, Vector2(400.0, 0.0))
|
|
var lab_id: int = int(GameState.buildings[-1].id)
|
|
GameState.deposit_to_building(lab_id, 18)
|
|
GameState.fleet_cargo = 12
|
|
GameState.fleet_gas_cargo = 8
|
|
# A level already bought, so the list shows both a researched and an
|
|
# unresearched line rather than a uniform page of zeroes.
|
|
GameState.vessel_levels["int_damage"] = 1
|
|
var bc: Node = main.get_node("BuildController")
|
|
# The shared header (#24) hides its HERE column when it has no building,
|
|
# so bind it the way opening the panel from the building does.
|
|
for bar in bc.resource_bars:
|
|
bar.building_id = lab_id
|
|
main.get_node("UI/LabMenu").visible = true
|
|
bc.lab_vessel = GameState.VESSEL_INTERCEPTOR
|
|
bc._refresh_lab()
|