1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

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

View File

@@ -2318,16 +2318,20 @@ void EditorNode::edit_item(Object *p_object, Object *p_editing_owner) {
active_plugins[owner_id].erase(plugin); active_plugins[owner_id].erase(plugin);
} }
LocalVector<EditorPlugin *> to_over_edit;
// Send the edited object to the plugins. // Send the edited object to the plugins.
for (EditorPlugin *plugin : available_plugins) { for (EditorPlugin *plugin : available_plugins) {
if (active_plugins[owner_id].has(plugin)) { 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); plugin->edit(p_object);
continue; continue;
} }
if (active_plugins.has(plugin->get_instance_id())) { if (active_plugins.has(plugin->get_instance_id())) {
// Plugin is already active, but as self-owning, so it needs a separate check. // Plugin is already active, but as self-owning, so it needs a separate check.
plugin->make_visible(true);
plugin->edit(p_object); plugin->edit(p_object);
continue; continue;
} }
@@ -2346,6 +2350,11 @@ void EditorNode::edit_item(Object *p_object, Object *p_editing_owner) {
// Activate previously inactive plugin and edit the object. // Activate previously inactive plugin and edit the object.
active_plugins[owner_id].insert(plugin); 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); _plugin_over_edit(plugin, p_object);
} }
} }