Class RepairAndMaintenanceTab
java.lang.Object
mekhq.gui.campaignOptions.contents.RepairAndMaintenanceTab
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 Summary
ConstructorsConstructorDescriptionRepairAndMaintenanceTab
(CampaignOptions campaignOptions) Constructs aRepairAndMaintenanceTab
instance for configuring repair and maintenance-related settings. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyCampaignOptionsToCampaign
(CampaignOptions presetCampaignOptions) Applies the current tab's repair and maintenance settings from the UI components to the providedCampaignOptions
.Creates the panel for the Maintenance Tab.Creates the panel for the Repair Tab.void
Loads the repair and maintenance settings from the defaultCampaignOptions
into the tab's UI components.void
loadValuesFromCampaignOptions
(CampaignOptions presetCampaignOptions) Loads the repair and maintenance settings from theCampaignOptions
object into the tab's UI components.
-
Constructor Details
-
RepairAndMaintenanceTab
Constructs aRepairAndMaintenanceTab
instance for configuring repair and maintenance-related settings.- Parameters:
campaignOptions
- theCampaignOptions
object to be used for managing repair and maintenance options.
-
-
Method Details
-
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
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
Applies the current tab's repair and maintenance settings from the UI components to the providedCampaignOptions
.If no custom
CampaignOptions
are provided, uses the defaultCampaignOptions
associated with this tab.- Parameters:
presetCampaignOptions
- optional customCampaignOptions
object to apply the current settings to. Ifnull
, the default options are modified.
-
loadValuesFromCampaignOptions
public void loadValuesFromCampaignOptions()Loads the repair and maintenance settings from the defaultCampaignOptions
into the tab's UI components. -
loadValuesFromCampaignOptions
Loads the repair and maintenance settings from theCampaignOptions
object into the tab's UI components.If no custom
CampaignOptions
are provided, the defaultCampaignOptions
associated with this tab is used.- Parameters:
presetCampaignOptions
- optional customCampaignOptions
object to load settings from. Ifnull
, the default options are used.
-