diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-06-28 13:10:15 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-28 13:10:15 -0300 |
commit | 5065e46381814746eeddb4c44b5eb1540b0331f8 (patch) | |
tree | 95f00c4e0e10d1765f5643a3f83e2e1938582253 /tools | |
parent | 519fce94e97888d37efc11b44e6cc6cb01b51a3a (diff) |
Change method of storing folding, solves problems with inheritance, closes #3395
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/scene_tree_editor.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index a155f0c0cf..f174bc2f1b 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -302,8 +302,15 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) { item->set_selectable(0,true); if (can_rename) { - - bool collapsed = p_node->has_meta("_editor_collapsed") ? (bool)p_node->get_meta("_editor_collapsed") : false; +#ifdef ENABLE_DEPRECATED + if (p_node->has_meta("_editor_collapsed")) { + //remove previous way of storing folding, which did not get along with scene inheritance and instancing + if ((bool)p_node->get_meta("_editor_collapsed")) + p_node->set_display_folded(true); + p_node->set_meta("_editor_collapsed",Variant()); + } +#endif + bool collapsed = p_node->is_displayed_folded(); if (collapsed) item->set_collapsed(true); } @@ -896,10 +903,7 @@ void SceneTreeEditor::_cell_collapsed(Object *p_obj) { Node *n=get_node(np); ERR_FAIL_COND(!n); - if (collapsed) - n->set_meta("_editor_collapsed",true); - else - n->set_meta("_editor_collapsed",Variant()); + n->set_display_folded(collapsed); } |