Merge pull request #56425 from V-Sekai/foreign_scene_child_node_fix

This commit is contained in:
Rémi Verschelde 2022-01-06 17:38:19 +01:00 committed by GitHub
commit 4ea309b405
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;