summaryrefslogtreecommitdiffstats
path: root/editor/editor_data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_data.cpp')
-rw-r--r--editor/editor_data.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 5d3037b4ec..596a2dfac1 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -485,6 +485,24 @@ EditorPlugin *EditorData::get_editor_plugin(int p_idx) {
return editor_plugins[p_idx];
}
+void EditorData::add_extension_editor_plugin(const StringName &p_class_name, EditorPlugin *p_plugin) {
+ ERR_FAIL_COND(extension_editor_plugins.has(p_class_name));
+ extension_editor_plugins.insert(p_class_name, p_plugin);
+}
+
+void EditorData::remove_extension_editor_plugin(const StringName &p_class_name) {
+ extension_editor_plugins.erase(p_class_name);
+}
+
+bool EditorData::has_extension_editor_plugin(const StringName &p_class_name) {
+ return extension_editor_plugins.has(p_class_name);
+}
+
+EditorPlugin *EditorData::get_extension_editor_plugin(const StringName &p_class_name) {
+ EditorPlugin **plugin = extension_editor_plugins.getptr(p_class_name);
+ return plugin == nullptr ? nullptr : *plugin;
+}
+
void EditorData::add_custom_type(const String &p_type, const String &p_inherits, const Ref<Script> &p_script, const Ref<Texture2D> &p_icon) {
ERR_FAIL_COND_MSG(p_script.is_null(), "It's not a reference to a valid Script object.");
CustomType ct;