From 5065e46381814746eeddb4c44b5eb1540b0331f8 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 28 Jun 2016 13:10:15 -0300 Subject: Change method of storing folding, solves problems with inheritance, closes #3395 --- tools/editor/scene_tree_editor.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'tools') 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); } -- cgit v1.2.3