From 93b0ce64cfb760b0adf42657298da2629b78f608 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 17 Feb 2024 13:15:07 +0100 Subject: [PATCH] Added execution order test --- client/{ => test}/benchmark/Benchmark.gd | 0 client/{ => test}/benchmark/Benchmark.tscn | 2 +- client/test/order/TestOrder.gd | 44 ++++++++++++++++++++++ client/test/order/TestOrder.tscn | 9 +++++ 4 files changed, 54 insertions(+), 1 deletion(-) rename client/{ => test}/benchmark/Benchmark.gd (100%) rename client/{ => test}/benchmark/Benchmark.tscn (72%) create mode 100644 client/test/order/TestOrder.gd create mode 100644 client/test/order/TestOrder.tscn diff --git a/client/benchmark/Benchmark.gd b/client/test/benchmark/Benchmark.gd similarity index 100% rename from client/benchmark/Benchmark.gd rename to client/test/benchmark/Benchmark.gd diff --git a/client/benchmark/Benchmark.tscn b/client/test/benchmark/Benchmark.tscn similarity index 72% rename from client/benchmark/Benchmark.tscn rename to client/test/benchmark/Benchmark.tscn index cb831c8..4e5e5c6 100644 --- a/client/benchmark/Benchmark.tscn +++ b/client/test/benchmark/Benchmark.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://bk5p5w2gxxuq5"] -[ext_resource type="Script" path="res://benchmark/Benchmark.gd" id="1_363x2"] +[ext_resource type="Script" path="res://test/benchmark/Benchmark.gd" id="1_363x2"] [node name="Benchmark" type="Node"] diff --git a/client/test/order/TestOrder.gd b/client/test/order/TestOrder.gd new file mode 100644 index 0000000..cd24387 --- /dev/null +++ b/client/test/order/TestOrder.gd @@ -0,0 +1,44 @@ +extends Node + +func _init(): + callback("_init") + +func _enter_tree(): + callback("_enter_tree") + +func _exit_tree(): + callback("_exit_tree") + +func _ready(): + callback("_ready") + get_tree().process_frame.connect(callback.bind("process_frame")) + get_tree().physics_frame.connect(callback.bind("physics_frame")) + +func _process(_delta): + callback("_process") + queue_free() + +func _physics_process(_delta): + callback("_physics_process") + +func _notification(what): + match what: + NOTIFICATION_PROCESS: + callback("NOTIFICATION_PROCESS") + NOTIFICATION_PHYSICS_PROCESS: + callback("NOTIFICATION_PHYSICS_PROCESS") + NOTIFICATION_PARENTED: + callback("NOTIFICATION_PARENTED") + NOTIFICATION_UNPARENTED: + callback("NOTIFICATION_UNPARENTED") + NOTIFICATION_PREDELETE: + callback("NOTIFICATION_PREDELETE") + +func _input(_event): + callback("_input") + +func _unhandled_input(_event): + callback("_unhandled_input") + +func callback(s): + print("[%d] [%s]: %s" % [Engine.get_frames_drawn(), name, s]) \ No newline at end of file diff --git a/client/test/order/TestOrder.tscn b/client/test/order/TestOrder.tscn new file mode 100644 index 0000000..022a265 --- /dev/null +++ b/client/test/order/TestOrder.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=3 uid="uid://4cjm7vlsa7a1"] + +[ext_resource type="Script" path="res://test/order/TestOrder.gd" id="1_d3f6g"] + +[node name="Parent" type="Node"] +script = ExtResource("1_d3f6g") + +[node name="Child" type="Node" parent="."] +script = ExtResource("1_d3f6g")