From 59d5b2d6d36bbd537b2b414dfdd5e888209ccd65 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Fri, 22 Sep 2023 11:50:35 +0300 Subject: [PATCH] [Export] Fix TextServer data export. --- editor/export/editor_export_platform.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index b3fefaafc67..07c9caf4263 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -859,16 +859,20 @@ Vector EditorExportPlatform::get_forced_export_files() { bool use_data = GLOBAL_GET("internationalization/locale/include_text_server_data"); if (use_data) { // Try using user provided data file. - String ts_data = "res://" + TS->get_support_data_filename(); - if (FileAccess::exists(ts_data)) { - files.push_back(ts_data); - } else { - // Use default text server data. - String icu_data_file = EditorPaths::get_singleton()->get_cache_dir().path_join("tmp_icu_data"); - ERR_FAIL_COND_V(!TS->save_support_data(icu_data_file), files); - files.push_back(icu_data_file); - // Remove the file later. - MessageQueue::get_singleton()->push_callable(callable_mp_static(DirAccess::remove_absolute), icu_data_file); + if (!TS->get_support_data_filename().is_empty()) { + String ts_data = "res://" + TS->get_support_data_filename(); + if (FileAccess::exists(ts_data)) { + files.push_back(ts_data); + } else { + // Use default text server data. + String abs_path = ProjectSettings::get_singleton()->globalize_path(ts_data); + ERR_FAIL_COND_V(!TS->save_support_data(abs_path), files); + if (FileAccess::exists(abs_path)) { + files.push_back(ts_data); + // Remove the file later. + MessageQueue::get_singleton()->push_callable(callable_mp_static(DirAccess::remove_absolute), abs_path); + } + } } } }