Class GuiManagerCommandCallback

java.lang.Object
com.realtime.crossfire.jxclient.main.GuiManagerCommandCallback
All Implemented Interfaces:
CommandCallback

public class GuiManagerCommandCallback extends Object implements CommandCallback
A CommandCallback that delegates to a GuiManager.
  • Constructor Details

    • GuiManagerCommandCallback

      public GuiManagerCommandCallback(@NotNull @NotNull Exiter exiter, @NotNull @NotNull CrossfireServerConnection server)
      Creates a new instance.
      Parameters:
      exiter - the exiter instance
      server - the crossfire server connection for sending commands
  • Method Details

    • 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: CommandCallback
      Terminates the application.
      Specified by:
      quitApplication in interface CommandCallback
    • openDialog

      public void openDialog(@NotNull @NotNull String dialog)
      Description copied from interface: CommandCallback
      Opens a dialog. Does nothing if the dialog is open.
      Specified by:
      openDialog in interface CommandCallback
      Parameters:
      dialog - the dialog to open
    • toggleDialog

      public void toggleDialog(@NotNull @NotNull String dialog)
      Description copied from interface: CommandCallback
      Toggles a dialog.
      Specified by:
      toggleDialog in interface CommandCallback
      Parameters:
      dialog - the dialog to toggle
    • closeDialog

      public void closeDialog(@NotNull @NotNull String dialog)
      Description copied from interface: CommandCallback
      Closes a dialog. Does nothing if the dialog is not open.
      Specified by:
      closeDialog in interface CommandCallback
      Parameters:
      dialog - the dialog to close
    • getCommandList

      @NotNull public @NotNull CommandList getCommandList(@NotNull @NotNull String args) throws NoSuchCommandException
      Description copied from interface: CommandCallback
      Returns a command list.
      Specified by:
      getCommandList in interface CommandCallback
      Parameters:
      args - the name of the command list
      Returns:
      the command list
      Throws:
      NoSuchCommandException - if the command list does not exist
    • getCommandListNames

      @NotNull public @NotNull Collection<String> getCommandListNames()
      Description copied from interface: CommandCallback
      Returns all command list names.
      Specified by:
      getCommandListNames in interface CommandCallback
      Returns:
      the names in alphabetical order
    • updatePlayerName

      public void updatePlayerName(@NotNull @NotNull String playerName)
      Description copied from interface: CommandCallback
      Sets the current player name. Does nothing if not currently in the character name prompt.
      Specified by:
      updatePlayerName in interface CommandCallback
      Parameters:
      playerName - the player name
    • activateCommandInput

      public void activateCommandInput(@NotNull @NotNull String newText)
      Description copied from interface: CommandCallback
      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.

      Specified by:
      activateCommandInput in interface CommandCallback
      Parameters:
      newText - the new command text if non-null
    • createKeyBinding

      public boolean createKeyBinding(boolean perCharacter, @NotNull @NotNull CommandList commandList)
      Description copied from interface: CommandCallback
      Adds a key binding.
      Specified by:
      createKeyBinding in interface CommandCallback
      Parameters:
      perCharacter - whether a per-character key binding should be added
      commandList - 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: CommandCallback
      Removes a key binding.
      Specified by:
      removeKeyBinding in interface CommandCallback
      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 String login, @NotNull @NotNull String password)
      Description copied from interface: CommandCallback
      Login to an account.
      Specified by:
      accountLogin in interface CommandCallback
      Parameters:
      login - login
      password - password
    • accountCreate

      public void accountCreate(@NotNull @NotNull String login, @NotNull @NotNull String password)
      Description copied from interface: CommandCallback
      Creates an account.
      Specified by:
      accountCreate in interface CommandCallback
      Parameters:
      login - the account's name
      password - the account's password
    • accountPlayCharacter

      public void accountPlayCharacter(@NotNull @NotNull String name)
      Description copied from interface: CommandCallback
      Plays a character from the current account.
      Specified by:
      accountPlayCharacter in interface CommandCallback
      Parameters:
      name - the character's name
    • accountLink

      public void accountLink(int force, @NotNull @NotNull String login, @NotNull @NotNull String password)
      Description copied from interface: CommandCallback
      Links a character to the current account.
      Specified by:
      accountLink in interface CommandCallback
      Parameters:
      force - 0 to allow failure, 1 to force in certain situations
      login - the character's name
      password - the character's password
    • accountCreateCharacter

      public void accountCreateCharacter(@NotNull @NotNull String login, @NotNull @NotNull Collection<String> attributes)
      Description copied from interface: CommandCallback
      Specified by:
      accountCreateCharacter in interface CommandCallback
      Parameters:
      login - the character's name
      attributes - the character attributes
    • accountPassword

      public void accountPassword(@NotNull @NotNull String currentPassword, @NotNull @NotNull String newPassword)
      Description copied from interface: CommandCallback
      Change the account password.
      Specified by:
      accountPassword in interface CommandCallback
      Parameters:
      currentPassword - the current account password
      newPassword - the new account password