Class AutomaticEjectionDialog

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
megamek.client.ui.dialogs.phaseDisplay.AutomaticEjectionDialog
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class AutomaticEjectionDialog extends JDialog implements ActionListener
Warns that the conditions will kill any crew that ejects, and lets the player switch automatic ejection off unit by unit before deploying.

The setting is otherwise reachable only from the lobby's unit configuration, which cannot be opened once play has begun. Without this the warning would be telling a player about a problem they had no way left to fix.

See Also:
  • Constructor Details

    • AutomaticEjectionDialog

      public AutomaticEjectionDialog(JFrame parent, ClientGUI clientGUI, List<Entity> unitsWithEjectionSystems, String lethalCondition)
      Parameters:
      parent - the frame to centre the dialog on
      clientGUI - the client that any changes are sent through
      unitsWithEjectionSystems - the player's units that have an ejection system, whether it is on or off
      lethalCondition - what it is out there that would kill an ejecting crew, phrased to open a sentence
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Specified by:
      actionPerformed in interface ActionListener
    • isDeploymentCancelled

      public boolean isDeploymentCancelled()
      Returns:
      true if the player backed out rather than deploying