Class ContractEditorDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ContractEditorDialog extends JDialog
A GM-only editor for a single AbstractContract, drawn as a heads-up display in the style of the contract market. It surfaces essentially every field a game master would want to hand-tune - identity, objectives, target, schedule, size, employer and enemy make-up (including camouflage and force colour), intel the player is shown, terms, pay, rented facilities, morale, characteristics and the generated NPCs - so an offer can be reshaped to their specifications. Faction and system fields are pickers rather than free text to prevent typos.

The form is split across six tabs, chosen from the selector in the command bar as the Oracle Console's pages are, with a preview on the right of how the offer will read on the board and in the dossier. Each tab has a guide that slides over the window, opened by the guide button or by itself the first time the tab is visited. Each row that differs from the contract as it was opened is marked, each tab counts its changes, and Revert puts every field back.

The generated NPC personnel attached to a contract (the employer's negotiator and liaison, and the opposing commander) can have their name, rank, and portrait edited. On confirmation the contract is mutated in place; query wasConfirmed() afterward and rebuild any view showing it. The player's chosen negotiator is preserved as-is. The StratCon campaign state is not edited here, but when its contract's scale, track count, or dates change, its pre-rolled schedule is rolled again to match (see StratConScenarioTempo.regenerateSchedules(mekhq.campaign.Campaign, mekhq.campaign.mission.contract.AbstractContract, mekhq.campaign.digitalGM.stratCon.StratConCampaignState)).

Since:
0.51.01
See Also:
  • Constructor Details

    • ContractEditorDialog

      public ContractEditorDialog(Campaign campaign, AbstractContract contract)
      Opens the modal GM editor for an existing offer. On confirmation the contract's fields are updated in place; query wasConfirmed() afterward.
      Parameters:
      campaign - the active campaign
      contract - the offer to edit
      Since:
      0.51.01
    • ContractEditorDialog

      public ContractEditorDialog(Campaign campaign, AbstractContract contract, @Nullable ContractSearchType createBucket)
      Opens the modal GM editor. Passing a non-null createBucket puts the dialog in "create" mode: the title and header eyebrow change and a market-list picker (seeded to createBucket) is shown, letting the GM choose which ContractSearchType the new offer belongs to (read back via getSelectedSearchType()).

      In both modes the given contract is mutated in place; in create mode the caller is expected to build a blank contract (see NewContractFactory) and add it to the chosen bucket when wasConfirmed() is true.

      Parameters:
      campaign - the active campaign
      contract - the contract to edit (a blank one, for create mode)
      createBucket - the market bucket to seed the picker with, or null for edit mode
      Since:
      0.51.01
  • Method Details

    • getSelectedSearchType

      public ContractSearchType getSelectedSearchType()
      Returns:
      in create mode, the market bucket the GM selected for the new offer; in edit mode, null
      Since:
      0.51.01
    • wasConfirmed

      public boolean wasConfirmed()
      Returns:
      whether the GM confirmed their edits.