use of com.freya02.botcommands.api.utils.ButtonContent in project BotCommands by freya022.
the class ChoiceMenu method putComponents.
@Override
protected void putComponents() {
super.putComponents();
final MenuPage<E> page = pages.get(this.page);
final List<E> entries = page.entries();
for (int i = 0; i < entries.size(); i++) {
final E item = entries.get(i);
final ButtonContent content = buttonContentSupplier.apply(item, i);
final Button choiceButton = Components.primaryButton(event -> {
this.cleanup(event.getContext());
callback.accept(event, item);
}).setConstraints(constraints).build(content);
components.addComponents(1 + (i / 5), choiceButton);
}
}
Aggregations