Class ActionPhaseDisplay

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, BoardViewListener, KeyBindReceiver, GameListener, IPreferenceChangeListener, Distractable
Direct Known Subclasses:
AttackPhaseDisplay, MovementDisplay

public abstract class ActionPhaseDisplay extends StatusBarPhaseDisplay
See Also:
  • Field Details

    • butSkipTurn

      protected MegaMekButton butSkipTurn
    • currentEntity

      protected int currentEntity
      The currently selected unit for taking action. Not necessarily equal to the unit shown in the unit viewer.
    • clientgui

      protected final ClientGUI clientgui
    • game

      protected final Game game
  • Constructor Details

    • ActionPhaseDisplay

      protected ActionPhaseDisplay(ClientGUI cg)
  • Method Details

    • setupDonePanel

      protected UIUtil.FixedXPanel setupDonePanel()
      Overrides:
      setupDonePanel in class StatusBarPhaseDisplay
    • performDoneNoAction

      protected void performDoneNoAction()
    • shouldReceiveDoneKeyCommand

      public boolean shouldReceiveDoneKeyCommand()
    • preferenceChange

      public void preferenceChange(PreferenceChangeEvent e)
      Specified by:
      preferenceChange in interface IPreferenceChangeListener
      Overrides:
      preferenceChange in class StatusBarPhaseDisplay
    • initDonePanelForNewTurn

      protected void initDonePanelForNewTurn()
    • updateDonePanel

      protected abstract void updateDonePanel()
      called to reset, show, hide and relabel the Done panel buttons. Override to change button labels and states, being sure to call updateDonePanelButtons(String, String, boolean, List) to set the button labels and states
    • needNagForNoAction

      protected boolean needNagForNoAction()
      Returns:
      true if a nag dialog should be shown when there is no action given to current unit. This is true if user option wants a nag they have not preemptively checked @butIgnoreNag the turn timer is not expired
    • needNagForOverheat

      protected boolean needNagForOverheat()
    • needNagForNoUnJamRAC

      protected boolean needNagForNoUnJamRAC()
    • needNagForMASC

      protected boolean needNagForMASC()
    • needNagForPSR

      protected boolean needNagForPSR()
    • needNagForMechanicalJumpFallDamage

      protected boolean needNagForMechanicalJumpFallDamage()
    • needNagForCrushingBuildings

      protected boolean needNagForCrushingBuildings()
    • needNagForWiGELanding

      protected boolean needNagForWiGELanding()
    • needNagForLaunchDoors

      protected boolean needNagForLaunchDoors()
    • needNagForSprint

      protected boolean needNagForSprint()
    • needNagForOther

      protected boolean needNagForOther()
    • checkNagForNoAction

      protected boolean checkNagForNoAction(String title, String body)
    • checkNagForNoUnJamRAC

      protected boolean checkNagForNoUnJamRAC(String title, String body)
    • checkNagForMASC

      protected boolean checkNagForMASC(String title, String body)
    • checkNagForSprint

      protected boolean checkNagForSprint(String title, String body)
    • checkNagForPSR

      protected boolean checkNagForPSR(String title, String body)
    • checkNagForMechanicalJumpFallDamage

      protected boolean checkNagForMechanicalJumpFallDamage(String title, String body)
    • checkNagForCrushingBuildings

      protected boolean checkNagForCrushingBuildings(String title, String body)
    • checkNagForWiGELanding

      protected boolean checkNagForWiGELanding(String title, String body)
    • checkNagForOverheat

      protected boolean checkNagForOverheat(String title, String body)
    • checkNagLaunchDoors

      protected boolean checkNagLaunchDoors(String title, String body)
    • updateDonePanelButtons

      protected void updateDonePanelButtons(String doneButtonLabel, String skipButtonLabel, boolean isDoingAction, @Nullable List<String> turnDetails)
      set labels and enables on the done and skip buttons depending on the GUIP getNagForNoAction option
      Parameters:
      isDoingAction - true if user has entered actions for this turn, false if not.
    • currentEntity

      public final Entity currentEntity()
      Returns:
      The currently selected entity, if any, or null. A null check is **always** required, as displays are active when it's not the player's turn and when the setting to not auto-select a unit for the player is active, no unit may be selected even in a player's turn. Note that this is not necessarily equal to the currently *viewed* unit in the unit display.
      See Also:
    • clearMovementSprites

      protected void clearMovementSprites()
    • clearMarkedHexes

      protected void clearMarkedHexes()
    • removeAllListeners

      public void removeAllListeners()
      Description copied from interface: Distractable
      Stop just ignoring events and actually stop listening to them.
    • getCurrentEntity

      public int getCurrentEntity()