Hide Node dock successfully on undo/redo and deletion
Fixes #84530.
(cherry picked from commit da84489b27
)
This commit is contained in:
parent
6e6d49c68a
commit
8633f7bcdb
|
@ -67,14 +67,23 @@ void NodeDock::update_lists() {
|
|||
connections->update_tree();
|
||||
}
|
||||
|
||||
void NodeDock::_on_node_tree_exited() {
|
||||
set_node(nullptr);
|
||||
}
|
||||
|
||||
void NodeDock::set_node(Node *p_node) {
|
||||
connections->set_node(p_node);
|
||||
groups->set_current(p_node);
|
||||
if (p_node) {
|
||||
last_valid_node = p_node;
|
||||
if (last_valid_node) {
|
||||
last_valid_node->disconnect("tree_exited", callable_mp(this, &NodeDock::_on_node_tree_exited));
|
||||
last_valid_node = nullptr;
|
||||
}
|
||||
|
||||
connections->set_node(p_node);
|
||||
groups->set_current(p_node);
|
||||
|
||||
if (p_node) {
|
||||
last_valid_node = p_node;
|
||||
last_valid_node->connect("tree_exited", callable_mp(this, &NodeDock::_on_node_tree_exited));
|
||||
|
||||
if (connections_button->is_pressed()) {
|
||||
connections->show();
|
||||
} else {
|
||||
|
|
|
@ -58,6 +58,7 @@ public:
|
|||
protected:
|
||||
static void _bind_methods();
|
||||
void _notification(int p_what);
|
||||
void _on_node_tree_exited();
|
||||
|
||||
public:
|
||||
void set_node(Node *p_node);
|
||||
|
|
Loading…
Reference in New Issue