Class TurnoverAndRetentionPages
java.lang.Object
mekhq.gui.campaignOptions.contents.TurnoverAndRetentionPages
The
TurnoverAndRetentionPages class represents a graphical user
interface (GUI) configuration page 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 Page: Controls unit turnover, payouts, and related modifiers.
- Fatigue Page: Manages fatigue-related options like kitchen capacity and fatigue rates.
-
Constructor Summary
ConstructorsConstructorDescriptionTurnoverAndRetentionPages(CampaignOptions campaignOptions) Constructs aTurnoverAndRetentionPagesand initializes the page 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" page with its relevant components.Creates and configures the "Turnover" page 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 pages.
-
Constructor Details
-
TurnoverAndRetentionPages
Constructs aTurnoverAndRetentionPagesand initializes the page 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 page.
-
-
Method Details
-
createFatiguePage
Creates and configures the "Fatigue" page 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 page.
-
createTurnoverPage
Creates and configures the "Turnover" page 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 page.
-
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 pages. 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.
-