From c4563afa7e8a27fd95290156a6dfdf21b779422c Mon Sep 17 00:00:00 2001 From: Robert Yevdokimov <105675984+ryevdokimov@users.noreply.github.com> Date: Sat, 12 Oct 2024 19:10:59 -0400 Subject: [PATCH] Add mark_scene_as_saved method --- editor/editor_interface.cpp | 6 ++++++ editor/editor_interface.h | 1 + 2 files changed, 7 insertions(+) diff --git a/editor/editor_interface.cpp b/editor/editor_interface.cpp index 2c586041821e..211415d76998 100644 --- a/editor/editor_interface.cpp +++ b/editor/editor_interface.cpp @@ -491,6 +491,11 @@ void EditorInterface::mark_scene_as_unsaved() { EditorSceneTabs::get_singleton()->update_scene_tabs(); } +void EditorInterface::mark_scene_as_saved() { + EditorUndoRedoManager::get_singleton()->set_history_as_saved(EditorNode::get_editor_data().get_current_edited_scene_history_id()); + EditorSceneTabs::get_singleton()->update_scene_tabs(); +} + void EditorInterface::save_all_scenes() { EditorNode::get_singleton()->save_all_scenes(); } @@ -628,6 +633,7 @@ void EditorInterface::_bind_methods() { ClassDB::bind_method(D_METHOD("save_all_scenes"), &EditorInterface::save_all_scenes); ClassDB::bind_method(D_METHOD("mark_scene_as_unsaved"), &EditorInterface::mark_scene_as_unsaved); + ClassDB::bind_method(D_METHOD("mark_scene_as_saved"), &EditorInterface::mark_scene_as_saved); // Scene playback. diff --git a/editor/editor_interface.h b/editor/editor_interface.h index 556509fb5831..8f1464152390 100644 --- a/editor/editor_interface.h +++ b/editor/editor_interface.h @@ -169,6 +169,7 @@ class EditorInterface : public Object { Error save_scene(); void save_scene_as(const String &p_scene, bool p_with_preview = true); void mark_scene_as_unsaved(); + void mark_scene_as_saved(); void save_all_scenes(); // Scene playback.