30 lines
874 B
GDScript
30 lines
874 B
GDScript
extends SceneTree
|
|
|
|
func _initialize() -> void:
|
|
call_deferred("run")
|
|
|
|
func capture(label: String) -> void:
|
|
for frame in 6: await process_frame
|
|
await RenderingServer.frame_post_draw
|
|
root.get_texture().get_image().save_png("res://logs/loadout-" + 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)
|
|
while not game.ready_for_play: await process_frame
|
|
game.ui.loadout_menu()
|
|
await capture("overview")
|
|
var editor: ClassEditor = game.ui.root.get_child(0)
|
|
editor.overview.open_weapon(false)
|
|
await capture("workshop")
|
|
editor.workshop.hide()
|
|
editor.overview.show()
|
|
root.mode = Window.MODE_WINDOWED
|
|
root.size = Vector2i(1280, 720)
|
|
await capture("1280")
|
|
game.queue_free()
|
|
for frame in 4: await process_frame
|
|
print("LOADOUT RENDER PASS")
|
|
quit()
|