public class GuiUsersMenu extends GuiMenu
The menu displays the names of the player as clickable items.
Upon a click event, the menu reports to the callback object with an id parameter equal to the player DB ID and a String data parameter with the name of the player.
For the rest, a GuiUsersMenu is managed exactly like a regular GuiMenu.
Important: due to the way Rising World plug-ins are loaded, this class cannot instantiated or used in any way from within the onEnable() method of a plug-in, as it is impossible to be sure that, at that moment, the RWGui plug-in has already been loaded.
The first moment one can be sure that all plug-ins have been loaded, and it is safe to use this class, is when (or after) the first player connects to the server (either dedicated or local).
| Constructor and Description |
|---|
GuiUsersMenu(net.risingworld.api.Plugin plugin,
java.lang.String titleText,
RWGui.RWGuiCallback callback,
int excludeId)
Creates a new GuiUsersMenu.
|
addChild, addItem, removeChild, removeChild, removeItem, removeItemaddChild, addChild, close, free, getItemId, layout, onClick, onTextEntry, pop, poppush, push, removeChild, setCallback, setMargin, setPadding, showdestroy, equals, getAlpha, getBorderColor, getBorderThickness, getColor, getHeight, getHoverColor, getID, getParent, getParentID, getPivot, getPositionX, getPositionY, getWidth, hashCode, isRelativeBorderThickness, isRelativePosition, isRelativeSize, isVisible, refresh, removeFromParent, setAlpha, setBorderColor, setBorderColor, setBorderThickness, setColor, setColor, setPivot, setPosition, setSize, setVisiblepublic GuiUsersMenu(net.risingworld.api.Plugin plugin,
java.lang.String titleText,
RWGui.RWGuiCallback callback,
int excludeId)
plugin - the plug-in the GuiMenu is intended for. This
is only needed to manage the internal event listener
and has no effects on the plug-in itself.titleText - the text of the title.callback - the callback object to which to report events. Can
be null, but in this case no event will reported
until an actual callback object is set with the
setCallback() method.excludeId - the DB ID of a player who should not be shown in
the menu; useful when a player is selecting another
and his own name should not appear in the list.
Use -1 to not exclude any player.