Files
Blockline/tests/front_end_render.gd
T

35 lines
1.0 KiB
GDScript

extends SceneTree
func _initialize() -> void:
call_deferred("run")
func capture(label: String) -> void:
for frame in 4: await process_frame
await RenderingServer.frame_post_draw
root.get_texture().get_image().save_png("res://logs/front-" + label + ".png")
func run() -> void:
create_timer(60).timeout.connect(func(): quit(1))
var game: Node3D = load("res://scenes/main.tscn").instantiate()
root.add_child(game)
await capture("loading")
while not game.ready_for_play: await process_frame
await capture("main")
var front: FrontEnd = game.ui.root.get_child(0)
for item in front.find_children("*", "Button", true, false):
if item.text == "SETTINGS": item.pressed.emit()
if game.ui.page != "settings":
push_error("Settings navigation failed")
quit(1)
return
await process_frame
game.ui.main_menu()
await capture("return")
root.mode = Window.MODE_WINDOWED
root.size = Vector2i(1280, 720)
await capture("1280")
print("FRONT END RENDER PASS")
game.queue_free()
for frame in 4: await process_frame
quit()