Skip to content

Commit

Permalink
Print SPAs in record sheets printed from MUL
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbraginskiy committed Sep 27, 2024
1 parent 1b95553 commit 2dd105c
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 2dd105c

Please sign in to comment.