Class RepairAndMaintenanceTab

java.lang.Object
mekhq.gui.campaignOptions.contents.RepairAndMaintenanceTab

public class RepairAndMaintenanceTab extends Object
Represents a tab in the campaign options UI used to configure settings related to repair and maintenance in a campaign.

This tab is divided into two sections:

  • Repair Tab: Manages options for era modifications, tech assignments, equipment quirks handling, destruction margins, and more.
  • Maintenance Tab: Handles maintenance settings such as cycle frequency, quality standards, planetary modifiers, and unofficial maintenance rules.

The class interacts with CampaignOptions, enabling the retrieval, storage, and application of repair and maintenance configuration settings.

  • Constructor Details

    • RepairAndMaintenanceTab

      public RepairAndMaintenanceTab(CampaignOptions campaignOptions)
      Constructs a RepairAndMaintenanceTab instance for configuring repair and maintenance-related settings.
      Parameters:
      campaignOptions - the CampaignOptions object to be used for managing repair and maintenance options.
  • Method Details

    • createRepairTab

      public JPanel createRepairTab()
      Creates the panel for the Repair Tab.

      This tab provides configurable options for managing repair rules, handling quirks, setting margins for equipment survival, and incorporating era modifications.

      Returns:
      a JPanel representing the Repair Tab.
    • createMaintenanceTab

      public JPanel createMaintenanceTab()
      Creates the panel for the Maintenance Tab.

      This tab provides configurable options for managing maintenance cycles, quality standards, planetary effects, and custom rules for units' upkeep.

      Returns:
      a JPanel representing the Maintenance Tab.
    • applyCampaignOptionsToCampaign

      public void applyCampaignOptionsToCampaign(@Nullable CampaignOptions presetCampaignOptions)
      Applies the current tab's repair and maintenance settings from the UI components to the provided CampaignOptions.

      If no custom CampaignOptions are provided, uses the default CampaignOptions associated with this tab.

      Parameters:
      presetCampaignOptions - optional custom CampaignOptions object to apply the current settings to. If null, the default options are modified.
    • loadValuesFromCampaignOptions

      public void loadValuesFromCampaignOptions()
      Loads the repair and maintenance settings from the default CampaignOptions into the tab's UI components.
    • loadValuesFromCampaignOptions

      public void loadValuesFromCampaignOptions(@Nullable CampaignOptions presetCampaignOptions)
      Loads the repair and maintenance settings from the CampaignOptions object into the tab's UI components.

      If no custom CampaignOptions are provided, the default CampaignOptions associated with this tab is used.

      Parameters:
      presetCampaignOptions - optional custom CampaignOptions object to load settings from. If null, the default options are used.