Skip to content

Commit

Permalink
Calculate force modifiers (Tag/C3) when printing from MUL
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbraginskiy committed Mar 18, 2024
1 parent 108eda2 commit 2973298
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ConfigurationDialog.chkShowCondensedTables.text=Print Mech hit location and clus
ConfigurationDialog.chkShowCondensedTables.tooltip=Include hit location and cluster hits tables in the space where the fluff image normally goes.
ConfigurationDialog.chkShowQuirks.text=Print design quirks
ConfigurationDialog.chkShowQuirks.tooltip=Displays featured design quirks
ConfigurationDialog.chkShowPilotData.text=Include pilot data when printing from a MUL
ConfigurationDialog.chkShowPilotData.text=Include pilot and force data when printing from a MUL
ConfigurationDialog.chkShowPilotData.tooltip=When using a MUL file for batch printing, unchecking this option ignores the generated crew information.
ConfigurationDialog.chkShowEraIcon.text=Print era icon
ConfigurationDialog.chkShowEraIcon.tooltip=Includes the icon associated with the era the unit was constructed.
Expand Down
10 changes: 10 additions & 0 deletions megameklab/src/megameklab/util/UnitPrintManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import megamek.client.ui.swing.UnitLoadingDialog;
import megamek.common.*;
import megamek.common.util.C3Util;
import megameklab.printing.*;
import megameklab.ui.dialog.MegaMekLabUnitSelectorDialog;
import megameklab.ui.dialog.PrintQueueDialog;
Expand Down Expand Up @@ -75,6 +76,15 @@ public static void printMUL(JFrame parent, boolean printToPdf) {
return;
}

// Dummy player and game allow bonus BV from C3 and TAG to be calculated
Game g = new Game();
Player p = new Player(1, "Nobody");
for (Entity e : loadedUnits) {
e.setOwner(p);
g.addEntity(e);
C3Util.wireC3(g, e);
}

new PrintQueueDialog(parent, printToPdf, loadedUnits, true).setVisible(true);
}

Expand Down

0 comments on commit 2973298

Please sign in to comment.