Interfaces
GuiMenu API
GuiMenuInterface method reference for XaGUI 1.6.1.
Application code can declare menus as GuiMenuInterface; XaGui.createMenu(...) returns concrete GuiMenu.
Lifecycle and information
| Methods | Notes |
|---|---|
open(Player), open(int, Player) | Open page 0 or an explicit page index. |
switchPage(int, Player) | Switch to a zero-based page. |
close(), close(Player) | Close all current viewers or one player. |
getName(), getRawName(), setName(String) | Colored, raw, and mutable title. |
getSize() | Slot count (rows * 9). |
getPages(), getMaxPages() | Current page count. |
getCurrentPageIndex(), getCurrentPage() | Zero-based index and one-based number. |
getOwner() | Owning JavaPlugin. |
Slots
setSlot accepts GuiButtonInterface, ItemStack, or Material, as (slot, value) or (page, slot, value). Related methods:
setAllPageSlot(slot, value)updateSlot([page,] slot, ItemStack|Material)getSlot([page,] slot)clearSlot([page,] slot)andclearAllSlots([page])fillSlots(item, slots...)andfillSlots(page, item, slots...)fillBorder(),fillBorder(ItemStack|Material),fillBorder(page, ItemStack)unlockButton([page,] slot)andlockButton([page,] slot)stickSlot(slot)andunStickSlot(slot)
Controls and events
| Methods | Purpose |
|---|---|
addCloseButton(), addCloseButtonAllPages() | Add global close controls. |
addCloseButton(page, ItemStack|GuiButtonInterface) | Custom close control. |
addPaginator() | Enable automatic navigation. |
setNextPageButton(...), setPreviousPageButton(...) | Per-menu icons. |
setPageSwitchSound(...), setOpenSound(...) | Menu sounds. |
setTotalPages(int) | Resize the menu. |
setOnOpen, setOnClose, setOnClick, setOnClickOwn, setOnPageSwitch | Event handlers. |
allowClickTypes, blacklistClickTypes | GUI click policy. |
setSelfInventoryAccess, allowSelfInventoryClickTypes | Lower-inventory policy. |
setCallback(Runnable), callback() | Store and invoke an application callback. |