diff options
author | Juan Linietsky <juan@godotengine.org> | 2019-03-04 21:00:50 -0300 |
---|---|---|
committer | Juan Linietsky <juan@godotengine.org> | 2019-03-04 21:01:21 -0300 |
commit | ffd44530fb3d4af98393264dadd895f320c62417 (patch) | |
tree | 2d847442ab0734de7330d57c4274ea47a1eeccb4 | |
parent | 3aff78f53242df3a5541747e818ce4ac68219a16 (diff) |
Make sure ResurceLoader.exists works on imported files, fixes #23555
-rw-r--r-- | core/io/resource_importer.cpp | 5 | ||||
-rw-r--r-- | core/io/resource_importer.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp index 69907a710a..b5fa412576 100644 --- a/core/io/resource_importer.cpp +++ b/core/io/resource_importer.cpp @@ -183,6 +183,11 @@ void ResourceFormatImporter::get_recognized_extensions_for_type(const String &p_ } } +bool ResourceFormatImporter::exists(const String &p_path) const { + + return FileAccess::exists(p_path + ".import"); +} + bool ResourceFormatImporter::recognize_path(const String &p_path, const String &p_for_type) const { return FileAccess::exists(p_path + ".import"); diff --git a/core/io/resource_importer.h b/core/io/resource_importer.h index ca40b47b85..1c146c33d7 100644 --- a/core/io/resource_importer.h +++ b/core/io/resource_importer.h @@ -69,6 +69,7 @@ public: virtual bool is_import_valid(const String &p_path) const; virtual void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false); virtual bool is_imported(const String &p_path) const { return recognize_path(p_path); } + virtual bool exists(const String &p_path) const; virtual bool can_be_imported(const String &p_path) const; virtual int get_import_order(const String &p_path) const; |