1818 */
1919package mekhq .gui .dialog .reportDialogs ;
2020
21- import mekhq . MekHQ ;
21+ import megamek . client . ui . swing . util . UIUtil ;
2222import mekhq .campaign .parts .Part ;
23- import mekhq .campaign .parts .enums . PartQuality ;
23+ import mekhq .campaign .parts .equipment . AmmoBin ;
2424import mekhq .campaign .unit .Unit ;
2525import mekhq .utilities .ReportingUtilities ;
2626
@@ -51,6 +51,8 @@ public PartQualityReportDialog(final JFrame frame, final Unit unit) {
5151 setTitle (String .format (resources .getString ("PartQualityReportDialog.Unit.title" ),
5252 unit .getName ()));
5353 initialize ();
54+ pack ();
55+ setModal (true );
5456 }
5557 //endregion Constructors
5658
@@ -87,6 +89,10 @@ private String getPartsReport(Unit unit) {
8789
8890 // Iterate over parts, assigning each to its location in the map.
8991 for (Part part : unit .getParts ()) {
92+ if (part instanceof AmmoBin ) {
93+ continue ;
94+ }
95+
9096 String location = part .getLocationName () != null ? part .getLocationName () : unit .getName ();
9197 reportMap .computeIfAbsent (location , k -> new ArrayList <>()).add (part );
9298 }
@@ -113,17 +119,18 @@ private String getPartsReport(Unit unit) {
113119 String colorCode = unit .getQuality ().getHexColor ();
114120
115121 // Add the location and its colored quality rating to the report.
116- report .append ("<span style=\" font-size: 18px;\" >" )
122+ int headerFontSize = UIUtil .scaleForGUI (18 );
123+ report .append ("<span style=\" font-size: " ).append (headerFontSize ).append ("px;\" >" )
117124 .append (location )
118125 .append (" - " );
119- report .append ("<span style=\" color: " )
120- .append (colorCode )
121- .append (";\" >" )
126+ report .append ("<span style=\" color: " ).append (colorCode ).append (";\" >" )
122127 .append (unit .getQualityName ())
123128 .append ("</span>" );
124129 report .append ("</span>" );
125130 } else {
126- report .append ("<span style=\" font-size: 12px;\" >" ).append (location ).append ("</span>" );
131+ int headerFontSize = UIUtil .scaleForGUI (12 );
132+ report .append ("<span style=\" font-size: " ).append (headerFontSize ).append ("px;\" >" )
133+ .append (location ).append ("</span>" );
127134 }
128135 report .append ("</b><br>" );
129136
0 commit comments