Skip to content

Commit

Permalink
Hide Node dock successfully on undo/redo and deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmorg authored and GuybrushThreepwood-GitHub committed Jan 27, 2024
1 parent 83fbe20 commit 61c73f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions editor/node_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
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 (p_node) {
if (connections_button->is_pressed()) {
connections->show();
} else {
Expand Down
1 change: 1 addition & 0 deletions editor/node_dock.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class NodeDock : public VBoxContainer {
protected:
static void _bind_methods();
void _notification(int p_what);
void _on_node_tree_exited();

public:
void set_node(Node *p_node);
Expand Down

0 comments on commit 61c73f5

Please sign in to comment.