Merge pull request #98675 from YeldhamDev/dont_be_shy_plugin

Fix certain editor plugins not showing when they should
This commit is contained in:
Thaddeus Crews 2024-12-10 14:16:09 -06:00
commit 15aa18bc92
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84

View File

@ -2318,16 +2318,20 @@ void EditorNode::edit_item(Object *p_object, Object *p_editing_owner) {
active_plugins[owner_id].erase(plugin);
}
LocalVector<EditorPlugin *> to_over_edit;
// Send the edited object to the plugins.
for (EditorPlugin *plugin : available_plugins) {
if (active_plugins[owner_id].has(plugin)) {
// Plugin was already active, just change the object.
// Plugin was already active, just change the object and ensure it's visible.
plugin->make_visible(true);
plugin->edit(p_object);
continue;
}
if (active_plugins.has(plugin->get_instance_id())) {
// Plugin is already active, but as self-owning, so it needs a separate check.
plugin->make_visible(true);
plugin->edit(p_object);
continue;
}
@ -2346,6 +2350,11 @@ void EditorNode::edit_item(Object *p_object, Object *p_editing_owner) {
// Activate previously inactive plugin and edit the object.
active_plugins[owner_id].insert(plugin);
// TODO: Call the function directly once a proper priority system is implemented.
to_over_edit.push_back(plugin);
}
for (EditorPlugin *plugin : to_over_edit) {
_plugin_over_edit(plugin, p_object);
}
}