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