@@ -864,19 +864,23 @@ String EditorExportPlatform::_get_script_encryption_key(const Ref<EditorExportPr
864864 return p_preset->get_script_encryption_key ().to_lower ();
865865}
866866
867- Vector<String> EditorExportPlatform::get_main_pack_forced_export_files () {
868- // First, get files required by any PCK.
869- Vector<String> files = get_forced_export_files ();
867+ Vector<String> EditorExportPlatform::get_forced_export_files () {
868+ Vector<String> files;
869+
870+ files.push_back (ProjectSettings::get_singleton ()->get_global_class_list_path ());
870871
871872 String icon = GLOBAL_GET (" application/config/icon" );
873+ String splash = GLOBAL_GET (" application/boot_splash/image" );
872874 if (!icon.is_empty () && FileAccess::exists (icon)) {
873875 files.push_back (icon);
874876 }
875-
876- String splash = GLOBAL_GET (" application/boot_splash/image" );
877- if (!splash.is_empty () && icon != splash && FileAccess::exists (splash)) {
877+ if (!splash.is_empty () && FileAccess::exists (splash) && icon != splash) {
878878 files.push_back (splash);
879879 }
880+ String resource_cache_file = ResourceUID::get_cache_file ();
881+ if (FileAccess::exists (resource_cache_file)) {
882+ files.push_back (resource_cache_file);
883+ }
880884
881885 String extension_list_config_file = GDExtension::get_extension_list_config_file ();
882886 if (FileAccess::exists (extension_list_config_file)) {
@@ -909,19 +913,7 @@ Vector<String> EditorExportPlatform::get_main_pack_forced_export_files() {
909913 return files;
910914}
911915
912- Vector<String> EditorExportPlatform::get_forced_export_files () {
913- Vector<String> files;
914- files.push_back (ProjectSettings::get_singleton ()->get_global_class_list_path ());
915-
916- String resource_cache_file = ResourceUID::get_cache_file ();
917- if (FileAccess::exists (resource_cache_file)) {
918- files.push_back (resource_cache_file);
919- }
920-
921- return files;
922- }
923-
924- Error EditorExportPlatform::export_project_files (bool p_main_pack, const Ref<EditorExportPreset> &p_preset, bool p_debug, EditorExportSaveFunction p_func, void *p_udata, EditorExportSaveSharedObject p_so_func) {
916+ Error EditorExportPlatform::export_project_files (const Ref<EditorExportPreset> &p_preset, bool p_debug, EditorExportSaveFunction p_func, void *p_udata, EditorExportSaveSharedObject p_so_func) {
925917 // figure out paths of files that will be exported
926918 HashSet<String> paths;
927919 Vector<String> path_remaps;
@@ -968,11 +960,9 @@ Error EditorExportPlatform::export_project_files(bool p_main_pack, const Ref<Edi
968960 }
969961 }
970962
971- if (p_main_pack) {
972- // Add native icons to non-resource include list.
973- _edit_filter_list (paths, String (" *.icns" ), false );
974- _edit_filter_list (paths, String (" *.ico" ), false );
975- }
963+ // add native icons to non-resource include list
964+ _edit_filter_list (paths, String (" *.icns" ), false );
965+ _edit_filter_list (paths, String (" *.ico" ), false );
976966
977967 _edit_filter_list (paths, p_preset->get_include_filter (), false );
978968 _edit_filter_list (paths, p_preset->get_exclude_filter (), true );
@@ -1404,12 +1394,7 @@ Error EditorExportPlatform::export_project_files(bool p_main_pack, const Ref<Edi
14041394 }
14051395 }
14061396
1407- Vector<String> forced_export;
1408- if (p_main_pack) {
1409- forced_export = get_main_pack_forced_export_files ();
1410- } else {
1411- forced_export = get_forced_export_files ();
1412- }
1397+ Vector<String> forced_export = get_forced_export_files ();
14131398 for (int i = 0 ; i < forced_export.size (); i++) {
14141399 Vector<uint8_t > array = FileAccess::get_file_as_bytes (forced_export[i]);
14151400 err = p_func (p_udata, forced_export[i], array, idx, total, enc_in_filters, enc_ex_filters, key);
@@ -1418,19 +1403,13 @@ Error EditorExportPlatform::export_project_files(bool p_main_pack, const Ref<Edi
14181403 }
14191404 }
14201405
1421- if (p_main_pack) {
1422- String config_file = " project.binary" ;
1423- String engine_cfb = EditorPaths::get_singleton ()->get_cache_dir ().path_join (" tmp" + config_file);
1424- ProjectSettings::get_singleton ()->save_custom (engine_cfb, custom_map, custom_list);
1425- Vector<uint8_t > data = FileAccess::get_file_as_bytes (engine_cfb);
1426- DirAccess::remove_file_or_error (engine_cfb);
1427- err = p_func (p_udata, " res://" + config_file, data, idx, total, enc_in_filters, enc_ex_filters, key);
1428- if (err != OK) {
1429- return err;
1430- }
1431- }
1406+ String config_file = " project.binary" ;
1407+ String engine_cfb = EditorPaths::get_singleton ()->get_cache_dir ().path_join (" tmp" + config_file);
1408+ ProjectSettings::get_singleton ()->save_custom (engine_cfb, custom_map, custom_list);
1409+ Vector<uint8_t > data = FileAccess::get_file_as_bytes (engine_cfb);
1410+ DirAccess::remove_file_or_error (engine_cfb);
14321411
1433- return OK ;
1412+ return p_func (p_udata, " res:// " + config_file, data, idx, total, enc_in_filters, enc_ex_filters, key) ;
14341413}
14351414
14361415Error EditorExportPlatform::_add_shared_object (void *p_userdata, const SharedObject &p_so) {
@@ -1559,7 +1538,7 @@ void EditorExportPlatform::zip_folder_recursive(zipFile &p_zip, const String &p_
15591538 da->list_dir_end ();
15601539}
15611540
1562- Error EditorExportPlatform::save_pack (bool p_main_pack, const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, Vector<SharedObject> *p_so_files, bool p_embed, int64_t *r_embedded_start, int64_t *r_embedded_size) {
1541+ Error EditorExportPlatform::save_pack (const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, Vector<SharedObject> *p_so_files, bool p_embed, int64_t *r_embedded_start, int64_t *r_embedded_size) {
15631542 EditorProgress ep (" savepack" , TTR (" Packing" ), 102 , true );
15641543
15651544 // Create the temporary export directory if it doesn't exist.
@@ -1578,7 +1557,7 @@ Error EditorExportPlatform::save_pack(bool p_main_pack, const Ref<EditorExportPr
15781557 pd.f = ftmp;
15791558 pd.so_files = p_so_files;
15801559
1581- Error err = export_project_files (p_main_pack, p_preset, p_debug, _save_pack_file, &pd, _add_shared_object);
1560+ Error err = export_project_files (p_preset, p_debug, _save_pack_file, &pd, _add_shared_object);
15821561
15831562 // Close temp file.
15841563 pd.f .unref ();
@@ -1796,7 +1775,7 @@ Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset> &p_preset, bo
17961775 zd.ep = &ep;
17971776 zd.zip = zip;
17981777
1799- Error err = export_project_files (false , p_preset, p_debug, _save_zip_file, &zd);
1778+ Error err = export_project_files (p_preset, p_debug, _save_zip_file, &zd);
18001779 if (err != OK && err != ERR_SKIP) {
18011780 add_message (EXPORT_MESSAGE_ERROR, TTR (" Save ZIP" ), TTR (" Failed to export project files." ));
18021781 }
@@ -1808,7 +1787,7 @@ Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset> &p_preset, bo
18081787
18091788Error EditorExportPlatform::export_pack (const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
18101789 ExportNotifier notifier (*this , p_preset, p_debug, p_path, p_flags);
1811- return save_pack (false , p_preset, p_debug, p_path);
1790+ return save_pack (p_preset, p_debug, p_path);
18121791}
18131792
18141793Error EditorExportPlatform::export_zip (const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
0 commit comments