From 8535a0f6c25f548d27591881e390c7ba12bfa237 Mon Sep 17 00:00:00 2001 From: Robert Yevdokimov Date: Sat, 30 Mar 2024 18:42:01 -0400 Subject: [PATCH] Add inherit parameter to `open_scene_from_path` --- doc/classes/EditorInterface.xml | 3 ++- editor/editor_interface.compat.inc | 5 +++++ editor/editor_interface.cpp | 6 +++--- editor/editor_interface.h | 4 ++-- editor/editor_node.cpp | 4 ++-- editor/editor_node.h | 2 +- misc/extension_api_validation/4.3-stable.expected | 8 ++++++++ 7 files changed, 23 insertions(+), 9 deletions(-) diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml index 795c5c1c2f0b..6098405db1ce 100644 --- a/doc/classes/EditorInterface.xml +++ b/doc/classes/EditorInterface.xml @@ -241,8 +241,9 @@ + - Opens the scene at the given path. + Opens the scene at the given path. If [param set_inherited] is [code]true[/code], a new inherited scene will be created. diff --git a/editor/editor_interface.compat.inc b/editor/editor_interface.compat.inc index f5b35931fe76..262238635052 100644 --- a/editor/editor_interface.compat.inc +++ b/editor/editor_interface.compat.inc @@ -40,9 +40,14 @@ void EditorInterface::_popup_property_selector_bind_compat_94323(Object *p_objec popup_property_selector(p_object, p_callback, p_type_filter, String()); } +void EditorInterface::_open_scene_from_path_bind_compat_90057(const String &scene_path) { + return open_scene_from_path(scene_path, false); +} + void EditorInterface::_bind_compatibility_methods() { ClassDB::bind_compatibility_method(D_METHOD("popup_node_selector", "callback", "valid_types"), &EditorInterface::_popup_node_selector_bind_compat_94323, DEFVAL(TypedArray())); ClassDB::bind_compatibility_method(D_METHOD("popup_property_selector", "object", "callback", "type_filter"), &EditorInterface::_popup_property_selector_bind_compat_94323, DEFVAL(PackedInt32Array())); + ClassDB::bind_compatibility_method(D_METHOD("open_scene_from_path", "scene_path"), &EditorInterface::_open_scene_from_path_bind_compat_90057); } #endif diff --git a/editor/editor_interface.cpp b/editor/editor_interface.cpp index fa6198f6950d..99015cb2509e 100644 --- a/editor/editor_interface.cpp +++ b/editor/editor_interface.cpp @@ -407,12 +407,12 @@ void EditorInterface::edit_script(const Ref