Skip to content

Commit

Permalink
Merge pull request #1625 from pavelbraginskiy/print-spas
Browse files Browse the repository at this point in the history
Print SPAs in record sheets printed from MUL
  • Loading branch information
rjhancock authored Sep 28, 2024
2 parents 12e7537 + 2dd105c commit 2d4be77
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion megameklab/src/megameklab/util/UnitPrintManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@

import megamek.client.ui.swing.UnitLoadingDialog;
import megamek.common.*;
import megamek.common.options.GameOptions;
import megamek.logging.MMLogger;
import megameklab.printing.*;
import megameklab.ui.dialog.MegaMekLabUnitSelectorDialog;
import megameklab.ui.dialog.PrintQueueDialog;

import static megamek.common.options.OptionsConstants.RPG_MANEI_DOMINI;
import static megamek.common.options.OptionsConstants.RPG_PILOT_ADVANTAGES;

public class UnitPrintManager {
private static final MMLogger logger = MMLogger.create(UnitPrintManager.class);

Expand Down Expand Up @@ -75,7 +79,11 @@ public static void printMUL(JFrame parent, boolean printToPdf) {
}
Vector<Entity> loadedUnits;
try {
loadedUnits = new MULParser(f.getSelectedFile(), null).getEntities();
var options = new GameOptions();
options.initialize();
options.getOption(RPG_MANEI_DOMINI).setValue(true);
options.getOption(RPG_PILOT_ADVANTAGES).setValue(true);
loadedUnits = new MULParser(f.getSelectedFile(), options).getEntities();
loadedUnits.trimToSize();
} catch (Exception ex) {
logger.error("", ex);
Expand Down

0 comments on commit 2d4be77

Please sign in to comment.