Prevent overwriting open scenes when saving

Prevent overwriting open scenes when saving, this fixes #17628
This commit is contained in:
DualMatrix
2018-09-07 15:54:26 +02:00
parent f1e5b7cf42
commit c43ffc8917
2 changed files with 17 additions and 0 deletions

View File

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