summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/io/resource_importer.cpp5
-rw-r--r--core/io/resource_importer.h12
2 files changed, 16 insertions, 1 deletions
diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp
index b503655edd..f612b84404 100644
--- a/core/io/resource_importer.cpp
+++ b/core/io/resource_importer.cpp
@@ -445,3 +445,8 @@ ResourceFormatImporter *ResourceFormatImporter::singleton = nullptr;
ResourceFormatImporter::ResourceFormatImporter() {
singleton = this;
}
+
+void ResourceImporter::_bind_methods() {
+ BIND_ENUM_CONSTANT(IMPORT_ORDER_DEFAULT);
+ BIND_ENUM_CONSTANT(IMPORT_ORDER_SCENE);
+}
diff --git a/core/io/resource_importer.h b/core/io/resource_importer.h
index 2ceeb176e5..62cb608a42 100644
--- a/core/io/resource_importer.h
+++ b/core/io/resource_importer.h
@@ -96,6 +96,9 @@ public:
class ResourceImporter : public RefCounted {
GDCLASS(ResourceImporter, RefCounted);
+protected:
+ static void _bind_methods();
+
public:
virtual String get_importer_name() const = 0;
virtual String get_visible_name() const = 0;
@@ -103,7 +106,7 @@ public:
virtual String get_save_extension() const = 0;
virtual String get_resource_type() const = 0;
virtual float get_priority() const { return 1.0; }
- virtual int get_import_order() const { return 0; }
+ virtual int get_import_order() const { return IMPORT_ORDER_DEFAULT; }
virtual int get_format_version() const { return 0; }
struct ImportOption {
@@ -117,6 +120,11 @@ public:
ImportOption() {}
};
+ enum ImportOrder {
+ IMPORT_ORDER_DEFAULT = 0,
+ IMPORT_ORDER_SCENE = 100,
+ };
+
virtual bool has_advanced_options() const { return false; }
virtual void show_advanced_options(const String &p_path) {}
@@ -137,4 +145,6 @@ public:
virtual String get_import_settings_string() const { return String(); }
};
+VARIANT_ENUM_CAST(ResourceImporter::ImportOrder);
+
#endif // RESOURCE_IMPORTER_H