Merge pull request #24079 from YeldhamDev/list_editor_hide_removal

Fix ItemList editor not hiding on node removal
This commit is contained in:
Rémi Verschelde 2018-12-02 17:08:56 +01:00 committed by GitHub
commit 3ee062908b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -265,6 +265,9 @@ void ItemListEditor::_notification(int p_notification) {
add_button->set_icon(get_icon("Add", "EditorIcons"));
del_button->set_icon(get_icon("Remove", "EditorIcons"));
} else if (p_notification == NOTIFICATION_READY) {
get_tree()->connect("node_removed", this, "_node_removed");
}
}
@ -341,6 +344,7 @@ bool ItemListEditor::handles(Object *p_object) const {
void ItemListEditor::_bind_methods() {
ClassDB::bind_method("_node_removed", &ItemListEditor::_node_removed);
ClassDB::bind_method("_edit_items", &ItemListEditor::_edit_items);
ClassDB::bind_method("_add_button", &ItemListEditor::_add_pressed);
ClassDB::bind_method("_delete_button", &ItemListEditor::_delete_pressed);