Skip to content

Commit

Permalink
Reset display folded for an instanced scene if editable children is t…
Browse files Browse the repository at this point in the history
…oggled off

This avoids the display folded flag needlessly getting into the scene file (potentially forever) and also gives more visual feedback if the user re-enables editable children so it will display unfolded at first.
  • Loading branch information
RandomShaper committed Apr 7, 2017
1 parent 65f8210 commit 4b85dda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scene/main/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2063,10 +2063,14 @@ void Node::set_editable_instance(Node *p_node, bool p_editable) {
ERR_FAIL_NULL(p_node);
ERR_FAIL_COND(!is_a_parent_of(p_node));
NodePath p = get_path_to(p_node);
if (!p_editable)
if (!p_editable) {
data.editable_instances.erase(p);
else
// Avoid this flag being needlessly saved;
// also give more visual feedback if editable children is reenabled
set_display_folded(false);
} else {
data.editable_instances[p] = true;
}
}

bool Node::is_editable_instance(Node *p_node) const {
Expand Down

0 comments on commit 4b85dda

Please sign in to comment.