From b730e5fa85b3cfcbb930f57d4412d88ff34ded86 Mon Sep 17 00:00:00 2001 From: IllianiCBT Date: Fri, 5 Jul 2024 16:29:49 -0500 Subject: [PATCH] Updated fatigue display logic in PersonViewPanel The code for displaying and calculating the fatigue value in PersonViewPanel has been modified to display only effective fatigue. --- MekHQ/src/mekhq/gui/view/PersonViewPanel.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/MekHQ/src/mekhq/gui/view/PersonViewPanel.java b/MekHQ/src/mekhq/gui/view/PersonViewPanel.java index 865fc6677d..91042368bc 100644 --- a/MekHQ/src/mekhq/gui/view/PersonViewPanel.java +++ b/MekHQ/src/mekhq/gui/view/PersonViewPanel.java @@ -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()) @@ -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(); @@ -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(')');