diff options
author | kobewi <kobewi4e@gmail.com> | 2023-01-28 21:44:20 +0100 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2023-01-28 21:44:20 +0100 |
commit | 3f17bfad8d5a83087dd03b8f22feaaf5cbf97519 (patch) | |
tree | 5f24756400773bd25e522e3c3de555a3d474af0e /editor/editor_node.cpp | |
parent | 218bef90af2091afde3b1be816c87286c194a2a8 (diff) | |
download | redot-engine-3f17bfad8d5a83087dd03b8f22feaaf5cbf97519.tar.gz |
Fix editors potentially being used twice
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 0d5c820a3c..8b28319a1d 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2096,14 +2096,25 @@ void EditorNode::edit_item(Object *p_object, Object *p_editing_owner) { if (!item_plugins.is_empty()) { ObjectID owner_id = p_editing_owner->get_instance_id(); + List<EditorPlugin *> to_remove; for (EditorPlugin *plugin : active_plugins[owner_id]) { if (!item_plugins.has(plugin)) { + // Remove plugins no longer used by this editing owner. + to_remove.push_back(plugin); plugin->make_visible(false); plugin->edit(nullptr); } } + for (EditorPlugin *plugin : to_remove) { + active_plugins[owner_id].erase(plugin); + } + for (EditorPlugin *plugin : item_plugins) { + if (active_plugins[owner_id].has(plugin)) { + continue; + } + for (KeyValue<ObjectID, HashSet<EditorPlugin *>> &kv : active_plugins) { if (kv.key != owner_id) { EditorPropertyResource *epres = Object::cast_to<EditorPropertyResource>(ObjectDB::get_instance(kv.key)); |