extends Node
## GATE: `hyper-tps --debug` shows the collision hull from the first frame.
##
## "$G" --path . --rendering-driver vulkan --resolution 960x540 res://scenes/test/gate_debug_collisions_arg.tscn -- --debug-collisions
##
## The launcher's --debug passes --debug-collisions, but the shipped engine is a
## template_release build and that ENGINE flag only exists under DEBUG_ENABLED
## (main.cpp) -- so it never did anything for a player. It arrives as a game
## (user) arg instead, and map_core turns on its own Ctrl+F7 collision overlay.
## Without the arg the overlay must stay off.
const MAP := "res://scenes/maps/map_test.tscn"
func _ready() -> void:
_run.call_deferred()
func _run() -> void:
var want := "--debug-collisions" in OS.get_cmdline_user_args()
var map := (load(MAP) as PackedScene).instantiate()
add_child(map)
for i in 30:
await get_tree().process_frame
var on := bool(map.get("_collision_overlay_on"))
var ok := on == want
print("[GATE-DEBUG-COLL] arg %s -> overlay %s (want %s)" % [want, on, want])
print("RESULT: %s" % ("PASS" if ok else "FAIL"))
get_tree().quit(0 if ok else 1)