Skip to content

Commit

Permalink
Merge pull request #5104 from IllianiCBT/presetPicker
Browse files Browse the repository at this point in the history
Fixed Preset Picker Date Issues
  • Loading branch information
HammerGS authored Oct 21, 2024
2 parents c331749 + 594b93f commit 500a75c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions MekHQ/src/mekhq/gui/dialog/DataLoadingDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,17 +320,24 @@ public Campaign doInBackground() throws Exception {
if ((preset != null) && (preset.getGameOptions() != null)) {
campaign.setGameOptions(preset.getGameOptions());
}
campaign.setLocalDate(dc.getDate());
campaign.getGameOptions().getOption(OptionsConstants.ALLOWED_YEAR).setValue(campaign.getGameYear());
campaign.setStartingSystem((preset == null) ? null : preset.getPlanet());

// This must be after the date chooser to enable correct functionality.
setVisible(false);

// Campaign Options
if (isSelect && preset != null) {
preset.applyContinuousToCampaign(campaign);

// This needs to be after we've applied the preset
campaign.setLocalDate(dc.getDate());
campaign.getGameOptions().getOption(OptionsConstants.ALLOWED_YEAR).setValue(campaign.getGameYear());
campaign.setStartingSystem(preset.getPlanet());
} else {
// This needs to be before we trigger the customize preset dialog
campaign.setLocalDate(dc.getDate());
campaign.getGameOptions().getOption(OptionsConstants.ALLOWED_YEAR).setValue(campaign.getGameYear());
campaign.setStartingSystem((preset == null) ? null : preset.getPlanet());

CampaignOptionsDialog optionsDialog = new CampaignOptionsDialog(dialog, getFrame(), campaign, true);
optionsDialog.setLocationRelativeTo(getFrame());
optionsDialog.applyPreset(preset);
Expand Down

0 comments on commit 500a75c

Please sign in to comment.