Class SBFActionPhaseDisplay

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

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

    • currentFormation

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

      protected MegaMekButton butSkipTurn
    • clientgui

      protected final SBFClientGUI clientgui
    • controller

      protected final MegaMekController controller
  • Constructor Details

    • SBFActionPhaseDisplay

      protected SBFActionPhaseDisplay(SBFClientGUI cg)
  • Method Details

    • setupDonePanel

      protected UIUtil.FixedXPanel setupDonePanel()
      Overrides:
      setupDonePanel in class StatusBarPhaseDisplay
    • 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, java.util.List) to set the button labels and states
    • 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:
      doneButtonLabel -
      skipButtonLabel -
      isDoingAction - true if user has entered actions for this turn, false if not.
    • actingFormation

      protected final Optional<SBFFormation> actingFormation()
      Returns the formation that is currently selected for action (movement/firing etc), if any, as an optional. Note that this can be empty in many cases. E.g., displays are active when it's not the player's turn. 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 unit *viewed* in the unit display.
      Returns:
      The currently acting formation, if any