Skip to content

Commit

Permalink
Add mark_scene_as_saved method
Browse files Browse the repository at this point in the history
  • Loading branch information
ryevdokimov committed Oct 13, 2024
1 parent 6725f00 commit c4563af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions editor/editor_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions editor/editor_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c4563af

Please sign in to comment.