You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-26 15:46:23 +00:00
Fix editors potentially being used twice
This commit is contained in:
@@ -2096,14 +2096,25 @@ void EditorNode::edit_item(Object *p_object, Object *p_editing_owner) {
|
|||||||
if (!item_plugins.is_empty()) {
|
if (!item_plugins.is_empty()) {
|
||||||
ObjectID owner_id = p_editing_owner->get_instance_id();
|
ObjectID owner_id = p_editing_owner->get_instance_id();
|
||||||
|
|
||||||
|
List<EditorPlugin *> to_remove;
|
||||||
for (EditorPlugin *plugin : active_plugins[owner_id]) {
|
for (EditorPlugin *plugin : active_plugins[owner_id]) {
|
||||||
if (!item_plugins.has(plugin)) {
|
if (!item_plugins.has(plugin)) {
|
||||||
|
// Remove plugins no longer used by this editing owner.
|
||||||
|
to_remove.push_back(plugin);
|
||||||
plugin->make_visible(false);
|
plugin->make_visible(false);
|
||||||
plugin->edit(nullptr);
|
plugin->edit(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (EditorPlugin *plugin : to_remove) {
|
||||||
|
active_plugins[owner_id].erase(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
for (EditorPlugin *plugin : item_plugins) {
|
for (EditorPlugin *plugin : item_plugins) {
|
||||||
|
if (active_plugins[owner_id].has(plugin)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for (KeyValue<ObjectID, HashSet<EditorPlugin *>> &kv : active_plugins) {
|
for (KeyValue<ObjectID, HashSet<EditorPlugin *>> &kv : active_plugins) {
|
||||||
if (kv.key != owner_id) {
|
if (kv.key != owner_id) {
|
||||||
EditorPropertyResource *epres = Object::cast_to<EditorPropertyResource>(ObjectDB::get_instance(kv.key));
|
EditorPropertyResource *epres = Object::cast_to<EditorPropertyResource>(ObjectDB::get_instance(kv.key));
|
||||||
|
|||||||
Reference in New Issue
Block a user