Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print SPAs in record sheets printed from MUL #1625

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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