summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2016-05-02 13:40:44 +0200
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2016-05-02 14:46:49 +0200
commit107e62be7045ae69415f8069a6f49ec912ec3799 (patch)
tree333055b4a8b2b79dfc9c9568f9e7e3f68ef5b1da /tools/editor
parent479cfb1d361bcf1863d69a464ed404efa7fe3b40 (diff)
Fix checking unsaved changes only in current scene
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/editor_node.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 09f85b99f6..f7608a6b9d 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -4668,7 +4668,11 @@ void EditorNode::_scene_tab_script_edited(int p_tab) {
void EditorNode::_scene_tab_closed(int p_tab) {
current_option = SCENE_TAB_CLOSE;
tab_closing = p_tab;
- if (unsaved_cache) {
+
+ bool unsaved = (p_tab==editor_data.get_edited_scene()) ?
+ saved_version!=editor_data.get_undo_redo().get_version() :
+ editor_data.get_scene_version(p_tab)!=0;
+ if (unsaved) {
confirmation->get_ok()->set_text("Yes");
//confirmation->get_cancel()->show();
confirmation->set_text("Close scene? (Unsaved changes will be lost)");