Merge pull request #72482 from KoBeWi/dubious_stuff
Prevent wrong unedit when clicking editor viewport
This commit is contained in:
commit
e8c405de4d
3 changed files with 16 additions and 1 deletions
|
@ -2136,6 +2136,13 @@ void EditorNode::edit_item(Object *p_object, Object *p_editing_owner) {
|
|||
}
|
||||
}
|
||||
|
||||
void EditorNode::push_node_item(Node *p_node) {
|
||||
if (p_node || Object::cast_to<Node>(InspectorDock::get_inspector_singleton()->get_edited_object())) {
|
||||
// Don't push null if the currently edited object is not a Node.
|
||||
push_item(p_node);
|
||||
}
|
||||
}
|
||||
|
||||
void EditorNode::push_item(Object *p_object, const String &p_property, bool p_inspector_only) {
|
||||
if (!p_object) {
|
||||
InspectorDock::get_inspector_singleton()->edit(nullptr);
|
||||
|
|
|
@ -798,6 +798,7 @@ public:
|
|||
|
||||
void push_item(Object *p_object, const String &p_property = "", bool p_inspector_only = false);
|
||||
void edit_item(Object *p_object, Object *p_editing_owner);
|
||||
void push_node_item(Node *p_node);
|
||||
void hide_unused_editors(const Object *p_editing_owner = nullptr);
|
||||
|
||||
void select_editor_by_name(const String &p_name);
|
||||
|
|
|
@ -1427,7 +1427,14 @@ void SceneTreeDock::_script_open_request(const Ref<Script> &p_script) {
|
|||
}
|
||||
|
||||
void SceneTreeDock::_push_item(Object *p_object) {
|
||||
EditorNode::get_singleton()->push_item(p_object);
|
||||
Node *node = Object::cast_to<Node>(p_object);
|
||||
if (node || !p_object) {
|
||||
// Assume that null object is a Node.
|
||||
EditorNode::get_singleton()->push_node_item(node);
|
||||
} else {
|
||||
EditorNode::get_singleton()->push_item(p_object);
|
||||
}
|
||||
|
||||
if (p_object == nullptr) {
|
||||
EditorNode::get_singleton()->hide_unused_editors(this);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue