diff options
| author | Poommetee Ketson | 2017-06-30 00:37:54 +0700 |
|---|---|---|
| committer | Poommetee Ketson | 2017-06-30 00:55:29 +0700 |
| commit | a7ff7af8aef822b3159241c2723c9018052da522 (patch) | |
| tree | c9a03ca0c1bb1c50ef4b29f26f32ec16b12794ef /editor/editor_node.cpp | |
| parent | 198bd9db02950d261c83b0c383fe737df3c5f152 (diff) | |
| download | godot-a7ff7af8aef822b3159241c2723c9018052da522.tar.gz godot-a7ff7af8aef822b3159241c2723c9018052da522.tar.zst godot-a7ff7af8aef822b3159241c2723c9018052da522.zip | |
EditorNode: mark opened deleted scenes as unsaved
Diffstat (limited to 'editor/editor_node.cpp')
| -rw-r--r-- | editor/editor_node.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 3d119354e..5a5fd73ba 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(); |
