|
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" |
@@ -948,7 +950,7 @@ Dictionary EditorExportPlatform::get_internal_export_files(const Ref<EditorExpor |
948 | 950 | Dictionary files; |
949 | 951 |
|
950 | 952 | // Text server support data. |
951 | | - if (TS->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA) && (bool)GLOBAL_GET("internationalization/locale/include_text_server_data")) { |
| 953 | + if (TS->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA) && (bool)get_project_setting(p_preset, "internationalization/locale/include_text_server_data")) { |
952 | 954 | String ts_name = TS->get_support_data_filename(); |
953 | 955 | String ts_target = "res://" + ts_name; |
954 | 956 | if (!ts_name.is_empty()) { |
@@ -994,13 +996,13 @@ Dictionary EditorExportPlatform::get_internal_export_files(const Ref<EditorExpor |
994 | 996 | return files; |
995 | 997 | } |
996 | 998 |
|
997 | | -Vector<String> EditorExportPlatform::get_forced_export_files() { |
| 999 | +Vector<String> EditorExportPlatform::get_forced_export_files(const Ref<EditorExportPreset> &p_preset) { |
998 | 1000 | Vector<String> files; |
999 | 1001 |
|
1000 | 1002 | files.push_back(ProjectSettings::get_singleton()->get_global_class_list_path()); |
1001 | 1003 |
|
1002 | | - String icon = ResourceUID::ensure_path(GLOBAL_GET("application/config/icon")); |
1003 | | - String splash = ResourceUID::ensure_path(GLOBAL_GET("application/boot_splash/image")); |
| 1004 | + String icon = ResourceUID::ensure_path(get_project_setting(p_preset, "application/config/icon")); |
| 1005 | + String splash = ResourceUID::ensure_path(get_project_setting(p_preset, "application/boot_splash/image")); |
1004 | 1006 | if (!icon.is_empty() && FileAccess::exists(icon)) { |
1005 | 1007 | files.push_back(icon); |
1006 | 1008 | } |
@@ -1112,7 +1114,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & |
1112 | 1114 | continue; |
1113 | 1115 | } |
1114 | 1116 |
|
1115 | | - String autoload_path = GLOBAL_GET(pi.name); |
| 1117 | + String autoload_path = get_project_setting(p_preset, pi.name); |
1116 | 1118 |
|
1117 | 1119 | if (autoload_path.begins_with("*")) { |
1118 | 1120 | autoload_path = autoload_path.substr(1); |
@@ -1255,7 +1257,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & |
1255 | 1257 | HashMap<String, FileExportCache> export_cache; |
1256 | 1258 | String export_base_path = ProjectSettings::get_singleton()->get_project_data_path().path_join("exported/") + itos(custom_resources_hash); |
1257 | 1259 |
|
1258 | | - bool convert_text_to_binary = GLOBAL_GET("editor/export/convert_text_resources_to_binary"); |
| 1260 | + bool convert_text_to_binary = get_project_setting(p_preset, "editor/export/convert_text_resources_to_binary"); |
1259 | 1261 |
|
1260 | 1262 | if (convert_text_to_binary || !customize_resources_plugins.is_empty() || !customize_scenes_plugins.is_empty()) { |
1261 | 1263 | // See if we have something to open |
@@ -1567,7 +1569,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & |
1567 | 1569 | } |
1568 | 1570 | } |
1569 | 1571 |
|
1570 | | - Vector<String> forced_export = get_forced_export_files(); |
| 1572 | + Vector<String> forced_export = get_forced_export_files(p_preset); |
1571 | 1573 | for (int i = 0; i < forced_export.size(); i++) { |
1572 | 1574 | Vector<uint8_t> array; |
1573 | 1575 | if (GDExtension::get_extension_list_config_file() == forced_export[i]) { |
@@ -2466,6 +2468,14 @@ Array EditorExportPlatform::get_current_presets() const { |
2466 | 2468 | return ret; |
2467 | 2469 | } |
2468 | 2470 |
|
| 2471 | +Variant EditorExportPlatform::get_project_setting(const Ref<EditorExportPreset> &p_preset, const StringName &p_name) { |
| 2472 | + if (p_preset.is_valid()) { |
| 2473 | + return p_preset->get_project_setting(p_name); |
| 2474 | + } else { |
| 2475 | + return GLOBAL_GET(p_name); |
| 2476 | + } |
| 2477 | +} |
| 2478 | + |
2469 | 2479 | void EditorExportPlatform::_bind_methods() { |
2470 | 2480 | ClassDB::bind_method(D_METHOD("get_os_name"), &EditorExportPlatform::get_os_name); |
2471 | 2481 |
|
@@ -2504,7 +2514,7 @@ void EditorExportPlatform::_bind_methods() { |
2504 | 2514 |
|
2505 | 2515 | ClassDB::bind_method(D_METHOD("get_internal_export_files", "preset", "debug"), &EditorExportPlatform::get_internal_export_files); |
2506 | 2516 |
|
2507 | | - ClassDB::bind_static_method("EditorExportPlatform", D_METHOD("get_forced_export_files"), &EditorExportPlatform::get_forced_export_files); |
| 2517 | + ClassDB::bind_static_method("EditorExportPlatform", D_METHOD("get_forced_export_files", "preset"), &EditorExportPlatform::get_forced_export_files); |
2508 | 2518 |
|
2509 | 2519 | BIND_ENUM_CONSTANT(EXPORT_MESSAGE_NONE); |
2510 | 2520 | BIND_ENUM_CONSTANT(EXPORT_MESSAGE_INFO); |
|
0 commit comments