Skip to content

Commit 0dcda62

Browse files
committed
+ Bug: GameOptionsDialog does not match MegaMek's GameOptionsDialog
This bug was caused by duplicating G.O.D. rather than just implementing MM's version of it. I added the one minor thing the MM version needed added to support MHQ and other external programs, and then switched to using it. I also removed the MHQ included version to avoid mistakes in the future.
1 parent 813a332 commit 0dcda62

File tree

4 files changed

+25
-547
lines changed

4 files changed

+25
-547
lines changed

MekHQ/.classpath

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<classpathentry kind="lib" path="lib/Ostermiller.jar"/>
2727
<classpathentry kind="lib" path="lib/TabPanel.jar"/>
2828
<classpathentry kind="lib" path="lib/vecmath.jar"/>
29-
<classpathentry kind="lib" path="MegaMek.jar"/>
30-
<classpathentry kind="lib" path="MegaMekLab.jar"/>
29+
<classpathentry combineaccessrules="false" kind="src" path="/MegaMek"/>
30+
<classpathentry combineaccessrules="false" kind="src" path="/MegaMekLab"/>
3131
<classpathentry kind="output" path="bin"/>
3232
</classpath>

MekHQ/docs/history.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
VERSION HISTORY
22
----------------------------------
33
v0.3.26-git
4+
+ Bug: GameOptionsDialog does not match MegaMek's GameOptionsDialog
5+
This bug was caused by duplicating G.O.D. rather than just implementing MM's
6+
version of it. I added the one minor thing the MM version needed added to support
7+
MHQ and other external programs, and then switched to using it. I also removed the
8+
MHQ included version to avoid mistakes in the future.
49

510
v0.3.25 (2016-02-21 14:15 UTC)
611
+ Updating MHQ Data files to be in line with MM 41.14 (Multi-commits)

MekHQ/src/mekhq/gui/CampaignGUI.java

+18-3
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112

113113
import megamek.client.RandomNameGenerator;
114114
import megamek.client.RandomUnitGenerator;
115+
import megamek.client.ui.swing.GameOptionsDialog;
115116
import megamek.common.AmmoType;
116117
import megamek.common.Crew;
117118
import megamek.common.Dropship;
@@ -122,6 +123,7 @@
122123
import megamek.common.MechView;
123124
import megamek.common.MiscType;
124125
import megamek.common.TargetRoll;
126+
import megamek.common.TechConstants;
125127
import megamek.common.UnitType;
126128
import megamek.common.WeaponType;
127129
import megamek.common.loaders.EntityLoadingException;
@@ -199,7 +201,6 @@
199201
import mekhq.gui.dialog.DailyReportLogDialog;
200202
import mekhq.gui.dialog.DataLoadingDialog;
201203
import mekhq.gui.dialog.GMToolsDialog;
202-
import mekhq.gui.dialog.GameOptionsDialog;
203204
import mekhq.gui.dialog.HireBulkPersonnelDialog;
204205
import mekhq.gui.dialog.MaintenanceReportDialog;
205206
import mekhq.gui.dialog.ManageAssetsDialog;
@@ -4444,12 +4445,12 @@ private void menuOptionsActionPerformed(java.awt.event.ActionEvent evt) {// GEN-
44444445
}// GEN-LAST:event_menuOptionsActionPerformed
44454446

44464447
private void menuOptionsMMActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_menuOptionsActionPerformed
4447-
GameOptionsDialog god = new GameOptionsDialog(getFrame(), getCampaign());
4448+
GameOptionsDialog god = new GameOptionsDialog(getFrame(), getCampaign().getGameOptions(), false);
44484449
god.refreshOptions();
44494450
god.setVisible(true);
44504451
if (!god.wasCancelled()) {
44514452
getCampaign().setGameOptions(god.getOptions());
4452-
god.setCampaignOptionsFromGameOptions();
4453+
setCampaignOptionsFromGameOptions();
44534454
refreshCalendar();
44544455
changePersonnelView();
44554456
refreshPersonnelList();
@@ -8669,4 +8670,18 @@ public JTable getServicedUnitTable() {
86698670
public UnitTableModel getServicedUnitModel() {
86708671
return servicedUnitModel;
86718672
}
8673+
8674+
private void setCampaignOptionsFromGameOptions() {
8675+
getCampaign().getCampaignOptions().setUseTactics(getCampaign().getGameOptions().getOption("command_init").booleanValue());
8676+
getCampaign().getCampaignOptions().setInitBonus(getCampaign().getGameOptions().getOption("individual_initiative").booleanValue());
8677+
getCampaign().getCampaignOptions().setToughness(getCampaign().getGameOptions().getOption("toughness").booleanValue());
8678+
getCampaign().getCampaignOptions().setArtillery(getCampaign().getGameOptions().getOption("artillery_skill").booleanValue());
8679+
getCampaign().getCampaignOptions().setAbilities(getCampaign().getGameOptions().getOption("pilot_advantages").booleanValue());
8680+
getCampaign().getCampaignOptions().setEdge(getCampaign().getGameOptions().getOption("edge").booleanValue());
8681+
getCampaign().getCampaignOptions().setImplants(getCampaign().getGameOptions().getOption("manei_domini").booleanValue());
8682+
getCampaign().getCampaignOptions().setQuirks(getCampaign().getGameOptions().getOption("stratops_quirks").booleanValue());
8683+
getCampaign().getCampaignOptions().setLimitByYear(getCampaign().getGameOptions().getOption("is_eq_limits").booleanValue());
8684+
getCampaign().getCampaignOptions().setAllowCanonOnly(getCampaign().getGameOptions().getOption("canon_only").booleanValue());
8685+
getCampaign().getCampaignOptions().setTechLevel(TechConstants.getSimpleLevel(getCampaign().getGameOptions().getOption("techlevel").stringValue()));
8686+
}
86728687
}

0 commit comments

Comments
 (0)