Skip to content

Commit

Permalink
Merge pull request #4345 from IllianiCBT/turnover_fatigueDisplay
Browse files Browse the repository at this point in the history
Updated fatigue display logic in PersonViewPanel
  • Loading branch information
IllianiCBT authored Jul 7, 2024
2 parents 17540c4 + b730e5f commit 696c960
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions MekHQ/src/mekhq/gui/view/PersonViewPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ private JPanel fillSkills() {
int loyaltyModifier = person.getLoyaltyModifier(person.getLoyalty());

if (person.isCommander()) {
loyaltyModifier = person.getLoyaltyModifier(person.getLoyalty() + 2);;
loyaltyModifier = person.getLoyaltyModifier(person.getLoyalty() + 2);
}

if ((campaign.getCampaignOptions().isUseLoyaltyModifiers())
Expand Down Expand Up @@ -1469,7 +1469,7 @@ private JPanel fillSkills() {
firsty++;
}

if ((campaign.getCampaignOptions().isUseFatigue()) && (person.getFatigue() > 0)) {
if ((campaign.getCampaignOptions().isUseFatigue()) && (person.getEffectiveFatigue(campaign) > 0)) {
lblFatigue1.setName("lblFatigue1");
lblFatigue1.setText(resourceMap.getString("lblFatigue1.text"));
gridBagConstraints = new GridBagConstraints();
Expand All @@ -1480,14 +1480,11 @@ private JPanel fillSkills() {
pnlSkills.add(lblFatigue1, gridBagConstraints);

StringBuilder fatigueDisplay = new StringBuilder();

int effectiveFatigue = person.getEffectiveFatigue(campaign);
int fatigueTurnoverModifier = MathUtility.clamp(((person.getEffectiveFatigue(campaign) - 1) / 4) - 1, 0, 3);

fatigueDisplay.append(person.getFatigue());

if (person.getFatigue() != effectiveFatigue) {
fatigueDisplay.append(" / ").append(effectiveFatigue);
}
fatigueDisplay.append(effectiveFatigue);

if (fatigueTurnoverModifier > 0) {
fatigueDisplay.append(" (-").append(fatigueTurnoverModifier).append(')');
Expand Down

0 comments on commit 696c960

Please sign in to comment.