From 3b9715f1ff9f329ae8a45f8b5b199af794a64384 Mon Sep 17 00:00:00 2001 From: IllianiCBT Date: Wed, 4 Dec 2024 13:08:53 -0600 Subject: [PATCH] Simplify briefing text handling in AtBScenarioModifier. Revised the method handling briefing text to eliminate redundant modifier names, ensuring clarity and consistency in scenario presentations. Also adjusted formatting in StratconRulesManager to maintain consistency between components. These changes improve both readability and maintainability of the code base. --- .../mission/atb/AtBScenarioModifier.java | 21 +++++++++---------- .../stratcon/StratconRulesManager.java | 5 ++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/MekHQ/src/mekhq/campaign/mission/atb/AtBScenarioModifier.java b/MekHQ/src/mekhq/campaign/mission/atb/AtBScenarioModifier.java index fb75a507ee..87f3f6f407 100644 --- a/MekHQ/src/mekhq/campaign/mission/atb/AtBScenarioModifier.java +++ b/MekHQ/src/mekhq/campaign/mission/atb/AtBScenarioModifier.java @@ -18,16 +18,6 @@ */ package mekhq.campaign.mission.atb; -import java.io.File; -import java.io.FileInputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; -import javax.xml.transform.Source; - import jakarta.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBElement; import jakarta.xml.bind.Marshaller; @@ -47,6 +37,15 @@ import mekhq.campaign.mission.ScenarioObjective; import mekhq.utilities.MHQXMLUtility; +import javax.xml.namespace.QName; +import javax.xml.transform.Source; +import java.io.File; +import java.io.FileInputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * Data structure representing a scenario modifier for dynamic AtB scenarios * @@ -367,7 +366,7 @@ public void processModifier(AtBDynamicScenario scenario, Campaign campaign, Even if (eventTiming == getEventTiming()) { if ((getAdditionalBriefingText() != null) && !getAdditionalBriefingText().isBlank()) { AtBScenarioModifierApplicator.appendScenarioBriefingText(scenario, - String.format("%s: %s", getModifierName(), getAdditionalBriefingText())); + getAdditionalBriefingText()); } if (getForceDefinition() != null) { diff --git a/MekHQ/src/mekhq/campaign/stratcon/StratconRulesManager.java b/MekHQ/src/mekhq/campaign/stratcon/StratconRulesManager.java index a87ad37985..cad280c902 100644 --- a/MekHQ/src/mekhq/campaign/stratcon/StratconRulesManager.java +++ b/MekHQ/src/mekhq/campaign/stratcon/StratconRulesManager.java @@ -1582,9 +1582,8 @@ private static void applyFacilityModifiers(StratconScenario scenario, StratconTr continue; } - modifier.setAdditionalBriefingText( - "(from " + facility.getDisplayableName() + ") " + - modifier.getAdditionalBriefingText()); + modifier.setAdditionalBriefingText('(' + facility.getDisplayableName() + ") " + + modifier.getAdditionalBriefingText()); scenario.getBackingScenario().addScenarioModifier(modifier); } }