Class ContractSpecialMechanicsNagDialog
StratConContractMechanics).
The briefing is out-of-character and sets out the rules exactly: the contract type's own rules, followed by the shared Escalation rules if the contract escalates. As these briefings are the only tutorial the player gets for these mechanics, the text must be kept in step with the rules.
The player can acknowledge the briefing, or acknowledge it and suppress future briefings for that contract type
(see getNagKey(mekhq.campaign.mission.contract.contractData.ContractObjectiveType)). Each contract type is suppressed separately, since each has its own rules.
- Since:
- 0.51.01
-
Nested Class Summary
Nested classes/interfaces inherited from class mekhq.gui.baseComponents.immersiveDialogs.ImmersiveDialogNag
ImmersiveDialogNag.DialogChoice -
Field Summary
Fields inherited from class mekhq.gui.baseComponents.immersiveDialogs.ImmersiveDialogNag
cancelAdvanceDay -
Method Summary
Modifier and TypeMethodDescriptionprotected ImmersiveDialogCoreconstructDialog(Campaign campaign, String messageKey) Constructs anImmersiveDialogSimpleinstance for the nag dialog.protected List<ImmersiveDialogCore.ButtonLabelTooltipPair> There is nothing to cancel when accepting a contract, so the player can only acknowledge the briefing, or acknowledge it and suppress future briefings for this contract type.static List<ContractObjectiveType> static StringgetNagKey(ContractObjectiveType objectiveType) protected PersongetSpeaker(Campaign campaign) The briefing comes from the employer's liaison, falling back to the campaign's senior administrator.static booleanisBriefingDue(Campaign campaign, AbstractContract contract) Decides whether a newly accepted contract should be briefed on its special mechanics: the "Contracts Use Special Mechanics" option is on, the contract is run on a StratCon map (special mechanics are only set up there), its contract type has special mechanics, and the player has not suppressed the briefing for its contract type.protected voidprocessDialogChoice(int choiceIndex, String nagConstant) Handles the processing of a dialog choice based on the given index and updates related settings or state.static voidshowIfDue(Campaign campaign, AbstractContract contract) Shows the briefing for a newly accepted contract, if one is due (seeisBriefingDue(mekhq.campaign.Campaign, mekhq.campaign.mission.contract.AbstractContract)).Methods inherited from class mekhq.gui.baseComponents.immersiveDialogs.ImmersiveDialogNag
getInCharacterMessage, getOutOfCharacterMessage, getResourceBundle, shouldCancelAdvanceDay
-
Method Details
-
showIfDue
Shows the briefing for a newly accepted contract, if one is due (seeisBriefingDue(mekhq.campaign.Campaign, mekhq.campaign.mission.contract.AbstractContract)).- Parameters:
campaign- the current campaigncontract- the contract just accepted, with its StratCon state already set up- Since:
- 0.51.01
-
isBriefingDue
Decides whether a newly accepted contract should be briefed on its special mechanics: the "Contracts Use Special Mechanics" option is on, the contract is run on a StratCon map (special mechanics are only set up there), its contract type has special mechanics, and the player has not suppressed the briefing for its contract type.- Parameters:
campaign- the current campaigncontract- the contract just accepted- Returns:
trueif the briefing should be shown- Since:
- 0.51.01
-
getNagKey
- Parameters:
objectiveType- a contract type with special mechanics- Returns:
- the key under which the player's choice to suppress that contract type's briefing is stored
- Since:
- 0.51.01
-
getBriefedContractTypes
- Returns:
- every contract type that has special mechanics, and so a briefing of its own, in declaration order
- Since:
- 0.51.01
-
constructDialog
Description copied from class:ImmersiveDialogNagConstructs anImmersiveDialogSimpleinstance for the nag dialog.This method creates an immersive dialog, setting the speaker based on the provided
specialization, and populates it with in-character and out-of-character messages along with dialog button labels.- Overrides:
constructDialogin classImmersiveDialogNag- Parameters:
campaign- TheCampaigninstance to associate with the dialog. Used to fetch relevant campaign data, such as the commander's address.messageKey- AStringkey used to retrieve localized text for the dialog's in-character and out-of-character messages.- Returns:
- The constructed
ImmersiveDialogSimpleinstance containing the specified speaker, messages, and button labels.
-
getSpeaker
The briefing comes from the employer's liaison, falling back to the campaign's senior administrator.- Overrides:
getSpeakerin classImmersiveDialogNag- Parameters:
campaign- The campaign context.- Returns:
- The
Personassigned as the speaker. This will either be the person matching the given specialization or, if unavailable, the one assigned to the"COMMAND"specialization. - Since:
- 0.51.01
-
createButtons
There is nothing to cancel when accepting a contract, so the player can only acknowledge the briefing, or acknowledge it and suppress future briefings for this contract type.- Overrides:
createButtonsin classImmersiveDialogNag- Returns:
- A list of button-label and tooltip pairs for this dialog.
- Since:
- 0.51.01
-
processDialogChoice
Description copied from class:ImmersiveDialogNagHandles the processing of a dialog choice based on the given index and updates related settings or state.This method performs different actions depending on the value of the
choiceIndex:- If
CHOICE_CANCELis selected, it sets the operation to cancel advancing the day. - If
CHOICE_CONTINUEis selected, it allows advancing the day. - If
CHOICE_SUPPRESSis selected, it suppresses future dialog prompts associated with the given nag constant and allows advancing the day. - Throws an exception if the
choiceIndexdoes not match any expected value.
- Overrides:
processDialogChoicein classImmersiveDialogNag- Parameters:
choiceIndex- Anintrepresenting the user's dialog choice. Must match one of the predefined constants (e.g.,CHOICE_CANCEL,CHOICE_CONTINUE, orCHOICE_SUPPRESS).nagConstant- AStringidentifying the nag constant associated with the dialog choice. Used to manage whether future prompts with this constant should be suppressed.
- If
-