Package mekhq.gui.dialog.nagDialogs
Class NoCommanderNagDialog
java.lang.Object
mekhq.gui.baseComponents.immersiveDialogs.ImmersiveDialogNag
mekhq.gui.dialog.nagDialogs.NoCommanderNagDialog
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 Summary
ConstructorsConstructorDescriptionNoCommanderNagDialog(Campaign campaign) Constructs a newNoCommanderNagDialoginstance to display the no commander nag dialog. -
Method Summary
Methods inherited from class mekhq.gui.baseComponents.immersiveDialogs.ImmersiveDialogNag
constructDialog, getInCharacterMessage, getOutOfCharacterMessage, getSpeaker, shouldCancelAdvanceDay
-
Constructor Details
-
NoCommanderNagDialog
Constructs a newNoCommanderNagDialoginstance to display the no commander nag dialog.This constructor initializes the dialog with preconfigured parameters, such as the
NAG_NO_COMMANDERconstant for managing dialog suppression, the"NoCommanderNagDialog"message key for localization, and theHRspeaker to deliver the dialog message.- Parameters:
campaign- TheCampaigninstance associated with this dialog. Provides access to campaign data and settings required for constructing the dialog.
-
-
Method Details
-
checkNag
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- ThePersondesignated as the flagged commander, ornullif no commander is assigned.- Returns:
trueif the nag dialog should be displayed due to the absence of a commander,falseotherwise.
-