From 08dd0b1c4c6629e448b9c91f423094638a3030a6 Mon Sep 17 00:00:00 2001 From: IllianiCBT Date: Fri, 20 Dec 2024 23:30:50 -0600 Subject: [PATCH] Simplified resupply smuggler message formatting. Refactored the message generation to combine the value string directly within the formatted output. This reduces intermediate variables and improves code clarity. --- .../gui/dialog/resupplyAndCaches/DialogItinerary.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/MekHQ/src/mekhq/gui/dialog/resupplyAndCaches/DialogItinerary.java b/MekHQ/src/mekhq/gui/dialog/resupplyAndCaches/DialogItinerary.java index 56f27ff821..4e67c4c75a 100644 --- a/MekHQ/src/mekhq/gui/dialog/resupplyAndCaches/DialogItinerary.java +++ b/MekHQ/src/mekhq/gui/dialog/resupplyAndCaches/DialogItinerary.java @@ -319,16 +319,14 @@ private static String getInitialDescription(Resupply resupply) { yield String.format(message, value); } case RESUPPLY_SMUGGLER -> { - String message = String.format( - resources.getString("guerrillaSupplies" + randomInt(25) + ".text"), - campaign.getCommanderAddress(true), getEnemyFactionReference(resupply), - resupply.getConvoyContentsValueCalculated().toAmountAndSymbolString()); - String value = String.format(resources.getString("supplyCostFull.text"), resupply.getConvoyContentsValueCalculated().toAmountAndSymbolString(), resupply.getConvoyContentsValueBase().toAmountAndSymbolString()); - yield String.format(message, value); + yield String.format( + resources.getString("guerrillaSupplies" + randomInt(25) + ".text"), + campaign.getCommanderAddress(true), getEnemyFactionReference(resupply), + resupply.getConvoyContentsValueCalculated().toAmountAndSymbolString(), value); } }; }