summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/editor_node.cpp25
-rw-r--r--editor/editor_node.h1
2 files changed, 26 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 3d119354e1..5a5fd73ba1 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -416,6 +416,8 @@ void EditorNode::_fs_changed() {
}
}
}
+
+ _mark_unsaved_scenes();
}
void EditorNode::_sources_changed(bool p_exist) {
@@ -978,6 +980,29 @@ void EditorNode::_save_all_scenes() {
_save_default_environment();
}
+void EditorNode::_mark_unsaved_scenes() {
+
+ for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
+
+ Node *node = editor_data.get_edited_scene_root(i);
+ if (!node)
+ continue;
+
+ String path = node->get_filename();
+ if (!(path == String() || FileAccess::exists(path))) {
+
+ node->set_filename("");
+ if (i == editor_data.get_edited_scene())
+ set_current_version(-1);
+ else
+ editor_data.set_edited_scene_version(-1, i);
+ }
+ }
+
+ _update_title();
+ _update_scene_tabs();
+}
+
void EditorNode::_import_action(const String &p_action) {
#if 0
import_confirmation->hide();
diff --git a/editor/editor_node.h b/editor/editor_node.h
index 5e83cec4a3..24acedbf26 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -529,6 +529,7 @@ private:
bool _find_and_save_resource(RES p_res, Map<RES, bool> &processed, int32_t flags);
bool _find_and_save_edited_subresources(Object *obj, Map<RES, bool> &processed, int32_t flags);
void _save_edited_subresources(Node *scene, Map<RES, bool> &processed, int32_t flags);
+ void _mark_unsaved_scenes();
void _find_node_types(Node *p_node, int &count_2d, int &count_3d);
void _save_scene_with_preview(String p_file);