diff options
author | Juan Linietsky <reduzio@gmail.com> | 2022-12-05 19:01:59 +0100 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2023-01-09 18:52:00 +0100 |
commit | 07a964fce34bf72610db5d0a50c5c18adb974f97 (patch) | |
tree | f0d804da58e697b9a58ad47b624d0b2524064933 /core/io/resource_importer.h | |
parent | 964fc6e15d8631a06c2f442299759041328a8473 (diff) |
Ability to change a resource UID from API
* Works for text, binary and imported resources
* Allows better clean up of duplicate files.
TODO (future PRs):
* Use this API for assigning new UIDs to copied files.
* Use this API for UID conflict on FS scanning (if more than one file has the same UID, the newer one(s) should get assigned a different UID).
Diffstat (limited to 'core/io/resource_importer.h')
-rw-r--r-- | core/io/resource_importer.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/io/resource_importer.h b/core/io/resource_importer.h index b104a9dffe..0089544caa 100644 --- a/core/io/resource_importer.h +++ b/core/io/resource_importer.h @@ -32,6 +32,7 @@ #define RESOURCE_IMPORTER_H #include "core/io/resource_loader.h" +#include "core/io/resource_saver.h" class ResourceImporter; @@ -149,4 +150,11 @@ public: VARIANT_ENUM_CAST(ResourceImporter::ImportOrder); +class ResourceFormatImporterSaver : public ResourceFormatSaver { + GDCLASS(ResourceFormatImporterSaver, ResourceFormatSaver) + +public: + virtual Error set_uid(const String &p_path, ResourceUID::ID p_uid) override; +}; + #endif // RESOURCE_IMPORTER_H |