diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2023-04-26 17:57:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-26 17:57:45 +0200 |
commit | ba004ea1c3b00c5516548edde7bdfe2d72d51ea1 (patch) | |
tree | 534f23706b47017760b8d5e9395b00ef3ebd385a /scene/resources/resource_format_text.cpp | |
parent | d78691d44fe6e4f38dce3a89164cdae688772031 (diff) | |
parent | e7f4af091331ef10dd2088d82bc552a097d3d4ce (diff) |
Merge pull request #76476 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.3) - 3rd batch
Diffstat (limited to 'scene/resources/resource_format_text.cpp')
-rw-r--r-- | scene/resources/resource_format_text.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 448e800900..c30e009356 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -946,14 +946,24 @@ Error ResourceLoaderText::rename_dependencies(Ref<FileAccess> p_f, const String } else { if (fw.is_null()) { fw = FileAccess::open(p_path + ".depren", FileAccess::WRITE); + + if (res_uid == ResourceUID::INVALID_ID) { + res_uid = ResourceSaver::get_resource_id_for_path(p_path); + } + + String uid_text = ""; + if (res_uid != ResourceUID::INVALID_ID) { + uid_text = " uid=\"" + ResourceUID::get_singleton()->id_to_text(res_uid) + "\""; + } + if (is_scene) { - fw->store_line("[gd_scene load_steps=" + itos(resources_total) + " format=" + itos(FORMAT_VERSION) + "]\n"); + fw->store_line("[gd_scene load_steps=" + itos(resources_total) + " format=" + itos(FORMAT_VERSION) + uid_text + "]\n"); } else { String script_res_text; if (!script_class.is_empty()) { script_res_text = "script_class=\"" + script_class + "\" "; } - fw->store_line("[gd_resource type=\"" + res_type + "\" " + script_res_text + "load_steps=" + itos(resources_total) + " format=" + itos(FORMAT_VERSION) + "]\n"); + fw->store_line("[gd_resource type=\"" + res_type + "\" " + script_res_text + "load_steps=" + itos(resources_total) + " format=" + itos(FORMAT_VERSION) + uid_text + "]\n"); } } |