Allow passing UID to importer

This helps, for importers spitting out new resources to the res://
filesystem to actually hash them to generate deterministic UIDs.

This PR also fixes the determinism for translations.
This commit is contained in:
Juan 2024-09-23 16:07:40 +02:00 committed by Rémi Verschelde
parent 0f5f3bc954
commit fe34c45d2a
No known key found for this signature in database
GPG key ID: C3336907360768E1
38 changed files with 54 additions and 41 deletions

View file

@ -70,7 +70,7 @@ String ResourceImporterImage::get_preset_name(int p_idx) const {
void ResourceImporterImage::get_import_options(const String &p_path, List<ImportOption> *r_options, int p_preset) const {
}
Error ResourceImporterImage::import(const String &p_source_file, const String &p_save_path, const HashMap<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
Error ResourceImporterImage::import(ResourceUID::ID p_source_id, const String &p_source_file, const String &p_save_path, const HashMap<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
Ref<FileAccess> f = FileAccess::open(p_source_file, FileAccess::READ);
ERR_FAIL_COND_V_MSG(f.is_null(), ERR_CANT_OPEN, "Cannot open file from path '" + p_source_file + "'.");