Class BotCommandsPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class BotCommandsPanel extends JPanel
The Bot Commands Panel contains a small set of buttons which allow the player to change the configuration of any bot they have control over during game play. It also allows for some orders to be given to the bots, like telling them to ignore a target, change priority over another.
See Also:
  • Constructor Details

    • BotCommandsPanel

      public BotCommandsPanel(AbstractClient client, @Nullable AudioService audioService, @Nullable MegaMekController controller)
      Bot Commands Panel constructor.
      Parameters:
      client - reference to the client instance
      audioService - reference to the instance of the AudioService
      controller - reference to the MegaMekController for key binds, or null when key binds are not used
    • BotCommandsPanel

      public BotCommandsPanel(AbstractClient client, @Nullable AudioService audioService, @Nullable MegaMekController controller, @Nullable ClientGUI clientGUI)
      Bot Commands Panel constructor.
      Parameters:
      client - reference to the client instance
      audioService - reference to the instance of the AudioService
      controller - reference to the MegaMekController for key binds, or null when key binds are not used
      clientGUI - reference to the ClientGUI for toast notifications, or null when toasts are unavailable
  • Method Details

    • setDockedLayout

      public void setDockedLayout(boolean docked)
      Switches the panel between its floating and docked layouts. The floating layout keeps the original two-row grid and size; the docked layout uses a single row sized for the thin strip above the board. Only the arrangement and size hints change - the same buttons and their actions are preserved in both modes.
      Parameters:
      docked - true to use the single-row docked layout, false to use the floating two-row layout
    • useSpaceForPauseUnpause

      public void useSpaceForPauseUnpause()
      Registers the space key to pause and unpause the game.
    • setMiscButton

      public void setMiscButton(String miscButtonText, String miscButtonTooltip, ActionListener miscButtonActionListener)
      Allows for a customizable button, with a title, tooltip, and action listener. It can do whatever you need it to do, so you can have it in different GUIs and environments.
      Parameters:
      miscButtonText - localized text of the button
      miscButtonTooltip - localized tooltip text of the button
      miscButtonActionListener - action listener for the button
    • setMiscButtonAsRequestVictory

      public void setMiscButtonAsRequestVictory()
      Sets the misc button to send a chat command to request victory.
    • clearMiscButton

      public void clearMiscButton()
      Clears the misc button, removing any text, tooltip, and action listener and disabling it.