public class GuiInputDlgBox extends GuiDialogueBox
The GuiInputDlgBox has a title, a caption string and an input box to enter a single numeric or textual value.
It notifies the callback object passed to the constructor when the focus leaves the input box or ENTER is pressed, with the given id.
GuiInputDlgBox is practically a fire-and-forget component: the window is automatically shown on creation and destroyed on selection.
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 |
---|
GuiInputDlgBox(net.risingworld.api.Plugin plugin,
net.risingworld.api.objects.Player player,
java.lang.String title,
java.lang.String caption,
java.lang.String defaultText,
int id,
RWGui.RWGuiCallback callback)
Constructs a new GuiInputDlgBox.
|
addNewLayoutChild, addNewTableLayoutChild
addChild, addChild, close, free, getItemId, layout, onClick, onTextEntry, pop, poppush, push, removeChild, setCallback, setMargin, setPadding, show
destroy, 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, setVisible
public GuiInputDlgBox(net.risingworld.api.Plugin plugin, net.risingworld.api.objects.Player player, java.lang.String title, java.lang.String caption, java.lang.String defaultText, int id, RWGui.RWGuiCallback callback)
plugin
- the plug-in the DialogueBox is intended for. This
is only needed to manage the internal event listener
and has no effects on the plug-in itself.player
- the player to show the window to.title
- the text of the title.caption
- the text of the caption.defaultText
- the text to initially show in the input box.id
- the id to report to the callback object on text
input eventcallback
- the callback object to which to report events. Can
be null, but in this case no event will reported.