Class TurnoverAndRetentionTab
java.lang.Object
mekhq.gui.campaignOptions.contents.TurnoverAndRetentionTab
The
TurnoverAndRetentionTab class represents a graphical user interface (GUI) configuration tab in the
campaign options for managing unit turnover, retention, and fatigue settings.
This class provides functionality to define and customize gameplay-related options such as:
- Unit turnover settings, including retirement, contract durations, payouts, and modifiers.
- HR strain and management skills impacting unit cohesion.
- Fatigue mechanics such as fatigue rates, leave thresholds, and injury fatigue.
The class interacts with a CampaignOptions object, allowing the user to load and save
configurations. It consists of two main panels:
- Turnover Tab: Controls unit turnover, payouts, and related modifiers.
- Fatigue Tab: Manages fatigue-related options like kitchen capacity and fatigue rates.
-
Constructor Summary
ConstructorsConstructorDescriptionTurnoverAndRetentionTab(CampaignOptions campaignOptions) Constructs aTurnoverAndRetentionTaband initializes the tab with the givenCampaignOptions. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyCampaignOptionsToCampaign(CampaignOptions presetCampaignOptions) Applies the current campaign options based on the configurations in the UI to the givenCampaignOptions.Creates and configures the "Fatigue" tab with its relevant components.Creates and configures the "Turnover" tab with its relevant components.voidOverload ofloadValuesFromCampaignOptionsmethod.voidloadValuesFromCampaignOptions(CampaignOptions presetCampaignOptions) Loads the current configuration values from the providedCampaignOptionsobject and updates the associated UI components in both the Turnover and Fatigue tabs.
-
Constructor Details
-
TurnoverAndRetentionTab
Constructs aTurnoverAndRetentionTaband initializes the tab with the givenCampaignOptions. This sets up necessary UI components and their default configurations.- Parameters:
campaignOptions- theCampaignOptionsinstance that holds the settings to be modified or displayed in this tab.
-
-
Method Details
-
createFatigueTab
Creates and configures the "Fatigue" tab with its relevant components. These include options related to enabling fatigue, fatigue rates, injury fatigue, kitchen capacities, and leave thresholds.- Returns:
- the
JPanelrepresenting the constructed Fatigue tab.
-
createTurnoverTab
Creates and configures the "Turnover" tab with its relevant components. These include options for turnover control, random retirement, payout settings, and modifiers for HR Strain and cohesion.- Returns:
- the
JPanelrepresenting the constructed Turnover tab.
-
loadValuesFromCampaignOptions
public void loadValuesFromCampaignOptions()Overload ofloadValuesFromCampaignOptionsmethod. Loads values from the currentCampaignOptionsinstance. -
loadValuesFromCampaignOptions
Loads the current configuration values from the providedCampaignOptionsobject and updates the associated UI components in both the Turnover and Fatigue tabs. If no options are provided, the existing campaign options are used.- Parameters:
presetCampaignOptions- theCampaignOptionsinstance to load settings from, ornullto use the current campaign options.
-
applyCampaignOptionsToCampaign
Applies the current campaign options based on the configurations in the UI to the givenCampaignOptions. If no options are provided, the current campaign options are updated.- Parameters:
presetCampaignOptions- theCampaignOptionsinstance to save settings to, ornullto update the current campaign options.
-