55 lines
1.6 KiB
GDScript
55 lines
1.6 KiB
GDScript
extends SceneTree
|
|
|
|
func _init():
|
|
# Try to load and instantiate the MainHUD scene
|
|
var scene = load("res://scenes/ui/MainHUD.tscn")
|
|
if scene:
|
|
print("SUCCESS: MainHUD.tscn loaded successfully")
|
|
var instance = scene.instantiate()
|
|
if instance:
|
|
print("SUCCESS: MainHUD.tscn instantiated successfully")
|
|
|
|
# Add to scene tree to trigger _ready() function
|
|
root.add_child(instance)
|
|
|
|
# Call _ready manually to ensure shader is applied
|
|
instance._ready()
|
|
|
|
# Check if key nodes exist
|
|
if instance.has_node("CRTFrame"):
|
|
print("SUCCESS: CRTFrame node found")
|
|
else:
|
|
print("ERROR: CRTFrame node not found")
|
|
|
|
if instance.has_node("ResourcePanel"):
|
|
print("SUCCESS: ResourcePanel node found")
|
|
else:
|
|
print("ERROR: ResourcePanel node not found")
|
|
|
|
if instance.has_node("CrewRosterPanel"):
|
|
print("SUCCESS: CrewRosterPanel node found")
|
|
else:
|
|
print("ERROR: CrewRosterPanel node not found")
|
|
|
|
# Check if shader is applied
|
|
if instance.has_node("CRTShader"):
|
|
var crt_shader = instance.get_node("CRTShader")
|
|
if crt_shader.material:
|
|
print("SUCCESS: CRT shader material applied")
|
|
print("Shader Type: ", crt_shader.material.get_class())
|
|
else:
|
|
print("WARNING: CRT shader material not applied")
|
|
else:
|
|
print("ERROR: CRTShader node not found")
|
|
|
|
# Clean up
|
|
instance.queue_free()
|
|
else:
|
|
print("ERROR: Failed to instantiate MainHUD.tscn")
|
|
else:
|
|
print("ERROR: Failed to load MainHUD.tscn")
|
|
|
|
# Note: This test script is more comprehensive than verify_main_hud.gd as it triggers the _ready() function.
|
|
# Consider using this approach for more robust testing in the future.
|
|
|
|
quit() |