void EditorAssetInstaller::_item_edited() { if (updating) return; TreeItem *item = tree->get_edited(); if (!item) return; String path=item->get_metadata(0); updating=true; if (path==String()) { //a dir _update_subitems(item,item->is_checked(0),true); } if (item->is_checked(0)) { while(item) { item->set_checked(0,true); item=item->get_parent(); } } updating=false; }
void EditorAssetInstaller::_update_subitems(TreeItem *p_item, bool p_check, bool p_first) { if (p_check) { if (p_item->get_custom_color(0) == Color()) { p_item->set_checked(0, true); } } else { p_item->set_checked(0, false); } if (p_item->get_children()) { _update_subitems(p_item->get_children(), p_check); } if (!p_first && p_item->get_next()) { _update_subitems(p_item->get_next(), p_check); } }