XaGUI
Defaults and styling
Configure global and per-menu appearance and sounds.
Configure global defaults once after constructing XaGui. New menus and buttons use them.
XaGui xaGui = new XaGui(this);
xaGui.setBorderItem(new GuiButton(Material.BLACK_STAINED_GLASS_PANE)
.setName(" ").getItem());
xaGui.setCloseButton(new GuiButton(Material.BARRIER)
.setName("&cClose")
.withListener(event -> event.getPlayer().closeInventory()));
xaGui.setPreviousPageButton(new GuiButton(Material.ARROW)
.setName("&ePrevious page").getItem());
xaGui.setNextPageButton(new GuiButton(Material.ARROW)
.setName("&eNext page").getItem());
xaGui.setButtonClickSound(Sound.UI_BUTTON_CLICK, 0.8f);
xaGui.setRedirectSound(Sound.ITEM_BOOK_PAGE_TURN);
xaGui.setCloseButtonSound(Sound.BLOCK_CHEST_CLOSE);Global handlers run for every XaGUI menu:
xaGui.setOnOpen(event -> getLogger().fine("GUI opened"));
xaGui.setOnClose(event -> getLogger().fine("GUI closed"));Per-menu settings:
menu.setOpenSound(Sound.BLOCK_CHEST_OPEN, 0.7f);
menu.setPageSwitchSound(Sound.ITEM_BOOK_PAGE_TURN);
menu.addPaginator();
menu.setNextPageButton(customNextItem);
menu.setPreviousPageButton(customPreviousItem);Call addPaginator() first because it enables navigation and copies the global defaults into the menu. Then replace either item with a per-menu value.