forked from wxm/Fighting_Rthythm_game
42 lines
1.1 KiB
GDScript
42 lines
1.1 KiB
GDScript
extends SceneTree
|
|
|
|
var failures: Array[String] = []
|
|
|
|
|
|
func _init() -> void:
|
|
var scene: PackedScene = load("res://scenes/main/main.tscn")
|
|
if scene == null:
|
|
push_error("Could not load main.tscn")
|
|
quit(1)
|
|
return
|
|
|
|
var main: Node = scene.instantiate()
|
|
var required_nodes := [
|
|
"RhythmFeedback/RhythmTrack",
|
|
"RhythmFeedback/RhythmTrack/LeftRod",
|
|
"RhythmFeedback/RhythmTrack/RightRod",
|
|
"RhythmFeedback/RhythmTrack/CenterBase",
|
|
"RhythmFeedback/RhythmTrack/CenterFlash",
|
|
"RhythmFeedback/RhythmTrack/LeftMover",
|
|
"RhythmFeedback/RhythmTrack/RightMover",
|
|
"RhythmFeedback/RhythmTrack/BlueBallLeft1",
|
|
"RhythmFeedback/RhythmTrack/BlueBallRight1",
|
|
"RhythmFeedback/JudgementLabel",
|
|
]
|
|
for node_path: String in required_nodes:
|
|
if not main.has_node(node_path):
|
|
failures.append("Missing rhythm UI node: %s" % node_path)
|
|
|
|
if main.has_method("_update_rhythm_track") == false:
|
|
failures.append("Main script missing _update_rhythm_track")
|
|
|
|
main.free()
|
|
|
|
if failures.is_empty():
|
|
print("PASS rhythm ui")
|
|
quit(0)
|
|
else:
|
|
for failure: String in failures:
|
|
push_error(failure)
|
|
quit(1)
|