Add scene_changed signal to SceneTree

This commit is contained in:
kobewi
2025-02-18 10:46:54 +01:00
parent 49cc57a75d
commit 323b47facf
2 changed files with 15 additions and 0 deletions

View File

@@ -1517,6 +1517,8 @@ void SceneTree::_flush_scene_change() {
pending_new_scene = nullptr;
// Update display for cursor instantly.
root->update_mouse_cursor_state();
emit_signal(SNAME("scene_changed"));
}
Error SceneTree::change_scene_to_file(const String &p_path) {
@@ -1784,6 +1786,7 @@ void SceneTree::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "physics_interpolation"), "set_physics_interpolation_enabled", "is_physics_interpolation_enabled");
ADD_SIGNAL(MethodInfo("tree_changed"));
ADD_SIGNAL(MethodInfo("scene_changed"));
ADD_SIGNAL(MethodInfo("tree_process_mode_changed")); //editor only signal, but due to API hash it can't be removed in run-time
ADD_SIGNAL(MethodInfo("node_added", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
ADD_SIGNAL(MethodInfo("node_removed", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Node")));