Class GuiManagerCommandCallback
- java.lang.Object
-
- com.realtime.crossfire.jxclient.main.GuiManagerCommandCallback
-
- All Implemented Interfaces:
CommandCallback
public class GuiManagerCommandCallback extends java.lang.Object implements CommandCallback
ACommandCallbackthat delegates to aGuiManager.
-
-
Constructor Summary
Constructors Constructor Description GuiManagerCommandCallback(@NotNull Exiter exiter, @NotNull CrossfireServerConnection server)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccountCreate(@NotNull java.lang.String login, @NotNull java.lang.String password)Creates an account.voidaccountCreateCharacter(@NotNull java.lang.String login, @NotNull java.util.Collection<java.lang.String> attributes)Creates a character.voidaccountLink(int force, @NotNull java.lang.String login, @NotNull java.lang.String password)Links a character to the current account.voidaccountLogin(@NotNull java.lang.String login, @NotNull java.lang.String password)Login to an account.voidaccountPassword(@NotNull java.lang.String currentPassword, @NotNull java.lang.String newPassword)Change the account password.voidaccountPlayCharacter(@NotNull java.lang.String name)Plays a character from the current account.voidactivateCommandInput(@NotNull java.lang.String newText)Activates the command input text field.voidcloseDialog(@NotNull java.lang.String dialog)Closes a dialog.booleancreateKeyBinding(boolean perCharacter, @NotNull CommandList commandList)Adds a key binding.@NotNull CommandListgetCommandList(@NotNull java.lang.String args)Returns a command list.voidinit(@NotNull GuiManager guiManager)Deprecated.voidopenDialog(@NotNull java.lang.String dialog)Opens a dialog.voidquitApplication()Terminates the application.booleanremoveKeyBinding(boolean perCharacter)Removes a key binding.voidtoggleDialog(@NotNull java.lang.String dialog)Toggles a dialog.voidupdatePlayerName(@NotNull java.lang.String playerName)Sets the current player name.
-
-
-
Constructor Detail
-
GuiManagerCommandCallback
public GuiManagerCommandCallback(@NotNull @NotNull Exiter exiter, @NotNull @NotNull CrossfireServerConnection server)Creates a new instance.- Parameters:
exiter- the exiter instanceserver- the crossfire server connection for sending commands
-
-
Method Detail
-
init
@Deprecated public void init(@NotNull @NotNull GuiManager guiManager)Deprecated.Creates a new instance.- Parameters:
guiManager- the gui manager to forward to
-
quitApplication
public void quitApplication()
Description copied from interface:CommandCallbackTerminates the application.- Specified by:
quitApplicationin interfaceCommandCallback
-
openDialog
public void openDialog(@NotNull @NotNull java.lang.String dialog)Description copied from interface:CommandCallbackOpens a dialog. Does nothing if the dialog is open.- Specified by:
openDialogin interfaceCommandCallback- Parameters:
dialog- the dialog to open
-
toggleDialog
public void toggleDialog(@NotNull @NotNull java.lang.String dialog)Description copied from interface:CommandCallbackToggles a dialog.- Specified by:
toggleDialogin interfaceCommandCallback- Parameters:
dialog- the dialog to toggle
-
closeDialog
public void closeDialog(@NotNull @NotNull java.lang.String dialog)Description copied from interface:CommandCallbackCloses a dialog. Does nothing if the dialog is not open.- Specified by:
closeDialogin interfaceCommandCallback- Parameters:
dialog- the dialog to close
-
getCommandList
@NotNull public @NotNull CommandList getCommandList(@NotNull @NotNull java.lang.String args) throws NoSuchCommandException
Description copied from interface:CommandCallbackReturns a command list.- Specified by:
getCommandListin interfaceCommandCallback- Parameters:
args- the command list arguments- Returns:
- the command list
- Throws:
NoSuchCommandException- if the command list does not exist
-
updatePlayerName
public void updatePlayerName(@NotNull @NotNull java.lang.String playerName)Description copied from interface:CommandCallbackSets the current player name. Does nothing if not currently in the character name prompt.- Specified by:
updatePlayerNamein interfaceCommandCallback- Parameters:
playerName- the player name
-
activateCommandInput
public void activateCommandInput(@NotNull @NotNull java.lang.String newText)Description copied from interface:CommandCallbackActivates 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.
- Specified by:
activateCommandInputin interfaceCommandCallback- Parameters:
newText- the new command text if non-null
-
createKeyBinding
public boolean createKeyBinding(boolean perCharacter, @NotNull @NotNull CommandList commandList)Description copied from interface:CommandCallbackAdds a key binding.- Specified by:
createKeyBindingin interfaceCommandCallback- 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
public boolean removeKeyBinding(boolean perCharacter)
Description copied from interface:CommandCallbackRemoves a key binding.- Specified by:
removeKeyBindingin interfaceCommandCallback- Parameters:
perCharacter- whether a per-character key binding should be removed- Returns:
- whether the key bindings dialog should be opened
-
accountLogin
public void accountLogin(@NotNull @NotNull java.lang.String login, @NotNull @NotNull java.lang.String password)Description copied from interface:CommandCallbackLogin to an account.- Specified by:
accountLoginin interfaceCommandCallback- Parameters:
login- loginpassword- password
-
accountCreate
public void accountCreate(@NotNull @NotNull java.lang.String login, @NotNull @NotNull java.lang.String password)Description copied from interface:CommandCallbackCreates an account.- Specified by:
accountCreatein interfaceCommandCallback- Parameters:
login- the account's namepassword- the account's password
-
accountPlayCharacter
public void accountPlayCharacter(@NotNull @NotNull java.lang.String name)Description copied from interface:CommandCallbackPlays a character from the current account.- Specified by:
accountPlayCharacterin interfaceCommandCallback- Parameters:
name- the character's name
-
accountLink
public void accountLink(int force, @NotNull @NotNull java.lang.String login, @NotNull @NotNull java.lang.String password)Description copied from interface:CommandCallbackLinks a character to the current account.- Specified by:
accountLinkin interfaceCommandCallback- Parameters:
force- 0 to allow failure, 1 to force in certain situationslogin- the character's namepassword- the character's password
-
accountCreateCharacter
public void accountCreateCharacter(@NotNull @NotNull java.lang.String login, @NotNull @NotNull java.util.Collection<java.lang.String> attributes)Description copied from interface:CommandCallbackCreates a character. The password should be the last fromCommandCallback.accountLogin(java.lang.String, java.lang.String)orCommandCallback.accountCreate(java.lang.String, java.lang.String).- Specified by:
accountCreateCharacterin interfaceCommandCallback- Parameters:
login- the character's nameattributes- the character attributes
-
accountPassword
public void accountPassword(@NotNull @NotNull java.lang.String currentPassword, @NotNull @NotNull java.lang.String newPassword)Description copied from interface:CommandCallbackChange the account password.- Specified by:
accountPasswordin interfaceCommandCallback- Parameters:
currentPassword- the current account passwordnewPassword- the new account password
-
-