|
30 | 30 |
|
31 | 31 | #include "editor_export_platform.h" |
32 | 32 |
|
| 33 | +#include "editor_export_platform.compat.inc" |
| 34 | + |
33 | 35 | #include "core/config/project_settings.h" |
34 | 36 | #include "core/crypto/crypto_core.h" |
35 | 37 | #include "core/extension/gdextension.h" |
@@ -946,7 +948,7 @@ Dictionary EditorExportPlatform::get_internal_export_files(const Ref<EditorExpor |
946 | 948 | Dictionary files; |
947 | 949 |
|
948 | 950 | // Text server support data. |
949 | | - if (TS->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA) && (bool)GLOBAL_GET("internationalization/locale/include_text_server_data")) { |
| 951 | + if (TS->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA) && (bool)get_project_setting(p_preset, "internationalization/locale/include_text_server_data")) { |
950 | 952 | String ts_name = TS->get_support_data_filename(); |
951 | 953 | String ts_target = "res://" + ts_name; |
952 | 954 | if (!ts_name.is_empty()) { |
@@ -992,13 +994,13 @@ Dictionary EditorExportPlatform::get_internal_export_files(const Ref<EditorExpor |
992 | 994 | return files; |
993 | 995 | } |
994 | 996 |
|
995 | | -Vector<String> EditorExportPlatform::get_forced_export_files() { |
| 997 | +Vector<String> EditorExportPlatform::get_forced_export_files(const Ref<EditorExportPreset> &p_preset) { |
996 | 998 | Vector<String> files; |
997 | 999 |
|
998 | 1000 | files.push_back(ProjectSettings::get_singleton()->get_global_class_list_path()); |
999 | 1001 |
|
1000 | | - String icon = ResourceUID::ensure_path(GLOBAL_GET("application/config/icon")); |
1001 | | - String splash = ResourceUID::ensure_path(GLOBAL_GET("application/boot_splash/image")); |
| 1002 | + String icon = ResourceUID::ensure_path(get_project_setting(p_preset, "application/config/icon")); |
| 1003 | + String splash = ResourceUID::ensure_path(get_project_setting(p_preset, "application/boot_splash/image")); |
1002 | 1004 | if (!icon.is_empty() && FileAccess::exists(icon)) { |
1003 | 1005 | files.push_back(icon); |
1004 | 1006 | } |
@@ -1110,7 +1112,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & |
1110 | 1112 | continue; |
1111 | 1113 | } |
1112 | 1114 |
|
1113 | | - String autoload_path = GLOBAL_GET(pi.name); |
| 1115 | + String autoload_path = get_project_setting(p_preset, pi.name); |
1114 | 1116 |
|
1115 | 1117 | if (autoload_path.begins_with("*")) { |
1116 | 1118 | autoload_path = autoload_path.substr(1); |
@@ -1253,7 +1255,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & |
1253 | 1255 | HashMap<String, FileExportCache> export_cache; |
1254 | 1256 | String export_base_path = ProjectSettings::get_singleton()->get_project_data_path().path_join("exported/") + itos(custom_resources_hash); |
1255 | 1257 |
|
1256 | | - bool convert_text_to_binary = GLOBAL_GET("editor/export/convert_text_resources_to_binary"); |
| 1258 | + bool convert_text_to_binary = get_project_setting(p_preset, "editor/export/convert_text_resources_to_binary"); |
1257 | 1259 |
|
1258 | 1260 | if (convert_text_to_binary || !customize_resources_plugins.is_empty() || !customize_scenes_plugins.is_empty()) { |
1259 | 1261 | // See if we have something to open |
@@ -1565,7 +1567,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & |
1565 | 1567 | } |
1566 | 1568 | } |
1567 | 1569 |
|
1568 | | - Vector<String> forced_export = get_forced_export_files(); |
| 1570 | + Vector<String> forced_export = get_forced_export_files(p_preset); |
1569 | 1571 | for (int i = 0; i < forced_export.size(); i++) { |
1570 | 1572 | Vector<uint8_t> array; |
1571 | 1573 | if (GDExtension::get_extension_list_config_file() == forced_export[i]) { |
@@ -2464,6 +2466,14 @@ Array EditorExportPlatform::get_current_presets() const { |
2464 | 2466 | return ret; |
2465 | 2467 | } |
2466 | 2468 |
|
| 2469 | +Variant EditorExportPlatform::get_project_setting(const Ref<EditorExportPreset> &p_preset, const StringName &p_name) { |
| 2470 | + if (p_preset.is_valid()) { |
| 2471 | + return p_preset->get_project_setting(p_name); |
| 2472 | + } else { |
| 2473 | + return GLOBAL_GET(p_name); |
| 2474 | + } |
| 2475 | +} |
| 2476 | + |
2467 | 2477 | void EditorExportPlatform::_bind_methods() { |
2468 | 2478 | ClassDB::bind_method(D_METHOD("get_os_name"), &EditorExportPlatform::get_os_name); |
2469 | 2479 |
|
@@ -2502,7 +2512,7 @@ void EditorExportPlatform::_bind_methods() { |
2502 | 2512 |
|
2503 | 2513 | ClassDB::bind_method(D_METHOD("get_internal_export_files", "preset", "debug"), &EditorExportPlatform::get_internal_export_files); |
2504 | 2514 |
|
2505 | | - ClassDB::bind_static_method("EditorExportPlatform", D_METHOD("get_forced_export_files"), &EditorExportPlatform::get_forced_export_files); |
| 2515 | + ClassDB::bind_static_method("EditorExportPlatform", D_METHOD("get_forced_export_files", "preset"), &EditorExportPlatform::get_forced_export_files); |
2506 | 2516 |
|
2507 | 2517 | BIND_ENUM_CONSTANT(EXPORT_MESSAGE_NONE); |
2508 | 2518 | BIND_ENUM_CONSTANT(EXPORT_MESSAGE_INFO); |
|
0 commit comments