29 lines
1.2 KiB
GDScript3
29 lines
1.2 KiB
GDScript3
|
|
extends Node2D
|
||
|
|
|
||
|
|
# Preview, not a test - #216's crew menu on a transport hub: how many are
|
||
|
|
# assigned, how many stand there, and what each of them has left.
|
||
|
|
#
|
||
|
|
# bash tests/screenshot.sh res://tests/_station_menu_preview.tscn shots/station_menu.png 3 720x1280
|
||
|
|
|
||
|
|
|
||
|
|
func _ready() -> void:
|
||
|
|
GameState.buildings.clear()
|
||
|
|
GameState.extractors.clear()
|
||
|
|
GameState.transporters.clear()
|
||
|
|
GameState.reset_progression()
|
||
|
|
GameState.intro_active = false
|
||
|
|
GameState.unlocked = ["shipyards", "logistics", "freight", "freight_yards"]
|
||
|
|
GameState.add_building(GameState.BUILDING_MOTHERSHIP, Vector2.ZERO)
|
||
|
|
var hub_id: int = GameState.add_building(GameState.BUILDING_TRANSPORT_HUB,
|
||
|
|
Vector2(700.0, 0.0))
|
||
|
|
load("res://tests/_staff.gd").staff(GameState, hub_id, GameState.hub_capacity())
|
||
|
|
# Worn to different degrees, so the bars have something to say.
|
||
|
|
var wear: Array = [GameState.TRANSPORTER_TRIPS, 9, 2]
|
||
|
|
for i in range(GameState.transporters.size()):
|
||
|
|
GameState.transporters[i].trips_left = int(wear[i % wear.size()])
|
||
|
|
|
||
|
|
var main: Node = load("res://world/Main.tscn").instantiate()
|
||
|
|
add_child(main)
|
||
|
|
main.get_node("AsteroidField").set_process(false)
|
||
|
|
main.get_node("EnemySpawner").set_process(false)
|
||
|
|
main.get_node("UI/StationMenu").open_for(hub_id)
|