Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose save_all_scenes method to EditorInterface #77537

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions doc/classes/EditorInterface.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,24 @@
Restarts the editor. This closes the editor and then opens the same project. If [param save] is [code]true[/code], the project will be saved before restarting.
</description>
</method>
<method name="save_all_scenes">
<return type="void" />
<description>
Saves all opened scenes in the editor.
</description>
</method>
<method name="save_scene">
<return type="int" enum="Error" />
<description>
Saves the scene. Returns either [constant OK] or [constant ERR_CANT_CREATE].
Saves the currently active scene. Returns either [constant OK] or [constant ERR_CANT_CREATE].
</description>
</method>
<method name="save_scene_as">
<return type="void" />
<param index="0" name="path" type="String" />
<param index="1" name="with_preview" type="bool" default="true" />
<description>
Saves the scene as a file at [param path].
Saves the currently active scene as a file at [param path].
</description>
</method>
<method name="select_file">
Expand Down
5 changes: 5 additions & 0 deletions editor/editor_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ void EditorInterface::mark_scene_as_unsaved() {
EditorUndoRedoManager::get_singleton()->set_history_as_unsaved(EditorNode::get_editor_data().get_current_edited_scene_history_id());
}

void EditorInterface::save_all_scenes() {
EditorNode::get_singleton()->save_all_scenes();
}

// Scene playback.

void EditorInterface::play_main_scene() {
Expand Down Expand Up @@ -434,6 +438,7 @@ 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("save_all_scenes"), &EditorInterface::save_all_scenes);

ClassDB::bind_method(D_METHOD("mark_scene_as_unsaved"), &EditorInterface::mark_scene_as_unsaved);

Expand Down
1 change: 1 addition & 0 deletions editor/editor_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,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 save_all_scenes();

// Scene playback.

Expand Down
Loading