mirror of
https://github.com/godotengine/godot.git
synced 2025-10-30 13:11:13 +00:00
Merge pull request #85271 from YuriSizov/core-check-please!
Correctly check scripts that must inherit `EditorPlugin`
This commit is contained in:
commit
3e7cc5ec32
7 changed files with 23 additions and 28 deletions
|
|
@ -3459,13 +3459,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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue