Files
Blockline/tests/map_menu_visual.gd
T

31 lines
980 B
GDScript

extends SceneTree
func _initialize() -> void:
call_deferred("run")
func run() -> void:
create_timer(45).timeout.connect(func(): quit(2))
var game := (load("res://scenes/main.tscn") as PackedScene).instantiate() as Node3D
root.add_child(game)
while not game.ready_for_play: await process_frame
game.ui.play_menu()
game.ui.fields.map.select(1)
await create_timer(0.3).timeout
await RenderingServer.frame_post_draw
root.get_texture().get_image().save_png("res://logs/map-play-menu.png")
game.ui.host_menu()
await create_timer(0.3).timeout
await RenderingServer.frame_post_draw
root.get_texture().get_image().save_png("res://logs/map-host-menu.png")
var settings: Dictionary = game.config.duplicate()
settings["map"] = "dust2"
game.port = 27994
game.host(settings)
await create_timer(1).timeout
await RenderingServer.frame_post_draw
root.get_texture().get_image().save_png("res://logs/dust-gameplay.png")
game.leave()
await process_frame
game.free()
quit()