saumwacht-godot/tools/menu_review.gd
Martin Stickelbroeck c2b447610c Baseline: Saumwacht 0.15.0 (Phase 20A) vor dem Umbau zu Champions of Luneraria
Unveränderter Ausgangsstand inklusive Masterprompt und Konzeptbildern
unter assets/. .godot/ und docs/screenshots/ bleiben laut .gitignore
unversioniert; letztere sind unter ../backups gesichert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 20:00:36 +02:00

71 lines
2.6 KiB
GDScript

extends Node
## Phase 20A captures of the real menu: title, Bund selection, options, focus, result screen.
## Run: godot --path . --resolution 1920x1080 res://tools/menu_review.tscn
var main: Node3D
var captures := "res://docs/screenshots/phase20/after"
var tag := ""
func _ready() -> void:
call_deferred("run")
func shot(name: String, frames: int = 14) -> void:
for n: int in range(frames): await get_tree().process_frame
await RenderingServer.frame_post_draw
get_viewport().get_texture().get_image().save_png(captures + "/" + name + "-" + tag + ".png")
print("MENU_SHOT: ", name, " ", get_viewport().get_texture().get_size())
func wait_stage() -> void:
var stage: Node3D = main.hud.main_menu.stage
while not (stage.is_ready("glutpakt") and stage.is_ready("wurzelbund")):
await get_tree().process_frame
while stage.is_moving():
await get_tree().process_frame
func run() -> void:
tag = "%dx%d" % [get_window().size.x, get_window().size.y]
Soundscape.enabled = false
WaveManager.set_physics_process(false)
GameState.factions = ["wurzelbund", "glutpakt"]
main = preload("res://scenes/main.tscn").instantiate()
add_child(main)
var menu: MainMenu = main.hud.main_menu
await wait_stage()
await shot("title")
menu.new_game_button.pressed.emit()
await wait_stage()
await shot("setup-wurzelbund", 30)
menu.faction_choice.cards[0].pressed.emit()
await wait_stage()
await shot("setup-glutpakt", 30)
menu._toggle_advanced()
await shot("setup-advanced")
menu._toggle_advanced()
# Real keyboard navigation: focus starts on the selected card, Right moves to the other one.
menu.faction_choice.focus_selected()
await get_tree().process_frame
for code: Key in [KEY_RIGHT]:
var press := InputEventKey.new()
press.keycode = code
press.physical_keycode = code
press.pressed = true
get_viewport().push_input(press)
var release := press.duplicate()
release.pressed = false
get_viewport().push_input(release)
print("FOCUS_OWNER: ", get_viewport().gui_get_focus_owner().name if get_viewport().gui_get_focus_owner() != null else "none")
await shot("setup-focus")
main.hud.toggle_settings()
await shot("options")
main.hud.toggle_settings()
GameState.set_phase(GameState.Phase.GAME_OVER)
GameState.outcome = 0
GameState.wave = 20
main.hud._phase_changed(GameState.phase)
await wait_stage()
await shot("result")
# The HUD after the menu hands over: same panels, now on a 16:9 canvas.
GameState.reset_match()
await wait_stage()
menu.new_game_button.pressed.emit()
menu.start_button.pressed.emit()
await get_tree().create_timer(.5).timeout
main.hud._starter_button.pressed.emit()
await shot("ingame-build", 20)
print("MENU_REVIEW_PASS")
await Soundscape.quit_game()