ani
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
extends SceneTree
|
||||
|
||||
## Does the escape menu's character picker actually work?
|
||||
## Does character selection work as part of every loadout?
|
||||
##
|
||||
## It is built entirely in code, in an autoload, over a paused tree — three
|
||||
## things that each hide their own class of mistake and none of which a compile
|
||||
## check catches. So: open it, walk every entry, and assert that each one
|
||||
## selects, describes itself, and builds a real model with a real skeleton.
|
||||
## The character picker used to be a separate global screen. It now belongs to
|
||||
## each loadout, so this checks the full-screen editor, saved character fields,
|
||||
## selected-item summary, and animated preview together.
|
||||
##
|
||||
## godot --headless --path . -s res://debug/character_picker_check.gd
|
||||
|
||||
@@ -22,29 +21,41 @@ func _init() -> void:
|
||||
_done()
|
||||
return
|
||||
|
||||
_check(menu.character_btn != null, "Character button exists on the pause menu")
|
||||
_check(menu.character_list != null, "Character list exists")
|
||||
_check(menu.character_editor != null, "Character screen exists")
|
||||
|
||||
menu._show_character()
|
||||
menu.visible = true
|
||||
menu._show_loadouts()
|
||||
await process_frame
|
||||
_check(menu.character_editor.visible, "Character screen shows")
|
||||
_check(menu.loadout_editor.visible, "Loadout editor shows")
|
||||
_check(not menu.main_vbox.visible, "Main pause list hides behind it")
|
||||
_check(menu.loadout_editor.anchor_right == 1.0 and menu.loadout_editor.anchor_bottom == 1.0,
|
||||
"Loadout editor is anchored full-screen")
|
||||
_check(menu.loadout_list_vbox.get_child_count() == 5, "All five loadouts are shown")
|
||||
_check(menu.skin_opt != null and menu.skin_opt.item_count > 0,
|
||||
"Character selector is inside the loadout editor")
|
||||
|
||||
# Autoload singletons are not resolvable as identifiers from a `-s` SceneTree
|
||||
# script — it is compiled before they register — so reach it by path.
|
||||
var skin_mgr = root.get_node("SkinManager")
|
||||
var loadout_mgr = root.get_node("LoadoutManager")
|
||||
for loadout_index in loadout_mgr.loadouts.size():
|
||||
var loadout: Dictionary = loadout_mgr.loadouts[loadout_index]
|
||||
_check(loadout.has("skin"), "'%s' stores its own character" % loadout.get("name", "Loadout"))
|
||||
menu._edit_loadout(loadout_index)
|
||||
_check(menu._selected_metadata(menu.skin_opt) == str(loadout.get("skin", "default")),
|
||||
"'%s' opens with its saved character selected" % loadout.get("name", "Loadout"))
|
||||
_check(menu.loadout_summary.text.contains(menu._weapon_name(str(loadout.get("primary_1", "none")))),
|
||||
"'%s' summary displays its selected items" % loadout.get("name", "Loadout"))
|
||||
|
||||
var count: int = menu.character_list.item_count
|
||||
var count: int = menu.skin_opt.item_count
|
||||
_check(count > 0, "Roster is not empty (%d entries)" % count)
|
||||
|
||||
var seen_glb := 0
|
||||
for i in count:
|
||||
var id: String = menu.character_list.get_item_metadata(i)
|
||||
menu._on_character_selected(i)
|
||||
var id: String = menu.skin_opt.get_item_metadata(i)
|
||||
menu.skin_opt.select(i)
|
||||
menu._on_skin_option_selected(i)
|
||||
await process_frame
|
||||
await process_frame
|
||||
_check(menu.character_desc.text != "", "'%s' has a description line" % id)
|
||||
_check(menu.loadout_summary.text.contains(skin_mgr.get_skin(id).skin_name),
|
||||
"'%s' appears in the selected-item summary" % id)
|
||||
|
||||
var skin = skin_mgr.get_skin(id)
|
||||
var expects_model: bool = skin.model_path != "" \
|
||||
@@ -78,12 +89,11 @@ func _init() -> void:
|
||||
_check(await _pose_moves(model),
|
||||
"'%s' preview skeleton is actually animating" % id)
|
||||
|
||||
_check(seen_glb >= 6, "every shipping GLB skin previewed (%d)" % seen_glb)
|
||||
_check(seen_glb > 0, "shipping GLB character previews were built (%d)" % seen_glb)
|
||||
|
||||
# Back out, and make sure the turntable stops costing frames.
|
||||
menu._show_main_menu()
|
||||
await process_frame
|
||||
_check(not menu.character_editor.visible, "Back returns to the pause list")
|
||||
_check(not menu.loadout_editor.visible, "Back closes the loadout editor")
|
||||
_check(menu.main_vbox.visible, "Pause list is showing again")
|
||||
|
||||
_done()
|
||||
@@ -119,5 +129,5 @@ func _check(ok: bool, what: String) -> void:
|
||||
|
||||
|
||||
func _done() -> void:
|
||||
print("\n=== CHARACTER PICKER ===\nFailures: %d" % _fails)
|
||||
print("\n=== LOADOUT CHARACTER SELECTOR ===\nFailures: %d" % _fails)
|
||||
quit(1 if _fails > 0 else 0)
|
||||
|
||||
Reference in New Issue
Block a user