File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
megameklab/src/megameklab/printing Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -274,10 +274,10 @@ public InventoryWriter(PrintEntity sheet) {
274274 }
275275 fuelText = sheet .formatTacticalFuel ();
276276 str = sheet .formatFeatures ();
277- featuresText = str .isEmpty () ? str : "Features " + str ;
277+ featuresText = str .isEmpty () ? "" : "Features " + str ;
278278 miscNotesText = sheet .formatMiscNotes ();
279279 str = sheet .formatQuirks ();
280- quirksText = str .isEmpty () ? str : "Quirks: " + str ;
280+ quirksText = str .isEmpty () ? "" : "Quirks: " + str ;
281281 }
282282
283283 public InventoryWriter (PrintEntity sheet , SVGRectElement svgRect ) {
Original file line number Diff line number Diff line change 7979import megamek .common .units .ProtoMek ;
8080import megamek .common .units .UnitRole ;
8181import megamek .common .units .UnitType ;
82+ import megamek .common .verifier .TestEntity ;
8283import megameklab .util .CConfig ;
8384import megameklab .util .RSScale ;
8485import megameklab .util .UnitUtil ;
@@ -233,20 +234,17 @@ public String formatTacticalFuel() {
233234
234235 /**
235236 * Converts a weight to a String, either in kg or tons as appropriate to the Entity, labeled with the measurement
236- * unit.
237+ * unit (e.g. "1 ton", "3 tons", "2750 kg") .
237238 *
238239 * @param weight The weight in tons
239240 *
240241 * @return The formatted weight with units
241242 */
242243 String formatWeight (double weight ) {
243- if ((getEntity () instanceof BattleArmor )
244- || (getEntity () instanceof ProtoMek )
245- || getEntity ().getWeightClass () == EntityWeightClass .WEIGHT_SMALL_SUPPORT ) {
244+ if (TestEntity .usesKgStandard (getEntity ())) {
246245 return DecimalFormat .getInstance ().format (weight * 1000 ) + " kg" ;
247246 } else {
248- return DecimalFormat .getInstance ().format (weight )
249- + ((weight == 1 ) ? " ton)" : " tons" );
247+ return DecimalFormat .getInstance ().format (weight ) + ((weight == 1 ) ? " ton" : " tons" );
250248 }
251249 }
252250
You can’t perform that action at this time.
0 commit comments