Skip to content

Commit 2c062e9

Browse files
Add save_all_scenes method to Editor Interface
Update documentation (squash) fix docs (squash) Improve docs
1 parent c44e6ae commit 2c062e9

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

doc/classes/EditorInterface.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,18 +262,24 @@
262262
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.
263263
</description>
264264
</method>
265+
<method name="save_all_scenes">
266+
<return type="void" />
267+
<description>
268+
Saves all opened scenes in the editor.
269+
</description>
270+
</method>
265271
<method name="save_scene">
266272
<return type="int" enum="Error" />
267273
<description>
268-
Saves the scene. Returns either [constant OK] or [constant ERR_CANT_CREATE].
274+
Saves the currently active scene. Returns either [constant OK] or [constant ERR_CANT_CREATE].
269275
</description>
270276
</method>
271277
<method name="save_scene_as">
272278
<return type="void" />
273279
<param index="0" name="path" type="String" />
274280
<param index="1" name="with_preview" type="bool" default="true" />
275281
<description>
276-
Saves the scene as a file at [param path].
282+
Saves the currently active scene as a file at [param path].
277283
</description>
278284
</method>
279285
<method name="select_file">

editor/editor_interface.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ void EditorInterface::mark_scene_as_unsaved() {
337337
EditorUndoRedoManager::get_singleton()->set_history_as_unsaved(EditorNode::get_editor_data().get_current_edited_scene_history_id());
338338
}
339339

340+
void EditorInterface::save_all_scenes() {
341+
EditorNode::get_singleton()->save_all_scenes();
342+
}
343+
340344
// Scene playback.
341345

342346
void EditorInterface::play_main_scene() {
@@ -434,6 +438,7 @@ void EditorInterface::_bind_methods() {
434438

435439
ClassDB::bind_method(D_METHOD("save_scene"), &EditorInterface::save_scene);
436440
ClassDB::bind_method(D_METHOD("save_scene_as", "path", "with_preview"), &EditorInterface::save_scene_as, DEFVAL(true));
441+
ClassDB::bind_method(D_METHOD("save_all_scenes"), &EditorInterface::save_all_scenes);
437442

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

editor/editor_interface.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class EditorInterface : public Object {
130130
Error save_scene();
131131
void save_scene_as(const String &p_scene, bool p_with_preview = true);
132132
void mark_scene_as_unsaved();
133+
void save_all_scenes();
133134

134135
// Scene playback.
135136

0 commit comments

Comments
 (0)