Interface CommandCallback

  • All Known Implementing Classes:
    GuiManagerCommandCallback

    public interface CommandCallback
    Interface that defines callback functions needed by commands.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method 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.
      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.
    • Method Detail

      • quitApplication

        void quitApplication()
        Terminates the application.
      • openDialog

        void openDialog​(@NotNull
                        @NotNull java.lang.String dialog)
        Opens a dialog. Does nothing if the dialog is open.
        Parameters:
        dialog - the dialog to open
      • toggleDialog

        void toggleDialog​(@NotNull
                          @NotNull java.lang.String dialog)
        Toggles a dialog.
        Parameters:
        dialog - the dialog to toggle
      • closeDialog

        void closeDialog​(@NotNull
                         @NotNull java.lang.String dialog)
        Closes a dialog. Does nothing if the dialog is not open.
        Parameters:
        dialog - the dialog to close
      • getCommandList

        @NotNull
        @NotNull CommandList getCommandList​(@NotNull
                                            @NotNull java.lang.String args)
                                     throws NoSuchCommandException
        Returns a command list.
        Parameters:
        args - the command list arguments
        Returns:
        the command list
        Throws:
        NoSuchCommandException - if the command list does not exist
      • updatePlayerName

        void updatePlayerName​(@NotNull
                              @NotNull java.lang.String playerName)
        Sets the current player name. Does nothing if not currently in the character name prompt.
        Parameters:
        playerName - the player name
      • activateCommandInput

        void activateCommandInput​(@NotNull
                                  @NotNull java.lang.String newText)
        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

        boolean createKeyBinding​(boolean perCharacter,
                                 @NotNull
                                 @NotNull CommandList commandList)
        Adds a key binding.
        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

        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

        void accountLogin​(@NotNull
                          @NotNull java.lang.String login,
                          @NotNull
                          @NotNull java.lang.String password)
        Login to an account.
        Parameters:
        login - login
        password - password
      • accountCreate

        void accountCreate​(@NotNull
                           @NotNull java.lang.String login,
                           @NotNull
                           @NotNull java.lang.String password)
        Creates an account.
        Parameters:
        login - the account's name
        password - the account's password
      • accountPlayCharacter

        void accountPlayCharacter​(@NotNull
                                  @NotNull java.lang.String name)
        Plays a character from the current account.
        Parameters:
        name - the character's name
      • accountLink

        void accountLink​(int force,
                         @NotNull
                         @NotNull java.lang.String login,
                         @NotNull
                         @NotNull java.lang.String password)
        Links a character to the current account.
        Parameters:
        force - 0 to allow failure, 1 to force in certain situations
        login - the character's name
        password - the character's password
      • accountPassword

        void accountPassword​(@NotNull
                             @NotNull java.lang.String currentPassword,
                             @NotNull
                             @NotNull java.lang.String newPassword)
        Change the account password.
        Parameters:
        currentPassword - the current account password
        newPassword - the new account password