@@ -1998,7 +1998,7 @@ void EditorNode::_save_scene_silently() {
19981998 // when Save on Focus Loss kicks in.
19991999 Node *scene = editor_data.get_edited_scene_root ();
20002000 if (scene && !scene->get_scene_file_path ().is_empty () && DirAccess::exists (scene->get_scene_file_path ().get_base_dir ())) {
2001- _save_scene (scene->get_scene_file_path (), - 1 , false );
2001+ _save_scene (scene->get_scene_file_path ());
20022002 save_editor_layout_delayed ();
20032003 }
20042004}
@@ -2026,29 +2026,23 @@ static void _reset_animation_mixers(Node *p_node, List<Pair<AnimationMixer *, Re
20262026 }
20272027}
20282028
2029- void EditorNode::_save_scene (String p_file, int idx, bool show_progress ) {
2029+ void EditorNode::_save_scene (String p_file, int idx) {
20302030 ERR_FAIL_COND_MSG (!saving_scene.is_empty () && saving_scene == p_file, " Scene saved while already being saved!" );
20312031
20322032 Node *scene = editor_data.get_edited_scene_root (idx);
20332033
2034- if (show_progress) {
2035- save_scene_progress = memnew (EditorProgress (" save" , TTR (" Saving Scene" ), 3 ));
2036- save_scene_progress->step (TTR (" Analyzing" ), 0 );
2037- }
2034+ save_scene_progress = memnew (EditorProgress (" save" , TTR (" Saving Scene" ), 3 ));
2035+ save_scene_progress->step (TTR (" Analyzing" ), 0 );
20382036
20392037 if (!scene) {
20402038 show_accept (TTR (" This operation can't be done without a tree root." ), TTR (" OK" ));
2041- if (show_progress) {
2042- _close_save_scene_progress ();
2043- }
2039+ _close_save_scene_progress ();
20442040 return ;
20452041 }
20462042
20472043 if (!scene->get_scene_file_path ().is_empty () && _validate_scene_recursive (scene->get_scene_file_path (), scene)) {
20482044 show_accept (TTR (" This scene can't be saved because there is a cyclic instance inclusion.\n Please resolve it and then attempt to save again." ), TTR (" OK" ));
2049- if (show_progress) {
2050- _close_save_scene_progress ();
2051- }
2045+ _close_save_scene_progress ();
20522046 return ;
20532047 }
20542048
@@ -2060,9 +2054,7 @@ void EditorNode::_save_scene(String p_file, int idx, bool show_progress) {
20602054 _reset_animation_mixers (scene, &anim_backups);
20612055 _save_editor_states (p_file, idx);
20622056
2063- if (show_progress) {
2064- save_scene_progress->step (TTR (" Packing Scene" ), 1 );
2065- }
2057+ save_scene_progress->step (TTR (" Packing Scene" ), 1 );
20662058
20672059 Ref<PackedScene> sdata;
20682060
@@ -2084,15 +2076,11 @@ void EditorNode::_save_scene(String p_file, int idx, bool show_progress) {
20842076
20852077 if (err != OK) {
20862078 show_accept (TTR (" Couldn't save scene. Likely dependencies (instances or inheritance) couldn't be satisfied." ), TTR (" OK" ));
2087- if (show_progress) {
2088- _close_save_scene_progress ();
2089- }
2079+ _close_save_scene_progress ();
20902080 return ;
20912081 }
20922082
2093- if (show_progress) {
2094- save_scene_progress->step (TTR (" Saving scene" ), 2 );
2095- }
2083+ save_scene_progress->step (TTR (" Saving scene" ), 2 );
20962084
20972085 int flg = 0 ;
20982086 if (EDITOR_GET (" filesystem/on_save/compress_binary_resources" )) {
@@ -2106,9 +2094,7 @@ void EditorNode::_save_scene(String p_file, int idx, bool show_progress) {
21062094 emit_signal (SNAME (" scene_saved" ), p_file);
21072095 editor_data.notify_scene_saved (p_file);
21082096
2109- if (show_progress) {
2110- save_scene_progress->step (TTR (" Saving external resources" ), 3 );
2111- }
2097+ save_scene_progress->step (TTR (" Saving external resources" ), 3 );
21122098
21132099 _save_external_resources ();
21142100 saving_scene = p_file; // Some editors may save scenes of built-in resources as external data, so avoid saving this scene again.
@@ -2134,9 +2120,7 @@ void EditorNode::_save_scene(String p_file, int idx, bool show_progress) {
21342120
21352121 scene->propagate_notification (NOTIFICATION_EDITOR_POST_SAVE);
21362122 _update_unsaved_cache ();
2137- if (show_progress) {
2138- _close_save_scene_progress ();
2139- }
2123+ _close_save_scene_progress ();
21402124}
21412125
21422126void EditorNode::save_all_scenes () {
@@ -2176,7 +2160,7 @@ void EditorNode::try_autosave() {
21762160 Node *scene = editor_data.get_edited_scene_root ();
21772161
21782162 if (scene && !scene->get_scene_file_path ().is_empty ()) { // Only autosave if there is a scene and if it has a path.
2179- _save_scene (scene->get_scene_file_path (), - 1 , false );
2163+ _save_scene (scene->get_scene_file_path ());
21802164 }
21812165 }
21822166 _menu_option (SCENE_SAVE_ALL_SCENES);
0 commit comments