summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorK. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>2022-01-19 03:03:47 -0800
committerK. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>2022-01-19 04:53:28 -0800
commita6f34ea2d00d6cef252501a580fbaf08ec5ad423 (patch)
tree5d0912e00b03bcccfaae3d3d445fcf1630c9d5b6 /core
parentbc5ba38ff59f04a58107b9939fc2db97ca44314e (diff)
Make add_importer and add_post_importer_plugin override existing importers.
Diffstat (limited to 'core')
-rw-r--r--core/io/resource_importer.cpp5
-rw-r--r--core/io/resource_importer.h5
2 files changed, 7 insertions, 3 deletions
diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp
index 470fb2d42d..e167611d4a 100644
--- a/core/io/resource_importer.cpp
+++ b/core/io/resource_importer.cpp
@@ -463,3 +463,8 @@ void ResourceImporter::_bind_methods() {
BIND_ENUM_CONSTANT(IMPORT_ORDER_DEFAULT);
BIND_ENUM_CONSTANT(IMPORT_ORDER_SCENE);
}
+
+void ResourceFormatImporter::add_importer(const Ref<ResourceImporter> &p_importer) {
+ ERR_FAIL_COND(p_importer.is_null());
+ importers.insert(0, p_importer);
+}
diff --git a/core/io/resource_importer.h b/core/io/resource_importer.h
index 261afbab69..f242f29ccd 100644
--- a/core/io/resource_importer.h
+++ b/core/io/resource_importer.h
@@ -80,9 +80,8 @@ public:
String get_internal_resource_path(const String &p_path) const;
void get_internal_resource_path_list(const String &p_path, List<String> *r_paths);
- void add_importer(const Ref<ResourceImporter> &p_importer) {
- importers.push_back(p_importer);
- }
+ void add_importer(const Ref<ResourceImporter> &p_importer);
+
void remove_importer(const Ref<ResourceImporter> &p_importer) { importers.erase(p_importer); }
Ref<ResourceImporter> get_importer_by_name(const String &p_name) const;
Ref<ResourceImporter> get_importer_by_extension(const String &p_extension) const;