Skip to content

Commit

Permalink
Simplified Reputation Display
Browse files Browse the repository at this point in the history
Displaying Reputation and AtB Modifier was causing confusion. Especially as the AtB Modifier isn't a consistent value, with it simply being a base modifier that is further modified by the individual AtB legacy systems.

This PR removes the AtB modifier from the Reputation display.
  • Loading branch information
IllianiCBT committed Oct 21, 2024
1 parent f4ebf81 commit 8eaade6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions MekHQ/src/mekhq/campaign/Campaign.java
Original file line number Diff line number Diff line change
Expand Up @@ -2250,13 +2250,11 @@ private void updatePartInUseData(PartInUse partInUse, Part incomingPart,
boolean ignoreMothballedUnits, PartQuality ignoreSparesUnderQuality) {

if (ignoreMothballedUnits && (null != incomingPart.getUnit()) && incomingPart.getUnit().isMothballed()) {
return;
} else if ((incomingPart.getUnit() != null) || (incomingPart instanceof MissingPart)) {
partInUse.setUseCount(partInUse.getUseCount() + getQuantity(incomingPart));
} else {
if (incomingPart.isPresent()) {
if (incomingPart.getQuality().toNumeric() < ignoreSparesUnderQuality.toNumeric()) {
return;
} else {
partInUse.setStoreCount(partInUse.getStoreCount() + getQuantity(incomingPart));
partInUse.addSpare(incomingPart);
Expand All @@ -2273,7 +2271,7 @@ private void updatePartInUseData(PartInUse partInUse, Part incomingPart,
* @param ignoreMothballedUnits don't count parts in mothballed units
* @param ignoreSparesUnderQuality don't count spare parts lower than this quality
*/
public void updatePartInUse(PartInUse partInUse, boolean ignoreMothballedUnits,
public void updatePartInUse(PartInUse partInUse, boolean ignoreMothballedUnits,
PartQuality ignoreSparesUnderQuality) {
partInUse.setUseCount(0);
partInUse.setStoreCount(0);
Expand All @@ -2290,7 +2288,7 @@ public void updatePartInUse(PartInUse partInUse, boolean ignoreMothballedUnits,
PartInUse newPiu = getPartInUse((Part) maybePart);
if (partInUse.equals(newPiu)) {
partInUse.setPlannedCount(partInUse.getPlannedCount()
+ getQuantity((maybePart instanceof MissingPart) ?
+ getQuantity((maybePart instanceof MissingPart) ?
((MissingPart) maybePart).getNewPart() :
(Part) maybePart) * maybePart.getQuantity());
}
Expand Down Expand Up @@ -2334,7 +2332,7 @@ public Set<PartInUse> getPartsInUse(boolean ignoreMothballedUnits,
inUse.put(partInUse, partInUse);
}
partInUse.setPlannedCount(partInUse.getPlannedCount()
+ getQuantity((maybePart instanceof MissingPart) ?
+ getQuantity((maybePart instanceof MissingPart) ?
((MissingPart) maybePart).getNewPart() :
(Part) maybePart) * maybePart.getQuantity());

Expand Down Expand Up @@ -6950,10 +6948,7 @@ public String getUnitRatingText() {
if (unitRatingMethod.isFMMR()) {
return getUnitRating().getUnitRating();
} else if (unitRatingMethod.isCampaignOperations()) {
int reputationRating = reputation.getReputationRating();
int unitRatingMod = getAtBUnitRatingMod();

return String.format("%d (%+d)", reputationRating, unitRatingMod);
return String.valueOf(reputation.getReputationRating());
} else {
return "N/A";
}
Expand Down Expand Up @@ -8002,7 +7997,7 @@ private String doMaintenanceOnUnitPart(Unit u, Part p, Map<Part, Integer> partsT
// }
break;
}
if (p.getQuality().toNumeric() > oldQuality.toNumeric()) {
if (p.getQuality().toNumeric() > oldQuality.toNumeric()) {
partReport += ": " + ReportingUtilities.messageSurroundedBySpanWithColor(
MekHQ.getMHQOptions().getFontColorPositiveHexColor(),
"new quality is " + p.getQualityName());
Expand Down

0 comments on commit 8eaade6

Please sign in to comment.