summaryrefslogtreecommitdiff
path: root/editor/scene_tree_dock.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-06 17:38:19 +0100
committerGitHub <noreply@github.com>2022-01-06 17:38:19 +0100
commit4ea309b405f09fb9c1425c688ea3eaeb24cce477 (patch)
tree4e54720aa1e0923a898a9b86d8562bad332835c6 /editor/scene_tree_dock.cpp
parent8d83da5bf9f29cef9aced1af612b9ae8121c0394 (diff)
parent941ea38b9a064d09a5bbe8247d31854d04fd43a5 (diff)
Merge pull request #56425 from V-Sekai/foreign_scene_child_node_fix
Diffstat (limited to 'editor/scene_tree_dock.cpp')
-rw-r--r--editor/scene_tree_dock.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 8d4e7b444b..2d21caeac0 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -942,6 +942,18 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
break;
}
+ if (tocopy->get_owner() != scene) {
+ accept->set_text(TTR("Can't save a branch which is a child of an already instantiated scene.\nTo save this branch into its own scene, open the original scene, right click on this branch, and select \"Save Branch as Scene\"."));
+ accept->popup_centered();
+ break;
+ }
+
+ if (scene->get_scene_inherited_state().is_valid() && scene->get_scene_inherited_state()->find_node_by_path(scene->get_path_to(tocopy)) >= 0) {
+ accept->set_text(TTR("Can't save a branch which is part of an inherited scene.\nTo save this branch into its own scene, open the original scene, right click on this branch, and select \"Save Branch as Scene\"."));
+ accept->popup_centered();
+ break;
+ }
+
new_scene_from_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE);
List<String> extensions;