Added clear and remove methods for handlers
In my case it was useful to have a clearCloseHandler (having a default close handler which gets removed after something in gui got accepeted). I just added it for the other handlers in this pr, too. Just in case someone else needs it.
[A different way would be to make the handlers list public / accesable]
Hi, wouldn't be easier to add a condition in the [close/click/open] handler to "remove" it when it's not needed ? Like in the example in the README
Can you Show me the Part on the readme, I cant find.
My bad it’s not directly in the README, but for example you can do this:
boolean ignoreClicks = false;
inv.addClickHandler(e -> {
if (ignoreClicks) {
return;
}
if (someConditionThatShouldRemoveHandler) {
ignoreClicks = true;
}
});
Yep thats possible but if I cold remove all added handlers with Just one Line as the inventory should Close without any Interactions it would be way easier. Also it would be possible to create multiple default handlers which I can add and remove Like I want for the inventory 😅 To make it more understanble if you do a refreshable gui out of fastinv such as paged ones or updated inventories. It will be very useful.