Interface CommandCallback
- All Known Implementing Classes:
GuiManagerCommandCallback
public interface CommandCallback
Interface that defines callback functions needed by commands.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaccountCreate(@NotNull String login, @NotNull String password) Creates an account.voidaccountCreateCharacter(@NotNull String login, @NotNull Collection<String> attributes) Creates a character.voidaccountLink(int force, @NotNull String login, @NotNull String password) Links a character to the current account.voidaccountLogin(@NotNull String login, @NotNull String password) Login to an account.voidaccountPassword(@NotNull String currentPassword, @NotNull String newPassword) Change the account password.voidaccountPlayCharacter(@NotNull String name) Plays a character from the current account.voidactivateCommandInput(@NotNull String newText) Activates the command input text field.voidcloseDialog(@NotNull String dialog) Closes a dialog.booleancreateKeyBinding(boolean perCharacter, @NotNull CommandList commandList) Adds a key binding.@NotNull CommandListgetCommandList(@NotNull String args) Returns a command list.@NotNull Collection<String>Returns all command list names.voidopenDialog(@NotNull String dialog) Opens a dialog.voidTerminates the application.booleanremoveKeyBinding(boolean perCharacter) Removes a key binding.voidtoggleDialog(@NotNull String dialog) Toggles a dialog.voidupdatePlayerName(@NotNull String playerName) Sets the current player name.
-
Method Details
-
quitApplication
void quitApplication()Terminates the application. -
openDialog
Opens a dialog. Does nothing if the dialog is open.- Parameters:
dialog- the dialog to open
-
toggleDialog
Toggles a dialog.- Parameters:
dialog- the dialog to toggle
-
closeDialog
Closes a dialog. Does nothing if the dialog is not open.- Parameters:
dialog- the dialog to close
-
getCommandList
@NotNull @NotNull CommandList getCommandList(@NotNull @NotNull String args) throws NoSuchCommandException Returns a command list.- Parameters:
args- the name of the command list- Returns:
- the command list
- Throws:
NoSuchCommandException- if the command list does not exist
-
getCommandListNames
Returns all command list names.- Returns:
- the names in alphabetical order
-
updatePlayerName
Sets the current player name. Does nothing if not currently in the character name prompt.- Parameters:
playerName- the player name
-
activateCommandInput
Activates the command input text field. If the skin defines more than one input field, the first matching one is selected.If neither the main gui nor any visible dialog has an input text field, invisible GUIs are checked as well. If one is found, it is made visible.
- Parameters:
newText- the new command text if non-null
-
createKeyBinding
Adds a key binding.- Parameters:
perCharacter- whether a per-character key binding should be addedcommandList- the command list to execute on key press- Returns:
- whether the key bindings dialog should be opened
-
removeKeyBinding
boolean removeKeyBinding(boolean perCharacter) Removes a key binding.- Parameters:
perCharacter- whether a per-character key binding should be removed- Returns:
- whether the key bindings dialog should be opened
-
accountLogin
Login to an account.- Parameters:
login- loginpassword- password
-
accountCreate
Creates an account.- Parameters:
login- the account's namepassword- the account's password
-
accountPlayCharacter
Plays a character from the current account.- Parameters:
name- the character's name
-
accountLink
Links a character to the current account.- Parameters:
force- 0 to allow failure, 1 to force in certain situationslogin- the character's namepassword- the character's password
-
accountCreateCharacter
void accountCreateCharacter(@NotNull @NotNull String login, @NotNull @NotNull Collection<String> attributes) Creates a character. The password should be the last fromaccountLogin(java.lang.String, java.lang.String)oraccountCreate(java.lang.String, java.lang.String).- Parameters:
login- the character's nameattributes- the character attributes
-
accountPassword
void accountPassword(@NotNull @NotNull String currentPassword, @NotNull @NotNull String newPassword) Change the account password.- Parameters:
currentPassword- the current account passwordnewPassword- the new account password
-