Improve TreeItem API and allow to move nodes

This commit is contained in:
trollodel 2021-03-07 21:07:30 +01:00
parent 92c04fa727
commit bca0d36fe6
28 changed files with 527 additions and 289 deletions

View file

@ -59,7 +59,7 @@ void VisualScriptPropertySelector::_sbox_input(const Ref<InputEvent> &p_ie) {
search_box->accept_event();
TreeItem *root = search_options->get_root();
if (!root->get_children()) {
if (!root->get_first_child()) {
break;
}
@ -265,7 +265,7 @@ void VisualScriptPropertySelector::_update_search() {
item->set_metadata(2, connecting);
}
if (category && category->get_children() == nullptr) {
if (category && category->get_first_child() == nullptr) {
memdelete(category); //old category was unused
}
}
@ -310,7 +310,7 @@ void VisualScriptPropertySelector::_update_search() {
found = true;
}
get_ok_button()->set_disabled(root->get_children() == nullptr);
get_ok_button()->set_disabled(root->get_first_child() == nullptr);
}
void VisualScriptPropertySelector::create_visualscript_item(const String &name, TreeItem *const root, const String &search_input, const String &text) {