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

Updated fatigue display logic in PersonViewPanel #4345

Merged
merged 1 commit into from
Jul 7, 2024
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
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