Class NoCommanderNagDialog

java.lang.Object
mekhq.gui.baseComponents.immersiveDialogs.ImmersiveDialogNag
mekhq.gui.dialog.nagDialogs.NoCommanderNagDialog

public class NoCommanderNagDialog extends ImmersiveDialogNag
A dialog class used to notify players that a commander is missing in their campaign.

The NoCommanderNagDialog extends ImmersiveDialogNag and provides a specialized dialog designed to alert players when no commander is assigned or present in the campaign. It uses predefined values, including the HR speaker and the NAG_NO_COMMANDER constant, to configure dialog settings and content.

  • Constructor Details

    • NoCommanderNagDialog

      public NoCommanderNagDialog(Campaign campaign)
      Constructs a new NoCommanderNagDialog instance to display the no commander nag dialog.

      This constructor initializes the dialog with preconfigured parameters, such as the NAG_NO_COMMANDER constant for managing dialog suppression, the "NoCommanderNagDialog" message key for localization, and the HR speaker to deliver the dialog message.

      Parameters:
      campaign - The Campaign instance associated with this dialog. Provides access to campaign data and settings required for constructing the dialog.
  • Method Details

    • checkNag

      public static boolean checkNag(@Nullable Person flaggedCommander)
      Determines whether a nag dialog should be displayed for the absence of a commander.

      This method checks two conditions to decide if the nag dialog should appear:

      • The user has not ignored the nag dialog for the absence of a commander in their options.
      • No flagged commander is assigned to the campaign.
      Parameters:
      flaggedCommander - The Person designated as the flagged commander, or null if no commander is assigned.
      Returns:
      true if the nag dialog should be displayed due to the absence of a commander, false otherwise.