Skip to content

Commit

Permalink
Merge pull request #3965 from kuronekochomusuke/RFE2715
Browse files Browse the repository at this point in the history
Fix #2715
  • Loading branch information
NickAragua authored Nov 11, 2022
2 parents ac6e2d8 + 31df912 commit f7715ae
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions megamek/src/megamek/client/ui/swing/tooltip/UnitToolTip.java
Original file line number Diff line number Diff line change
Expand Up @@ -775,13 +775,34 @@ private static StringBuilder entityValues(Entity entity) {
boolean isGunEmplacement = entity instanceof GunEmplacement;
// Unit movement ability
if (!isGunEmplacement) {
result.append(addToTT("Movement", NOBR, entity.getWalkMP(), entity.getRunMPasString()));
int walkMP = entity.getWalkMP(false, false,false);
int runMP = entity.getRunMP(false, false,false);
int jumpMP = entity.getJumpMP(false);
result.append(addToTT("Movement", NOBR , walkMP, runMP));

if (entity.getJumpMP() > 0) {
result.append("/" + entity.getJumpMP());
result.append("/" + jumpMP);
}
if (entity instanceof Tank) {
result.append(DOT_SPACER + entity.getMovementModeAsString());
}

int walkMPGravity = entity.getWalkMP(true, false,false);
int runMPGravity = entity.getRunMP(true, false, false);
int jumpMPGravity = entity.getJumpMP(true);

if ((walkMP != walkMPGravity) || (runMP != runMPGravity) || (jumpMP != jumpMPGravity)){
result.append(" (");
result.append(walkMPGravity);
result.append("/" + runMPGravity);
if (entity.getJumpMP() > 0) {
result.append("/" + jumpMPGravity);
}
if (entity instanceof Tank) {
result.append(DOT_SPACER + entity.getMovementModeAsString());
}
result.append(")(" + entity.getGame().getPlanetaryConditions().getGravity() + ")");
}
}

// Infantry specialization like SCUBA
Expand Down

0 comments on commit f7715ae

Please sign in to comment.