diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-02-07 09:38:42 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-02-07 09:47:16 +0100 |
commit | ec00283f9100c0456f09fd70edd2c6d3eb763c92 (patch) | |
tree | f661ac593abd9df6877d98b6b8642b86e249ab84 /core/io | |
parent | 863f2840a582e289612147be43d8cbededed668c (diff) |
ResourceImporter: Restore default append logic for new importers
This was changed in #56943 to allow adding new importers from plugins that
take precedence over built-in ones, but this should be opt-in, not the default
behavior.
Fixes #57730.
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/resource_importer.cpp | 8 | ||||
-rw-r--r-- | core/io/resource_importer.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp index e167611d4a..9b6440e2a2 100644 --- a/core/io/resource_importer.cpp +++ b/core/io/resource_importer.cpp @@ -464,7 +464,11 @@ void ResourceImporter::_bind_methods() { BIND_ENUM_CONSTANT(IMPORT_ORDER_SCENE); } -void ResourceFormatImporter::add_importer(const Ref<ResourceImporter> &p_importer) { +void ResourceFormatImporter::add_importer(const Ref<ResourceImporter> &p_importer, bool p_first_priority) { ERR_FAIL_COND(p_importer.is_null()); - importers.insert(0, p_importer); + if (p_first_priority) { + importers.insert(0, p_importer); + } else { + importers.push_back(p_importer); + } } diff --git a/core/io/resource_importer.h b/core/io/resource_importer.h index f242f29ccd..2fffc16ad8 100644 --- a/core/io/resource_importer.h +++ b/core/io/resource_importer.h @@ -80,7 +80,7 @@ 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); + void add_importer(const Ref<ResourceImporter> &p_importer, bool p_first_priority = false); void remove_importer(const Ref<ResourceImporter> &p_importer) { importers.erase(p_importer); } Ref<ResourceImporter> get_importer_by_name(const String &p_name) const; |