Skip to content

Commit 672241c

Browse files
authored
Merge pull request #5290 from IllianiCBT/stratCon_recalculateObjectives
Added Recalculation of Scenario Objectives when Assigning Forces
2 parents 8b24db0 + fb4c627 commit 672241c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

MekHQ/src/mekhq/gui/stratcon/StratconScenarioWizard.java

+13
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import java.util.*;
4444

4545
import static java.lang.Math.min;
46+
import static mekhq.campaign.mission.AtBDynamicScenarioFactory.translateTemplateObjectives;
4647
import static mekhq.campaign.personnel.SkillType.S_LEADER;
4748
import static mekhq.campaign.stratcon.StratconRulesManager.BASE_LEADERSHIP_BUDGET;
4849
import static mekhq.campaign.stratcon.StratconRulesManager.ReinforcementResultsType.DELAYED;
@@ -141,6 +142,16 @@ private void setUI() {
141142
validate();
142143
}
143144

145+
/**
146+
* Returns a concatenated string of a unit's force hierarchy, in reversed order,
147+
* starting from the highest parent Force going down to the given unit's direct Force.
148+
* <p>
149+
* If the unit does not belong to any Force, an empty string is returned.
150+
*
151+
* @param unit The Unit whose Force hierarchy names are to be returned.
152+
* @return A concatenated string of Force names in reversed order separated by a slash,
153+
* or an empty string if the unit is not assigned to any Force.
154+
*/
144155
private String getForceNameReversed(Unit unit) {
145156
List<String> forceNames = new ArrayList<>();
146157

@@ -556,6 +567,8 @@ private void btnCommitClicked(ActionEvent e) {
556567
setVisible(false);
557568
}
558569

570+
translateTemplateObjectives(currentScenario.getBackingScenario(), campaign);
571+
559572
this.getParent().repaint();
560573
}
561574

0 commit comments

Comments
 (0)