Skip to content

Commit

Permalink
Refactored CampaignOptionsDialog usage to remove "_new" class.
Browse files Browse the repository at this point in the history
Replaced references to CampaignOptionsDialog_new with CampaignOptionsDialog to streamline dialog handling. Adjusted constructor calls to include necessary parameters and updated visibility settings accordingly. Commented out obsolete code for improved clarity and maintainability.
  • Loading branch information
IllianiCBT committed Jan 12, 2025
1 parent 2cef151 commit f5f8372
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions MekHQ/src/mekhq/gui/CampaignGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
import mekhq.campaign.universe.NewsItem;
import mekhq.gui.dialog.*;
import mekhq.gui.dialog.CampaignExportWizard.CampaignExportWizardState;
import mekhq.gui.dialog.campaignOptions.CampaignOptionsDialog_new;
import mekhq.gui.dialog.reportDialogs.*;
import mekhq.gui.enums.MHQTabType;
import mekhq.gui.model.PartsTableModel;
Expand Down Expand Up @@ -1465,7 +1464,7 @@ private void menuOptionsActionPerformed(final ActionEvent evt) {
final RandomMarriageMethod randomMarriageMethod = oldOptions.getRandomMarriageMethod();
final RandomProcreationMethod randomProcreationMethod = oldOptions.getRandomProcreationMethod();

new CampaignOptionsDialog_new(getFrame(), getCampaign());
new CampaignOptionsDialog(getFrame(), getCampaign(), true);

final CampaignOptions newOptions = getCampaign().getCampaignOptions();

Expand Down
12 changes: 6 additions & 6 deletions MekHQ/src/mekhq/gui/dialog/DataLoadingDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import mekhq.campaign.universe.Systems;
import mekhq.campaign.universe.eras.Eras;
import mekhq.gui.baseComponents.AbstractMHQDialogBasic;
import mekhq.gui.dialog.campaignOptions.CampaignOptionsDialog_new;
import mekhq.gui.dialog.campaignOptions.SelectPresetDialog;

import javax.swing.*;
Expand Down Expand Up @@ -349,13 +348,14 @@ public Campaign doInBackground() throws Exception {
campaign.getGameOptions().getOption(OptionsConstants.ALLOWED_YEAR).setValue(campaign.getGameYear());
campaign.setStartingSystem((preset == null) ? null : preset.getPlanet());

CampaignOptionsDialog_new optionsDialog =
new CampaignOptionsDialog_new(getFrame(), campaign);
CampaignOptionsDialog optionsDialog =
new CampaignOptionsDialog(getFrame(), campaign, true);
optionsDialog.setVisible(true);
// optionsDialog.setLocationRelativeTo(null);
// optionsDialog.applyPreset(preset);
if (optionsDialog.wasCanceled()) {
return null;
}
// if (optionsDialog.wasCanceled()) {
// return null;
// }
}

// initialize reputation
Expand Down

0 comments on commit f5f8372

Please sign in to comment.