|
32 | 32 | */ |
33 | 33 | package mekhq.service.mrms; |
34 | 34 |
|
| 35 | +import static mekhq.utilities.MHQInternationalization.getFormattedTextAt; |
| 36 | +import static mekhq.utilities.ReportingUtilities.CLOSING_SPAN_TAG; |
| 37 | +import static mekhq.utilities.ReportingUtilities.getWarningColor; |
| 38 | +import static mekhq.utilities.ReportingUtilities.spanOpeningWithCustomColor; |
| 39 | + |
35 | 40 | import java.text.MessageFormat; |
36 | 41 | import java.util.ArrayList; |
37 | 42 | import java.util.Comparator; |
|
71 | 76 | public class MRMSService { |
72 | 77 | private static final MMLogger LOGGER = MMLogger.create(MRMSService.class); |
73 | 78 |
|
| 79 | + private static final String RESOURCE_BUNDLE = "mekhq.resources.MRMSService"; |
| 80 | + @Deprecated(since = "0.50.10") |
74 | 81 | private static final ResourceBundle resources = ResourceBundle.getBundle("mekhq.resources.MRMS", |
75 | 82 | MekHQ.getMHQOptions().getLocale()); |
76 | 83 |
|
@@ -211,14 +218,12 @@ public static String performSingleUnitMRMS(Campaign campaign, Unit unit) { |
211 | 218 | parts = filterParts(parts, null, techs, campaign); |
212 | 219 |
|
213 | 220 | if (!parts.isEmpty()) { |
| 221 | + String color = spanOpeningWithCustomColor(getWarningColor()); |
214 | 222 | if (parts.size() == 1) { |
215 | | - campaign.addReport("<font color='" + ReportingUtilities.getNegativeColor() |
216 | | - + "'>There in still 1 part that is not being worked on.</font>"); |
| 223 | + campaign.addReport(getFormattedTextAt(RESOURCE_BUNDLE, "inProgress.one", color, CLOSING_SPAN_TAG)); |
217 | 224 | } else { |
218 | | - campaign.addReport(String.format( |
219 | | - "<font color='" + ReportingUtilities.getNegativeColor() |
220 | | - + "'>There are still %s parts that are not being worked on.</font>", |
221 | | - parts.size())); |
| 225 | + campaign.addReport(getFormattedTextAt(RESOURCE_BUNDLE, "inProgress.many", color, parts.size(), |
| 226 | + CLOSING_SPAN_TAG)); |
222 | 227 | } |
223 | 228 | } |
224 | 229 | } |
@@ -371,7 +376,7 @@ public static void mrmsUnits(Campaign campaign, List<Unit> units, MRMSConfigured |
371 | 376 | if (count > 0) { |
372 | 377 | if (count == 1) { |
373 | 378 | campaign.addReport("<font color='" + ReportingUtilities.getNegativeColor() |
374 | | - + "'>There in still 1 part that is not being worked on.</font>"); |
| 379 | + + "'>There is still 1 part that is not being worked on.</font>"); |
375 | 380 | } else { |
376 | 381 | campaign.addReport(String.format( |
377 | 382 | "<font color='" + ReportingUtilities.getNegativeColor() |
@@ -646,14 +651,14 @@ private static MRMSUnitAction performUnitMassTechAction(Campaign campaign, Unit |
646 | 651 | if (unfixable) { |
647 | 652 | campaign.addReport(String.format( |
648 | 653 | "<font color='" + |
649 | | - ReportingUtilities.getWarningColor() |
| 654 | + getWarningColor() |
650 | 655 | + |
651 | 656 | "'>Found an unfixable limb (%s) on %s which contains %s parts. Going to remove all parts and scrap the limb before proceeding with other repairs.</font>", |
652 | 657 | loc.getName(), unit.getName(), countOfPartsPerLocation.get(locId))); |
653 | 658 | } else { |
654 | 659 | campaign.addReport(String.format( |
655 | 660 | "<font color='" + |
656 | | - ReportingUtilities.getWarningColor() |
| 661 | + getWarningColor() |
657 | 662 | + |
658 | 663 | "'>Found missing location (%s) on %s which contains %s parts. Going to remove all parts before proceeding with other repairs.</font>", |
659 | 664 | loc != null ? loc.getName() : Integer.toString(locId), unit.getName(), |
|
0 commit comments