浏览代码

Merge pull request #109815 from Muller-Castro/export-script-file

Fix `EditorExportPlugin::_export_file()` ignoring GDScripts
Thaddeus Crews 1 月之前
父节点
当前提交
490af72c99
共有 1 个文件被更改,包括 21 次插入15 次删除
  1. 21 15
      editor/export/editor_export_platform.cpp

+ 21 - 15
editor/export/editor_export_platform.cpp

@@ -1349,6 +1349,8 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
 		}
 		}
 
 
 		bool do_export = true;
 		bool do_export = true;
+		bool skip_all = false;
+		int skipped_i = export_plugins.size() - 1;
 		for (int i = 0; i < export_plugins.size(); i++) {
 		for (int i = 0; i < export_plugins.size(); i++) {
 			if (GDVIRTUAL_IS_OVERRIDDEN_PTR(export_plugins[i], _export_file)) {
 			if (GDVIRTUAL_IS_OVERRIDDEN_PTR(export_plugins[i], _export_file)) {
 				export_plugins.write[i]->_export_file_script(path, type, features_psa);
 				export_plugins.write[i]->_export_file_script(path, type, features_psa);
@@ -1364,26 +1366,30 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
 				}
 				}
 			}
 			}
 
 
-			for (int j = 0; j < export_plugins[i]->extra_files.size(); j++) {
-				err = save_proxy.save_file(p_udata, export_plugins[i]->extra_files[j].path, export_plugins[i]->extra_files[j].data, idx, total, enc_in_filters, enc_ex_filters, key, seed);
-				if (err != OK) {
-					return err;
-				}
-				if (export_plugins[i]->extra_files[j].remap) {
-					do_export = false; // If remap, do not.
-					path_remaps.push_back(path);
-					path_remaps.push_back(export_plugins[i]->extra_files[j].path);
-				}
-			}
-
 			if (export_plugins[i]->skipped) {
 			if (export_plugins[i]->skipped) {
 				do_export = false;
 				do_export = false;
+				skip_all = true;
+				skipped_i = i;
+				break;
 			}
 			}
-			export_plugins.write[i]->_clear();
+		}
 
 
-			if (!do_export) {
-				break;
+		for (int i = 0; i <= skipped_i; i++) {
+			if (!skip_all) {
+				for (const EditorExportPlugin::ExtraFile &extra_file : export_plugins[i]->extra_files) {
+					err = save_proxy.save_file(p_udata, extra_file.path, extra_file.data, idx, total, enc_in_filters, enc_ex_filters, key, seed);
+					if (err != OK) {
+						return err;
+					}
+					if (extra_file.remap) {
+						do_export = false; // If remap, do not.
+						path_remaps.push_back(path);
+						path_remaps.push_back(extra_file.path);
+					}
+				}
 			}
 			}
+
+			export_plugins.write[i]->_clear();
 		}
 		}
 		if (!do_export) {
 		if (!do_export) {
 			continue;
 			continue;