summaryrefslogtreecommitdiff
path: root/editor/scene_tree_dock.cpp
diff options
context:
space:
mode:
authorDualMatrix <piet.goris@gmail.com>2018-09-07 15:54:26 +0200
committerDualMatrix <piet.goris@gmail.com>2018-09-07 15:54:26 +0200
commitc43ffc8917581fda7577058329a30fcd504d592f (patch)
tree1ead6356ffa9730ce53963d8a07fb857f95b9880 /editor/scene_tree_dock.cpp
parentf1e5b7cf42010db1251ecef34695367c125f02e1 (diff)
Prevent overwriting open scenes when saving
Prevent overwriting open scenes when saving, this fixes #17628
Diffstat (limited to 'editor/scene_tree_dock.cpp')
-rw-r--r--editor/scene_tree_dock.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 18de2a6221..5f2841d2c0 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -1816,6 +1816,13 @@ void SceneTreeDock::_new_scene_from(String p_file) {
return;
}
+ if (EditorNode::get_singleton()->is_scene_open(p_file)) {
+ accept->get_ok()->set_text(TTR("OK"));
+ accept->set_text(TTR("Can't overwrite scene that is still open!"));
+ accept->popup_centered_minsize();
+ return;
+ }
+
Node *base = selection.front()->get();
Map<Node *, Node *> reown;