summaryrefslogtreecommitdiffstats
path: root/editor/editor_interface.cpp
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2023-06-07 13:44:37 +0200
committerPedro J. Estébanez <pedrojrulez@gmail.com>2023-06-13 11:05:57 +0200
commit96c469a1388a430456465b602ea49bf69ef782c3 (patch)
treeca9d2818e09aa465246dc4a99d737cb64b57216b /editor/editor_interface.cpp
parent828ec2c5d005b6499c7c4c88beaf81767d05614b (diff)
downloadredot-engine-96c469a1388a430456465b602ea49bf69ef782c3.tar.gz
Let editor workaround a case of inconsistency in compound scenes
Diffstat (limited to 'editor/editor_interface.cpp')
-rw-r--r--editor/editor_interface.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/editor_interface.cpp b/editor/editor_interface.cpp
index 50833c3a09..d9d9dc01c0 100644
--- a/editor/editor_interface.cpp
+++ b/editor/editor_interface.cpp
@@ -36,6 +36,7 @@
#include "editor/editor_resource_preview.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
+#include "editor/editor_undo_redo_manager.h"
#include "editor/filesystem_dock.h"
#include "editor/gui/editor_run_bar.h"
#include "editor/inspector_dock.h"
@@ -332,6 +333,10 @@ void EditorInterface::save_scene_as(const String &p_scene, bool p_with_preview)
EditorNode::get_singleton()->save_scene_to_path(p_scene, p_with_preview);
}
+void EditorInterface::mark_scene_as_unsaved() {
+ EditorUndoRedoManager::get_singleton()->set_history_as_unsaved(EditorNode::get_editor_data().get_current_edited_scene_history_id());
+}
+
// Scene playback.
void EditorInterface::play_main_scene() {
@@ -430,6 +435,8 @@ void EditorInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("save_scene"), &EditorInterface::save_scene);
ClassDB::bind_method(D_METHOD("save_scene_as", "path", "with_preview"), &EditorInterface::save_scene_as, DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("mark_scene_as_unsaved"), &EditorInterface::mark_scene_as_unsaved);
+
// Scene playback.
ClassDB::bind_method(D_METHOD("play_main_scene"), &EditorInterface::play_main_scene);