diff --git a/MekHQ/src/mekhq/gui/dialog/BombsDialog.java b/MekHQ/src/mekhq/gui/dialog/BombsDialog.java index f1c67a11af..15a0f0972f 100644 --- a/MekHQ/src/mekhq/gui/dialog/BombsDialog.java +++ b/MekHQ/src/mekhq/gui/dialog/BombsDialog.java @@ -86,6 +86,7 @@ private void initGUI() { typeMax[type] = availBombs[type] + bombChoices[type]; } + // BombChoicePanel takes care of managing internal and external stores, so we don't need to here. bombPanel = new BombChoicePanel(bomber, campaign.getGameOptions().booleanOption("at2_nukes"), true, typeMax); @@ -127,6 +128,7 @@ private void setUserPreferences() { @Override public void actionPerformed(ActionEvent e) { if (okayButton.equals(e.getSource())) { + // internal and external choices are applied by bombPanel; here we only care about the totals. bombPanel.applyChoice(); int[] newLoadout = bombPanel.getChoice(); diff --git a/MekHQ/src/mekhq/utilities/MHQXMLUtility.java b/MekHQ/src/mekhq/utilities/MHQXMLUtility.java index 25f1069a46..c1d4c256f2 100644 --- a/MekHQ/src/mekhq/utilities/MHQXMLUtility.java +++ b/MekHQ/src/mekhq/utilities/MHQXMLUtility.java @@ -254,10 +254,7 @@ public static String writeEntityToXmlString(Entity tgtEnt, int indentLvl, List 0) { retVal.append(MHQXMLUtility.indentStr(indentLvl + 1)).append("\n"); for (int type = 0; type < BombType.B_NUM; type++) { @@ -267,12 +264,22 @@ private static String getBombChoiceString(IBomber bomber, int indentLvl) { retVal.append(typeName); retVal.append("\" load=\""); retVal.append(bombChoices[type]); + retVal.append((isInternal) ? "\" Internal=\"true" : "\" Internal=\"false"); retVal.append("\"/>\n"); } } retVal.append(MHQXMLUtility.indentStr(indentLvl + 1)).append("\n"); } + } + private static String getBombChoiceString(IBomber bomber, int indentLvl) { + StringBuilder retVal = new StringBuilder(); + + int[] bombChoices = bomber.getIntBombChoices(); + compileBombChoices(bombChoices, retVal, indentLvl, true); + bombChoices = bomber.getExtBombChoices(); + compileBombChoices(bombChoices, retVal, indentLvl, false); + return retVal.toString(); }