From 4c0bc48020c8c96971eafbab5a9a637684e1178c Mon Sep 17 00:00:00 2001 From: Weaver Date: Fri, 4 Oct 2024 21:50:46 -0700 Subject: [PATCH 1/5] Change refit dialog to refit/customize dialog that allows style of refit Using a refit kit is easier than and has different rules from customizing a mek, and until now the only way to use the customization rules was to use the meklab manually. This setup also allows you to customize a mek to a non-canon variant but only refit to a canon variant if canon-refits-only is turned on. This means that when that option is enabled it is much easier to repeat saved meklab customizations. This further means that building mek variants in MegaMekLab and then carrying out the customization as if you had done it inside MekHQMekLab is possible. Utilities.getAllVariants was changed but that function only has the code we're working on here calling it. --- .../resources/ChooseRefitDialog.properties | 3 +- MekHQ/src/mekhq/Utilities.java | 6 -- .../gui/adapter/UnitTableMouseAdapter.java | 4 +- .../mekhq/gui/dialog/ChooseRefitDialog.java | 64 ++++++++++++------- 4 files changed, 44 insertions(+), 33 deletions(-) diff --git a/MekHQ/resources/mekhq/resources/ChooseRefitDialog.properties b/MekHQ/resources/mekhq/resources/ChooseRefitDialog.properties index ee4e564dfa..e56d9322d1 100644 --- a/MekHQ/resources/mekhq/resources/ChooseRefitDialog.properties +++ b/MekHQ/resources/mekhq/resources/ChooseRefitDialog.properties @@ -1,4 +1,5 @@ -btnOK.text=Begin Refit +btnRefit.text=Begin Refit +btnCustomize.text=Begin Customization btnClose.text=Cancel title.text=Available Refits for refitTable.title=Available Refits diff --git a/MekHQ/src/mekhq/Utilities.java b/MekHQ/src/mekhq/Utilities.java index c72f553e68..ac8ea8736f 100644 --- a/MekHQ/src/mekhq/Utilities.java +++ b/MekHQ/src/mekhq/Utilities.java @@ -214,7 +214,6 @@ public static File[] getAllFiles(String dir, FilenameFilter filter) { } public static ArrayList getAllVariants(Entity en, Campaign campaign) { - CampaignOptions options = campaign.getCampaignOptions(); ArrayList variants = new ArrayList<>(); for (MekSummary summary : MekSummaryCache.getInstance().getAllMeks()) { @@ -237,11 +236,6 @@ public static ArrayList getAllVariants(Entity en, Campaign campaign) { } } - // If we only allow canon units and this isn't canon we continue - if (!summary.isCanon() && options.isAllowCanonRefitOnly()) { - continue; - } - // If the unit doesn't meet the tech filter criteria we continue ITechnology techProg = UnitTechProgression.getProgression(summary, campaign.getTechFaction(), true); if (techProg == null) { diff --git a/MekHQ/src/mekhq/gui/adapter/UnitTableMouseAdapter.java b/MekHQ/src/mekhq/gui/adapter/UnitTableMouseAdapter.java index c5cad14256..8424550fe6 100644 --- a/MekHQ/src/mekhq/gui/adapter/UnitTableMouseAdapter.java +++ b/MekHQ/src/mekhq/gui/adapter/UnitTableMouseAdapter.java @@ -381,7 +381,7 @@ public void actionPerformed(ActionEvent action) { Entity refitEntity = new MekFileParser(summary.getSourceFile(), summary.getEntryName()) .getEntity(); if (refitEntity != null) { - Refit refit = new Refit(unit, refitEntity, false, false); + Refit refit = new Refit(unit, refitEntity, crd.isCustomize(), false); if (refit.checkFixable() == null) { gui.refitUnit(refit, false); } @@ -850,7 +850,7 @@ protected Optional createPopupMenu() { || (unit.getEntity() instanceof Aero) || ((unit.getEntity() instanceof Infantry)))) { menuItem = new JMenuItem(unit.getEntity().isOmni() ? "Choose configuration..." - : "Choose Refit Kit..."); + : "Refit/Customize..."); menuItem.setActionCommand(COMMAND_REFIT_KIT); menuItem.addActionListener(this); menu.add(menuItem); diff --git a/MekHQ/src/mekhq/gui/dialog/ChooseRefitDialog.java b/MekHQ/src/mekhq/gui/dialog/ChooseRefitDialog.java index e4d19ecb7e..6e7e909174 100644 --- a/MekHQ/src/mekhq/gui/dialog/ChooseRefitDialog.java +++ b/MekHQ/src/mekhq/gui/dialog/ChooseRefitDialog.java @@ -66,7 +66,8 @@ public class ChooseRefitDialog extends JDialog { private RefitTableModel refitModel; private JButton btnClose; - private JButton btnOK; + private JButton btnRefit; + private JButton btnCustomize; private JTable refitTable; private JScrollPane scrRefitTable; private JList lstShopping; @@ -77,6 +78,7 @@ public class ChooseRefitDialog extends JDialog { private JScrollPane scrNewUnit; private boolean confirmed = false; + private boolean customize = false; // endregion Variable Declarations // region Constructors @@ -162,7 +164,7 @@ private void initComponents() { gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.gridheight = 2; - gridBagConstraints.weightx = 0.0; + gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.anchor = GridBagConstraints.NORTHWEST; @@ -182,28 +184,20 @@ private void initComponents() { getContentPane().add(scrNewUnit, gridBagConstraints); JPanel panBtn = new JPanel(new GridBagLayout()); - btnOK = new JButton(resourceMap.getString("btnOK.text")); - btnOK.setEnabled(false); - btnOK.addActionListener(evt -> confirm()); - gridBagConstraints = new GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 0; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.fill = GridBagConstraints.NONE; - gridBagConstraints.anchor = GridBagConstraints.EAST; - gridBagConstraints.insets = new Insets(5, 5, 5, 5); - panBtn.add(btnOK, gridBagConstraints); + + btnRefit = new JButton(resourceMap.getString("btnRefit.text")); + btnRefit.setEnabled(false); + btnRefit.addActionListener(evt -> confirmRefit()); + panBtn.add(btnRefit, new GridBagConstraints()); + + btnCustomize = new JButton(resourceMap.getString("btnCustomize.text")); + btnCustomize.setEnabled(false); + btnCustomize.addActionListener(evt -> confirmCustomize()); + panBtn.add(btnCustomize, new GridBagConstraints()); btnClose = new JButton(resourceMap.getString("btnClose.text")); btnClose.addActionListener(evt -> cancel()); - gridBagConstraints = new GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 0; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.fill = GridBagConstraints.NONE; - gridBagConstraints.anchor = GridBagConstraints.WEST; - gridBagConstraints.insets = new Insets(5, 5, 5, 5); - panBtn.add(btnClose, gridBagConstraints); + panBtn.add(btnClose, new GridBagConstraints()); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; @@ -231,8 +225,15 @@ private void setUserPreferences() { } // endregion Initialization - private void confirm() { + private void confirmRefit() { confirmed = getSelectedRefit() != null; + customize = false; + setVisible(false); + } + + private void confirmCustomize() { + confirmed = getSelectedRefit() != null; + customize = true; setVisible(false); } @@ -244,6 +245,11 @@ public boolean isConfirmed() { return confirmed; } + public boolean isCustomize() { + return customize; + } + + public Refit getSelectedRefit() { int selectedRow = refitTable.getSelectedRow(); if (selectedRow < 0) { @@ -257,10 +263,20 @@ private void refitTableValueChanged() { if (null == r) { scrShoppingList.setViewportView(null); txtNewUnit.setText(""); - btnOK.setEnabled(false); + btnRefit.setEnabled(false); + btnCustomize.setEnabled(false); return; } - btnOK.setEnabled(true); + + if (!campaign.getCampaignOptions().isAllowCanonRefitOnly() || r.getNewEntity().isCanon()) { + btnRefit.setEnabled(true); + } else { + btnRefit.setEnabled(false); + } + btnCustomize.setEnabled(true); + + + lstShopping = new JList<>(r.getShoppingListDescription()); scrShoppingList.setViewportView(lstShopping); MekView mv = new MekView(r.getNewEntity(), false, true); From 143fa327b33cbac316404936537d05e550530ece Mon Sep 17 00:00:00 2001 From: Weaver Date: Sat, 5 Oct 2024 10:45:09 -0700 Subject: [PATCH 2/5] Clarify button captions --- MekHQ/resources/mekhq/resources/ChooseRefitDialog.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MekHQ/resources/mekhq/resources/ChooseRefitDialog.properties b/MekHQ/resources/mekhq/resources/ChooseRefitDialog.properties index e56d9322d1..c10e4848cc 100644 --- a/MekHQ/resources/mekhq/resources/ChooseRefitDialog.properties +++ b/MekHQ/resources/mekhq/resources/ChooseRefitDialog.properties @@ -1,5 +1,5 @@ -btnRefit.text=Begin Refit -btnCustomize.text=Begin Customization +btnRefit.text=Acquire and Use Refit Kit +btnCustomize.text=Customize to Model btnClose.text=Cancel title.text=Available Refits for refitTable.title=Available Refits From de4c76b41b0bddb4cd688aca73ce329038fe0f54 Mon Sep 17 00:00:00 2001 From: Weaver Date: Sat, 5 Oct 2024 11:11:39 -0700 Subject: [PATCH 3/5] Prevent refit code from saving non-meklab customizations to files --- MekHQ/src/mekhq/campaign/parts/Refit.java | 6 ++++-- MekHQ/src/mekhq/gui/MekLabTab.java | 2 +- .../gui/adapter/UnitTableMouseAdapter.java | 4 ++-- .../mekhq/gui/dialog/ChooseRefitDialog.java | 2 +- .../mekhq/campaign/parts/RefitTest.java | 18 +++++++++--------- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/MekHQ/src/mekhq/campaign/parts/Refit.java b/MekHQ/src/mekhq/campaign/parts/Refit.java index 270a27c4d4..df7cbb9fce 100644 --- a/MekHQ/src/mekhq/campaign/parts/Refit.java +++ b/MekHQ/src/mekhq/campaign/parts/Refit.java @@ -96,6 +96,7 @@ public class Refit extends Part implements IAcquisitionWork { private boolean failedCheck; private boolean customJob; private boolean isRefurbishing; + private boolean isSavingFile; private boolean kitFound; private boolean replacingLocations; private String fixableString; @@ -128,10 +129,11 @@ public Refit() { cost = Money.zero(); } - public Refit(Unit oUnit, Entity newEn, boolean custom, boolean refurbish) { + public Refit(Unit oUnit, Entity newEn, boolean custom, boolean refurbish, boolean saveFile) { this(); isRefurbishing = refurbish; customJob = custom; + isSavingFile = saveFile; oldUnit = oUnit; newEntity = newEn; newEntity.setOwner(oldUnit.getEntity().getOwner()); @@ -1044,7 +1046,7 @@ public void calculate() { } public void begin() throws EntityLoadingException, IOException { - if (customJob) { + if (customJob && isSavingFile) { saveCustomization(); } oldUnit.setRefit(this); diff --git a/MekHQ/src/mekhq/gui/MekLabTab.java b/MekHQ/src/mekhq/gui/MekLabTab.java index cc1fe070f3..d9c060f3bd 100644 --- a/MekHQ/src/mekhq/gui/MekLabTab.java +++ b/MekHQ/src/mekhq/gui/MekLabTab.java @@ -288,7 +288,7 @@ public void refreshRefitSummary() { if (null == entity) { return; } - refit = new Refit(unit, entity, true, false); + refit = new Refit(unit, entity, true, false, true); testEntity = null; if (entity instanceof SmallCraft) { testEntity = new TestSmallCraft((SmallCraft) entity, entityVerifier.aeroOption, null); diff --git a/MekHQ/src/mekhq/gui/adapter/UnitTableMouseAdapter.java b/MekHQ/src/mekhq/gui/adapter/UnitTableMouseAdapter.java index 8424550fe6..02d1714e54 100644 --- a/MekHQ/src/mekhq/gui/adapter/UnitTableMouseAdapter.java +++ b/MekHQ/src/mekhq/gui/adapter/UnitTableMouseAdapter.java @@ -365,7 +365,7 @@ public void actionPerformed(ActionEvent action) { Stream.of(units).filter(Unit::isRefitting).forEach(unit -> unit.getRefit().succeed()); } else if (command.equals(COMMAND_REFURBISH)) { for (Unit unit : units) { - Refit refit = new Refit(unit, unit.getEntity(), false, true); + Refit refit = new Refit(unit, unit.getEntity(), false, true, false); gui.refitUnit(refit, false); } } else if (command.equals(COMMAND_REFIT_KIT)) { // Single Unit or Multiple of Units of the same type only @@ -381,7 +381,7 @@ public void actionPerformed(ActionEvent action) { Entity refitEntity = new MekFileParser(summary.getSourceFile(), summary.getEntryName()) .getEntity(); if (refitEntity != null) { - Refit refit = new Refit(unit, refitEntity, crd.isCustomize(), false); + Refit refit = new Refit(unit, refitEntity, crd.isCustomize(), false, false); if (refit.checkFixable() == null) { gui.refitUnit(refit, false); } diff --git a/MekHQ/src/mekhq/gui/dialog/ChooseRefitDialog.java b/MekHQ/src/mekhq/gui/dialog/ChooseRefitDialog.java index 6e7e909174..1a38b99fec 100644 --- a/MekHQ/src/mekhq/gui/dialog/ChooseRefitDialog.java +++ b/MekHQ/src/mekhq/gui/dialog/ChooseRefitDialog.java @@ -300,7 +300,7 @@ private void populateRefits() { try { Entity refitEn = new MekFileParser(summary.getSourceFile(), summary.getEntryName()).getEntity(); if (null != refitEn) { - Refit r = new Refit(unit, refitEn, false, false); + Refit r = new Refit(unit, refitEn, false, false, false); if (null == r.checkFixable()) { refits.add(r); } diff --git a/MekHQ/unittests/mekhq/campaign/parts/RefitTest.java b/MekHQ/unittests/mekhq/campaign/parts/RefitTest.java index c121e3b70f..1f44a4cdef 100644 --- a/MekHQ/unittests/mekhq/campaign/parts/RefitTest.java +++ b/MekHQ/unittests/mekhq/campaign/parts/RefitTest.java @@ -126,7 +126,7 @@ public void newRefitCtor() { oldUnit.initializeParts(false); // Create the Refit - Refit refit = new Refit(oldUnit, newEntity, false, false); + Refit refit = new Refit(oldUnit, newEntity, false, false, false); assertEquals(mockCampaign, refit.getCampaign()); // Should be old parts... @@ -156,7 +156,7 @@ public void locust1Vto1ETest() { oldUnit.initializeParts(false); // Create the Refit - Refit refit = new Refit(oldUnit, newEntity, false, false); + Refit refit = new Refit(oldUnit, newEntity, false, false, false); assertEquals(mockCampaign, refit.getCampaign()); // @@ -238,7 +238,7 @@ public void testLocust1Vto1EWriteToXml() throws ParserConfigurationException, SA } // Create the Refit - Refit refit = new Refit(oldUnit, newEntity, false, false); + Refit refit = new Refit(oldUnit, newEntity, false, false, false); // Write the Refit XML StringWriter sw = new StringWriter(); @@ -345,7 +345,7 @@ public void javelinJVN10Nto10ATest() { oldUnit.initializeParts(false); // Create the Refit - Refit refit = new Refit(oldUnit, newEntity, false, false); + Refit refit = new Refit(oldUnit, newEntity, false, false, false); assertEquals(mockCampaign, refit.getCampaign()); // @@ -428,7 +428,7 @@ public void testJavelinJVN10Nto10AWriteToXml() throws ParserConfigurationExcepti } // Create the Refit - Refit refit = new Refit(oldUnit, newEntity, false, false); + Refit refit = new Refit(oldUnit, newEntity, false, false, false); refit.setTech(mockTech); refit.addTimeSpent(60); // 1 hour of work! @@ -537,7 +537,7 @@ public void fleaFLE4toFLE15Test() { oldUnit.initializeParts(false); // Create the Refit - Refit refit = new Refit(oldUnit, newEntity, false, false); + Refit refit = new Refit(oldUnit, newEntity, false, false, false); assertEquals(mockCampaign, refit.getCampaign()); // @@ -647,7 +647,7 @@ public void testFleaFLE4toFLE15WriteToXml() throws ParserConfigurationException, } // Create the Refit - Refit refit = new Refit(oldUnit, newEntity, false, false); + Refit refit = new Refit(oldUnit, newEntity, false, false, false); refit.setTech(mockTech); refit.addTimeSpent(60); // 1 hour of work! @@ -768,7 +768,7 @@ public void heavyTrackedApcMgToStandard() throws EntityLoadingException, IOExcep oldUnit.initializeParts(false); // Create the Refit - Refit refit = new Refit(oldUnit, newEntity, false, false); + Refit refit = new Refit(oldUnit, newEntity, false, false, false); assertEquals(mockCampaign, refit.getCampaign()); // We're removing 4 Machine Guns and a Full Bin of Machine Gun Ammo @@ -819,7 +819,7 @@ public void testMasakariAtoMasakariB() { oldUnit.initializeParts(false); // Create the Refit - Refit refit = new Refit(oldUnit, newEntity, false, false); + Refit refit = new Refit(oldUnit, newEntity, false, false, false); assertEquals(mockCampaign, refit.getCampaign()); // Omni reconfiguration From a80cee34cce3f69d60ad37d062790aa22ce91fd8 Mon Sep 17 00:00:00 2001 From: kuronekochomusuke Date: Mon, 7 Oct 2024 20:30:37 -0400 Subject: [PATCH 4/5] correct issues with fixed map generation --- .../mission/AtBDynamicScenarioFactory.java | 34 +-------------- .../mekhq/campaign/mission/AtBScenario.java | 43 +++++++++++++++---- .../mekhq/gui/view/AtBScenarioViewPanel.java | 12 ++++-- 3 files changed, 44 insertions(+), 45 deletions(-) diff --git a/MekHQ/src/mekhq/campaign/mission/AtBDynamicScenarioFactory.java b/MekHQ/src/mekhq/campaign/mission/AtBDynamicScenarioFactory.java index 6babbd0f52..22a1970890 100644 --- a/MekHQ/src/mekhq/campaign/mission/AtBDynamicScenarioFactory.java +++ b/MekHQ/src/mekhq/campaign/mission/AtBDynamicScenarioFactory.java @@ -213,7 +213,7 @@ public static void finalizeScenario(AtBDynamicScenario scenario, AtBContract con // approximate estimate, anyway. scenario.setLanceCount(generatedLanceCount + (playerForceUnitCount / 4)); setScenarioMapSize(scenario); - setScenarioMap(scenario, campaign.getCampaignOptions().getFixedMapChance()); + scenario.setScenarioMap(campaign.getCampaignOptions().getFixedMapChance()); setDeploymentZones(scenario); setDestinationZones(scenario); @@ -1387,38 +1387,6 @@ public static void setScenarioMapSize(AtBDynamicScenario scenario) { scenario.setMapSizeY(mapSizeY); } - /** - * If there are maps of the appropriate size available and we roll higher than - * the given threshold, replace the scenario's generated map with a fixed map - * from data/boards - */ - private static void setScenarioMap(AtBDynamicScenario scenario, int mapChance) { - if (scenario.getBoardType() != Scenario.T_SPACE - && scenario.getTerrainType().equals("Space") - && (scenario.getMapSizeX() > 0) - && (scenario.getMapSizeY() > 0) - && (Compute.randomInt(100) <= mapChance)) { - BoardClassifier bc = BoardClassifier.getInstance(); - List maps = bc.getMatchingBoards(scenario.getMapSizeX(), scenario.getMapSizeY(), 5, 5, - new ArrayList<>()); - - if (!maps.isEmpty()) { - String mapPath = ObjectUtility.getRandomItem(maps); - MegaMekFile mapFile = new MegaMekFile(mapPath); - BoardDimensions dimensions = Board.getSize(mapFile.getFile()); - - scenario.setMap(bc.getBoardPaths().get(mapPath)); - scenario.setMapSizeX(dimensions.width()); - scenario.setMapSizeY(dimensions.height()); - scenario.setUsingFixedMap(true); - return; - } - } - - scenario.setUsingFixedMap(false); - scenario.setMapFile(); - } - /** * Randomly generates the number of scenario modifiers for a scenario, * for each random scenario in the count a random modifier is applied to the diff --git a/MekHQ/src/mekhq/campaign/mission/AtBScenario.java b/MekHQ/src/mekhq/campaign/mission/AtBScenario.java index 438fefed78..d8ccf140f5 100644 --- a/MekHQ/src/mekhq/campaign/mission/AtBScenario.java +++ b/MekHQ/src/mekhq/campaign/mission/AtBScenario.java @@ -26,6 +26,9 @@ import java.time.LocalDate; import java.util.*; +import megamek.common.*; +import megamek.common.util.fileUtils.MegaMekFile; +import megamek.utilities.BoardClassifier; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -33,14 +36,6 @@ import megamek.Version; import megamek.client.generator.TeamLoadOutGenerator; import megamek.codeUtilities.ObjectUtility; -import megamek.common.Board; -import megamek.common.Compute; -import megamek.common.Entity; -import megamek.common.EntityWeightClass; -import megamek.common.Infantry; -import megamek.common.TargetRoll; -import megamek.common.UnitType; -import megamek.common.WeatherRestriction; import megamek.common.annotations.Nullable; import megamek.common.enums.SkillLevel; import megamek.common.icons.Camouflage; @@ -492,6 +487,38 @@ public void setMapFile() { setMapFile(getTerrainType()); } + /** + * If there are maps of the appropriate size available and we roll higher than + * the given threshold, replace the scenario's generated map with a fixed map + * from data/boards + */ + public void setScenarioMap(int mapChance) { + if (getBoardType() != Scenario.T_SPACE + && !getTerrainType().equals("Space") + && (getMapSizeX() > 0) + && (getMapSizeY() > 0) + && (Compute.randomInt(100) <= mapChance)) { + BoardClassifier bc = BoardClassifier.getInstance(); + List maps = bc.getMatchingBoards(getMapSizeX(), getMapSizeY(), 7, 7, + new ArrayList<>()); + + if (!maps.isEmpty()) { + String mapPath = ObjectUtility.getRandomItem(maps); + MegaMekFile mapFile = new MegaMekFile(mapPath); + BoardDimensions dimensions = Board.getSize(mapFile.getFile()); + + setMap(bc.getBoardPaths().get(mapPath)); + setMapSizeX(dimensions.width()); + setMapSizeY(dimensions.height()); + setUsingFixedMap(true); + return; + } + } + + setUsingFixedMap(false); + setMapFile(); + } + public boolean canRerollTerrain() { return canRerollMap(); } diff --git a/MekHQ/src/mekhq/gui/view/AtBScenarioViewPanel.java b/MekHQ/src/mekhq/gui/view/AtBScenarioViewPanel.java index 19662c9272..5cd771046c 100644 --- a/MekHQ/src/mekhq/gui/view/AtBScenarioViewPanel.java +++ b/MekHQ/src/mekhq/gui/view/AtBScenarioViewPanel.java @@ -797,22 +797,26 @@ private void countRerollBoxes() { private void rerollBattleConditions() { if (chkReroll[REROLL_TERRAIN] != null && chkReroll[REROLL_TERRAIN].isSelected()) { scenario.setTerrain(); - scenario.setMapFile(); + scenario.setScenarioMap(campaign.getCampaignOptions().getFixedMapChance()); scenario.useReroll(); chkReroll[REROLL_TERRAIN].setSelected(false); lblTerrainDesc.setText(scenario.getTerrainType()); - lblMapDesc.setText(scenario.getMap()); + lblMapDesc.setText(scenario.getMapForDisplay()); + lblMapSizeDesc.setText(scenario.getMapSizeX() + "x" + scenario.getMapSizeY()); } if (chkReroll[REROLL_MAP] != null && chkReroll[REROLL_MAP].isSelected()) { - scenario.setMapFile(); + scenario.setScenarioMap(campaign.getCampaignOptions().getFixedMapChance()); scenario.useReroll(); chkReroll[REROLL_MAP].setSelected(false); - lblMapDesc.setText(scenario.getMap()); + lblMapDesc.setText(scenario.getMapForDisplay()); + lblMapSizeDesc.setText(scenario.getMapSizeX() + "x" + scenario.getMapSizeY()); } if (chkReroll[REROLL_MAPSIZE] != null && chkReroll[REROLL_MAPSIZE].isSelected()) { scenario.setMapSize(); + scenario.setScenarioMap(campaign.getCampaignOptions().getFixedMapChance()); scenario.useReroll(); chkReroll[REROLL_MAPSIZE].setSelected(false); + lblMapDesc.setText(scenario.getMapForDisplay()); lblMapSizeDesc.setText(scenario.getMapSizeX() + "x" + scenario.getMapSizeY()); } if (chkReroll[REROLL_LIGHT] != null && chkReroll[REROLL_LIGHT].isSelected()) { From 2a8f5f5ba6b8453be4ada8fb25943122cbdba6bf Mon Sep 17 00:00:00 2001 From: HammerGS Date: Tue, 8 Oct 2024 14:46:20 -0600 Subject: [PATCH 5/5] Updating History files. --- MekHQ/docs/history.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MekHQ/docs/history.txt b/MekHQ/docs/history.txt index e9249407d2..732400a203 100644 --- a/MekHQ/docs/history.txt +++ b/MekHQ/docs/history.txt @@ -92,6 +92,8 @@ MEKHQ VERSION HISTORY: + PR #4981: Implemented Campaign Options IIC Preset Picker #4981 + PR #4984: Refactored Daily Personnel Processing Logic. + PR #4989: Adaptation to MM #6068 Replace Manual GUI scaling with FlatLaf Scaling ++ PR #5002: Correct issues with fixed map generation #5002 ++ PR #4992: Add Customization Option to Refit Dialog 0.50.0 (2024-09-01 2000 UTC) (THIS MARKS THE START OF JAVA 17 AS THE MINIMUM REQUIRED) + PR #4332: CI Updates for windows build and normalizing