Merge pull request #77537 from henriquelalves/feature/ei_save_all_scenes
Expose `save_all_scenes` method to EditorInterface
This commit is contained in:
commit
41a7f6b380
@ -270,10 +270,16 @@
|
|||||||
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.
|
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>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="save_all_scenes">
|
||||||
|
<return type="void" />
|
||||||
|
<description>
|
||||||
|
Saves all opened scenes in the editor.
|
||||||
|
</description>
|
||||||
|
</method>
|
||||||
<method name="save_scene">
|
<method name="save_scene">
|
||||||
<return type="int" enum="Error" />
|
<return type="int" enum="Error" />
|
||||||
<description>
|
<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>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="save_scene_as">
|
<method name="save_scene_as">
|
||||||
@ -281,7 +287,7 @@
|
|||||||
<param index="0" name="path" type="String" />
|
<param index="0" name="path" type="String" />
|
||||||
<param index="1" name="with_preview" type="bool" default="true" />
|
<param index="1" name="with_preview" type="bool" default="true" />
|
||||||
<description>
|
<description>
|
||||||
Saves the scene as a file at [param path].
|
Saves the currently active scene as a file at [param path].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="select_file">
|
<method name="select_file">
|
||||||
|
@ -346,6 +346,10 @@ void EditorInterface::mark_scene_as_unsaved() {
|
|||||||
EditorUndoRedoManager::get_singleton()->set_history_as_unsaved(EditorNode::get_editor_data().get_current_edited_scene_history_id());
|
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.
|
// Scene playback.
|
||||||
|
|
||||||
void EditorInterface::play_main_scene() {
|
void EditorInterface::play_main_scene() {
|
||||||
@ -446,6 +450,7 @@ void EditorInterface::_bind_methods() {
|
|||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("save_scene"), &EditorInterface::save_scene);
|
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_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);
|
ClassDB::bind_method(D_METHOD("mark_scene_as_unsaved"), &EditorInterface::mark_scene_as_unsaved);
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ public:
|
|||||||
Error save_scene();
|
Error save_scene();
|
||||||
void save_scene_as(const String &p_scene, bool p_with_preview = true);
|
void save_scene_as(const String &p_scene, bool p_with_preview = true);
|
||||||
void mark_scene_as_unsaved();
|
void mark_scene_as_unsaved();
|
||||||
|
void save_all_scenes();
|
||||||
|
|
||||||
// Scene playback.
|
// Scene playback.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user