Merge pull request #85686 from kevmorg/master
Hide Node dock successfully on undo/redo and deletion
This commit is contained in:
commit
7f02f5b71b
2 changed files with 14 additions and 4 deletions
|
@ -67,14 +67,23 @@ void NodeDock::update_lists() {
|
||||||
connections->update_tree();
|
connections->update_tree();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NodeDock::_on_node_tree_exited() {
|
||||||
|
set_node(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
void NodeDock::set_node(Node *p_node) {
|
void NodeDock::set_node(Node *p_node) {
|
||||||
connections->set_node(p_node);
|
if (last_valid_node) {
|
||||||
groups->set_current(p_node);
|
last_valid_node->disconnect("tree_exited", callable_mp(this, &NodeDock::_on_node_tree_exited));
|
||||||
if (p_node) {
|
last_valid_node = nullptr;
|
||||||
last_valid_node = p_node;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connections->set_node(p_node);
|
||||||
|
groups->set_current(p_node);
|
||||||
|
|
||||||
if (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()) {
|
if (connections_button->is_pressed()) {
|
||||||
connections->show();
|
connections->show();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -58,6 +58,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
void _notification(int p_what);
|
void _notification(int p_what);
|
||||||
|
void _on_node_tree_exited();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_node(Node *p_node);
|
void set_node(Node *p_node);
|
||||||
|
|
Loading…
Reference in a new issue