diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-11-23 16:19:24 +0100 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-11-23 16:24:43 +0100 |
commit | bc1949d7978c428ae3579e240368e20022ee77cd (patch) | |
tree | ecee80e7e1211db4320b5f90001d845d8fd60bac /editor/editor_node.cpp | |
parent | bb63963486a389d4417ba13249a40219f3774df0 (diff) | |
download | redot-engine-bc1949d7978c428ae3579e240368e20022ee77cd.tar.gz |
Correctly check scripts that must inherit `EditorPlugin`
Also updates some error messages related to this kind of check
across the codebase.
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 32da37ad27..216eb17cb9 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3454,13 +3454,13 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled, } // Plugin init scripts must inherit from EditorPlugin and be tools. - if (String(scr->get_instance_base_type()) != "EditorPlugin") { - show_warning(vformat(TTR("Unable to load addon script from path: '%s' Base type is not EditorPlugin."), script_path)); + if (!ClassDB::is_parent_class(scr->get_instance_base_type(), "EditorPlugin")) { + show_warning(vformat(TTR("Unable to load addon script from path: '%s'. Base type is not 'EditorPlugin'."), script_path)); return; } if (!scr->is_tool()) { - show_warning(vformat(TTR("Unable to load addon script from path: '%s' Script is not in tool mode."), script_path)); + show_warning(vformat(TTR("Unable to load addon script from path: '%s'. Script is not in tool mode."), script_path)); return; } } |