public class GuiManagerCommandCallback extends java.lang.Object implements CommandCallback
CommandCallback
that delegates to a GuiManager
.Constructor and Description |
---|
GuiManagerCommandCallback(@NotNull Exiter exiter,
@NotNull CrossfireServerConnection server)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
accountCreate(@NotNull java.lang.String login,
@NotNull java.lang.String password)
Creates an account.
|
void |
accountCreateCharacter(@NotNull java.lang.String login,
@NotNull java.util.Collection<java.lang.String> attributes)
Creates a character.
|
void |
accountLink(int force,
@NotNull java.lang.String login,
@NotNull java.lang.String password)
Links a character to the current account.
|
void |
accountLogin(@NotNull java.lang.String login,
@NotNull java.lang.String password)
Login to an account.
|
void |
accountPassword(@NotNull java.lang.String currentPassword,
@NotNull java.lang.String newPassword)
Change the account password.
|
void |
accountPlayCharacter(@NotNull java.lang.String name)
Plays a character from the current account.
|
void |
activateCommandInput(@NotNull java.lang.String newText)
Activates the command input text field.
|
void |
closeDialog(@NotNull java.lang.String dialog)
Closes a dialog.
|
boolean |
createKeyBinding(boolean perCharacter,
@NotNull CommandList commandList)
Adds a key binding.
|
@NotNull CommandList |
getCommandList(@NotNull java.lang.String args)
Returns a command list.
|
@NotNull java.util.Collection<java.lang.String> |
getCommandListNames()
Returns all command list names.
|
void |
init(@NotNull GuiManager guiManager)
Deprecated.
|
void |
openDialog(@NotNull java.lang.String dialog)
Opens a dialog.
|
void |
quitApplication()
Terminates the application.
|
boolean |
removeKeyBinding(boolean perCharacter)
Removes a key binding.
|
void |
toggleDialog(@NotNull java.lang.String dialog)
Toggles a dialog.
|
void |
updatePlayerName(@NotNull java.lang.String playerName)
Sets the current player name.
|
public GuiManagerCommandCallback(@NotNull @NotNull Exiter exiter, @NotNull @NotNull CrossfireServerConnection server)
exiter
- the exiter instanceserver
- the crossfire server connection for sending commands@Deprecated public void init(@NotNull @NotNull GuiManager guiManager)
guiManager
- the gui manager to forward topublic void quitApplication()
CommandCallback
quitApplication
in interface CommandCallback
public void openDialog(@NotNull @NotNull java.lang.String dialog)
CommandCallback
openDialog
in interface CommandCallback
dialog
- the dialog to openpublic void toggleDialog(@NotNull @NotNull java.lang.String dialog)
CommandCallback
toggleDialog
in interface CommandCallback
dialog
- the dialog to togglepublic void closeDialog(@NotNull @NotNull java.lang.String dialog)
CommandCallback
closeDialog
in interface CommandCallback
dialog
- the dialog to close@NotNull public @NotNull CommandList getCommandList(@NotNull @NotNull java.lang.String args) throws NoSuchCommandException
CommandCallback
getCommandList
in interface CommandCallback
args
- the name of the command listNoSuchCommandException
- if the command list does not exist@NotNull public @NotNull java.util.Collection<java.lang.String> getCommandListNames()
CommandCallback
getCommandListNames
in interface CommandCallback
public void updatePlayerName(@NotNull @NotNull java.lang.String playerName)
CommandCallback
updatePlayerName
in interface CommandCallback
playerName
- the player namepublic void activateCommandInput(@NotNull @NotNull java.lang.String newText)
CommandCallback
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.
activateCommandInput
in interface CommandCallback
newText
- the new command text if non-null
public boolean createKeyBinding(boolean perCharacter, @NotNull @NotNull CommandList commandList)
CommandCallback
createKeyBinding
in interface CommandCallback
perCharacter
- whether a per-character key binding should be addedcommandList
- the command list to execute on key presspublic boolean removeKeyBinding(boolean perCharacter)
CommandCallback
removeKeyBinding
in interface CommandCallback
perCharacter
- whether a per-character key binding should be
removedpublic void accountLogin(@NotNull @NotNull java.lang.String login, @NotNull @NotNull java.lang.String password)
CommandCallback
accountLogin
in interface CommandCallback
login
- loginpassword
- passwordpublic void accountCreate(@NotNull @NotNull java.lang.String login, @NotNull @NotNull java.lang.String password)
CommandCallback
accountCreate
in interface CommandCallback
login
- the account's namepassword
- the account's passwordpublic void accountPlayCharacter(@NotNull @NotNull java.lang.String name)
CommandCallback
accountPlayCharacter
in interface CommandCallback
name
- the character's namepublic void accountLink(int force, @NotNull @NotNull java.lang.String login, @NotNull @NotNull java.lang.String password)
CommandCallback
accountLink
in interface CommandCallback
force
- 0 to allow failure, 1 to force in certain situationslogin
- the character's namepassword
- the character's passwordpublic void accountCreateCharacter(@NotNull @NotNull java.lang.String login, @NotNull @NotNull java.util.Collection<java.lang.String> attributes)
CommandCallback
CommandCallback.accountLogin(java.lang.String, java.lang.String)
or CommandCallback.accountCreate(java.lang.String, java.lang.String)
.accountCreateCharacter
in interface CommandCallback
login
- the character's nameattributes
- the character attributespublic void accountPassword(@NotNull @NotNull java.lang.String currentPassword, @NotNull @NotNull java.lang.String newPassword)
CommandCallback
accountPassword
in interface CommandCallback
currentPassword
- the current account passwordnewPassword
- the new account password