7b6a141767
Move the 40-odd root-level scripts and scenes into a tree that groups by role,
per the approved roadmap (WS2/WS3): actors/{player,matador,bear}, systems/{combat,
fx,input,debug,render,crowd,config}, ui/, props/ (was tscn_s/). Rename the shell
scene.tscn -> levels/game_shell.tscn and every PascalCase scene to snake_case
(Player.tscn -> player.tscn, MainMenu.tscn -> main_menu.tscn, etc.) so the
case-insensitive web/macOS filesystems can't alias two files together.
Done as a scripted move: each file travels with its .uid; every quoted res:// path
across scenes, scripts, .tres, and project.godot's 9 autoloads is rewritten; the
.godot uid/class cache is rebuilt from scratch. Scenes still resolve by uid, so the
rewrite is belt-and-suspenders. Lint globs (run_tests.sh + both CI workflows) now
walk the new dirs; an orphan animation_tree.gd.uid and 7 pre-existing trailing-
whitespace lints (barrel/torch, never covered by the old root-only glob) are cleaned.
Full suite green on both sides. Asset consolidation (Assets/Animations/fonts ->
art/) is deferred — moving imported .glb/.png/.ttf is safer done in the editor.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017KoYBYQgRyY1zDHXMsXY3V
46 lines
1.4 KiB
GDScript
46 lines
1.4 KiB
GDScript
extends SceneTree
|
|
## Smoke test for the FX library: every registered effect instantiates and attaches without error,
|
|
## and an unknown name fails soft (returns null, no crash). Catches a broken effect .tscn before it
|
|
## ships. Run: godot --headless --script tests/fx_gallery_test.gd
|
|
|
|
var _pass := 0
|
|
var _fail := 0
|
|
|
|
|
|
func _init() -> void:
|
|
_run.call_deferred()
|
|
|
|
|
|
func _ok(cond: bool, msg: String) -> void:
|
|
if cond:
|
|
_pass += 1
|
|
print(" PASS: ", msg)
|
|
else:
|
|
_fail += 1
|
|
print(" FAIL: ", msg)
|
|
|
|
|
|
func _run() -> void:
|
|
var fx: Node = root.get_node("/root/Fx")
|
|
var host := Node3D.new()
|
|
root.add_child(host)
|
|
current_scene = host
|
|
|
|
for id: StringName in [&"blood_burst", &"slam_dust", &"spark", &"hit_flash"]:
|
|
var inst: Node = fx.call("spawn", id, Transform3D.IDENTITY, host)
|
|
_ok(inst != null and is_instance_valid(inst), "spawns %s" % id)
|
|
|
|
var missing: Node = fx.call("spawn", &"does_not_exist", Transform3D.IDENTITY, host)
|
|
_ok(missing == null, "unknown effect returns null instead of crashing")
|
|
|
|
# The preview gallery scene is wired (has its controller script + label).
|
|
var gallery: Node = load("res://systems/fx/effect_gallery.tscn").instantiate()
|
|
_ok(gallery.get_script() != null, "gallery scene keeps its controller script")
|
|
host.add_child(gallery)
|
|
await process_frame
|
|
_ok(gallery.get_node_or_null("UI/Label") != null, "gallery scene has its name label")
|
|
|
|
await process_frame
|
|
print("Results: %d passed, %d failed" % [_pass, _fail])
|
|
quit(1 if _fail > 0 else 0)
|