summaryrefslogtreecommitdiff
path: root/tools/editor/editor_node.cpp
diff options
context:
space:
mode:
authorJulian Murgia - StraToN <the.straton@gmail.com>2015-10-22 00:23:42 +0200
committerJulian Murgia - StraToN <the.straton@gmail.com>2015-10-22 00:23:42 +0200
commitd64c89d44721bf2b8e84ea1a6d3c7ae0085caf6b (patch)
tree995b279b874b207b76c707fcfe5ecf813a24ec74 /tools/editor/editor_node.cpp
parent35959f9c5a314effc9a442931baccec2408b8ece (diff)
Fix #2623
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r--tools/editor/editor_node.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 34e2510791..a3d7cbd7cf 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -2946,6 +2946,20 @@ void EditorNode::_remove_edited_scene() {
unsaved_cache=false;
}
}
+
+void EditorNode::_remove_scene(int index) {
+// printf("Attempting to remove scene %d (current is %d)\n", index, editor_data.get_edited_scene());
+ if (editor_data.get_edited_scene() == index) {
+ //Scene to remove is current scene
+ _remove_edited_scene();
+ }
+ else {
+ // Scene to remove is not active scene.");
+ editor_data.remove_scene(index);
+ editor_data.get_undo_redo().clear_history();
+ }
+}
+
void EditorNode::set_edited_scene(Node *p_scene) {
if (get_editor_data().get_edited_scene_root()) {
@@ -4390,12 +4404,7 @@ void EditorNode::_scene_tab_script_edited(int p_tab) {
}
void EditorNode::_scene_tab_closed(int p_tab) {
- set_current_scene(p_tab);
- bool p_confirmed = true;
- if (unsaved_cache)
- p_confirmed = false;
-
- _menu_option_confirm(FILE_CLOSE, p_confirmed);
+ _remove_scene(p_tab);
_update_scene_tabs();
}