Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Recalculation of Scenario Objectives when Assigning Forces #5290

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions MekHQ/src/mekhq/gui/stratcon/StratconScenarioWizard.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import java.util.*;

import static java.lang.Math.min;
import static mekhq.campaign.mission.AtBDynamicScenarioFactory.translateTemplateObjectives;
import static mekhq.campaign.personnel.SkillType.S_LEADER;
import static mekhq.campaign.stratcon.StratconRulesManager.BASE_LEADERSHIP_BUDGET;
import static mekhq.campaign.stratcon.StratconRulesManager.ReinforcementResultsType.DELAYED;
Expand Down Expand Up @@ -141,6 +142,16 @@ private void setUI() {
validate();
}

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

Expand Down Expand Up @@ -556,6 +567,8 @@ private void btnCommitClicked(ActionEvent e) {
setVisible(false);
}

translateTemplateObjectives(currentScenario.getBackingScenario(), campaign);

this.getParent().repaint();
}

Expand Down
Loading