mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-01 05:48:37 +03:00
Fix _notification with parent and child classes
This commit is contained in:
@@ -245,6 +245,14 @@ func _ready():
|
||||
assert_equal(example.test_virtual_implemented_in_script("Virtual", 939), "Implemented")
|
||||
assert_equal(custom_signal_emitted, ["Virtual", 939])
|
||||
|
||||
# Test that notifications happen on both parent and child classes.
|
||||
var example_child = $ExampleChild
|
||||
assert_equal(example_child.get_value1(), 11)
|
||||
assert_equal(example_child.get_value2(), 33)
|
||||
example_child.notification(NOTIFICATION_ENTER_TREE, true)
|
||||
assert_equal(example_child.get_value1(), 11)
|
||||
assert_equal(example_child.get_value2(), 22)
|
||||
|
||||
exit_with_status()
|
||||
|
||||
func _on_Example_custom_signal(signal_name, value):
|
||||
|
||||
@@ -24,4 +24,6 @@ offset_right = 79.0
|
||||
offset_bottom = 29.0
|
||||
text = "Click me!"
|
||||
|
||||
[node name="ExampleChild" type="ExampleChild" parent="."]
|
||||
|
||||
[connection signal="custom_signal" from="Example" to="." method="_on_Example_custom_signal"]
|
||||
|
||||
Reference in New Issue
Block a user