Forráskód Böngészése

[Export] Fix TextServer data export.

bruvzg 2 éve
szülő
commit
59d5b2d6d3
1 módosított fájl, 14 hozzáadás és 10 törlés
  1. 14 10
      editor/export/editor_export_platform.cpp

+ 14 - 10
editor/export/editor_export_platform.cpp

@@ -859,16 +859,20 @@ Vector<String> 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);
+					}
+				}
 			}
 		}
 	}