diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-06-11 14:31:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-11 14:31:46 +0200 |
commit | d4e64e0e60ee9377bedb1c3324bd346abc129aae (patch) | |
tree | efc49bd1d14994b03ad9dfea431fc11f2a18d7fb | |
parent | bcc435094d0734174818cf3e55887a26ef111686 (diff) | |
parent | 9ecdf522bd95a3318ac75ff8f9e237b35b5beca3 (diff) |
Merge pull request #9121 from leezh/editor_import_plugin
Added EditorPlugin.remove_import_plugin()
-rw-r--r-- | core/io/resource_import.h | 1 | ||||
-rw-r--r-- | editor/editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/editor_plugin.h | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/core/io/resource_import.h b/core/io/resource_import.h index 25b7a534b2..9d2a5180dc 100644 --- a/core/io/resource_import.h +++ b/core/io/resource_import.h @@ -61,6 +61,7 @@ public: String get_internal_resource_path(const String &p_path) const; void add_importer(const Ref<ResourceImporter> &p_importer) { importers.insert(p_importer); } + void remove_importer(const Ref<ResourceImporter> &p_importer) { importers.erase(p_importer); } Ref<ResourceImporter> get_importer_by_name(const String &p_name); Ref<ResourceImporter> get_importer_by_extension(const String &p_extension); void get_importers_for_extension(const String &p_extension, List<Ref<ResourceImporter> > *r_importers); diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 1b8d1b1677..6fcea98e32 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -281,6 +281,11 @@ void EditorPlugin::add_import_plugin(const Ref<EditorImportPlugin> &p_importer) EditorFileSystem::get_singleton()->scan_changes(); } +void EditorPlugin::remove_import_plugin(const Ref<EditorImportPlugin> &p_importer) { + ResourceFormatImporter::get_singleton()->remove_importer(p_importer); + EditorFileSystem::get_singleton()->scan_changes(); +} + void EditorPlugin::set_window_layout(Ref<ConfigFile> p_layout) { if (get_script_instance() && get_script_instance()->has_method("set_window_layout")) { @@ -366,6 +371,7 @@ void EditorPlugin::_bind_methods() { ClassDB::bind_method(D_METHOD("queue_save_layout"), &EditorPlugin::queue_save_layout); ClassDB::bind_method(D_METHOD("edit_resource"), &EditorPlugin::edit_resource); ClassDB::bind_method(D_METHOD("add_import_plugin"), &EditorPlugin::add_import_plugin); + ClassDB::bind_method(D_METHOD("remove_import_plugin"), &EditorPlugin::remove_import_plugin); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_canvas_gui_input", PropertyInfo(Variant::TRANSFORM2D, "canvas_xform"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_draw_over_canvas", PropertyInfo(Variant::TRANSFORM2D, "canvas_xform"), PropertyInfo(Variant::OBJECT, "canvas:Control"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index 1ef447a6b8..c607846ec9 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -148,6 +148,7 @@ public: virtual void save_global_state(); void add_import_plugin(const Ref<EditorImportPlugin> &p_importer); + void remove_import_plugin(const Ref<EditorImportPlugin> &p_importer); EditorPlugin(); virtual ~EditorPlugin(); |