Skip to content

Commit

Permalink
use xx-small on even more items in unittooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
kuronekochomusuke committed Oct 11, 2024
1 parent bc6a532 commit ad8cb63
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions megamek/src/megamek/client/ui/swing/tooltip/UnitToolTip.java
Original file line number Diff line number Diff line change
Expand Up @@ -1600,12 +1600,14 @@ private static StringBuilder inGameValues(Entity entity, Player localPlayer, boo
if (tempList.length() > 1) {
tempList.delete(tempList.length() - 2, tempList.length());
String sSeenBy = addToTT("SeenBy", BR, tempList.toString()).toString();
result += UIUtil.fontHTML() + sSeenBy + "</FONT>";
sSeenBy = UIUtil.fontHTML() + sSeenBy + "</FONT>";

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
UIUtil.fontHTML
should be avoided because it has been deprecated.
result += "<span class=xx-small>" + sSeenBy + "</span>";
}
}
}

if (showSensors) {
String sensors = "";
// If sensors, display what sensors this unit is using
if (gameOptions.booleanOption(OptionsConstants.ADVANCED_TACOPS_SENSORS)
|| (gameOptions.booleanOption(OptionsConstants.ADVAERORULES_STRATOPS_ADVANCED_SENSORS))
Expand All @@ -1614,17 +1616,18 @@ private static StringBuilder inGameValues(Entity entity, Player localPlayer, boo
if (conditions.getLight().isDuskOrFullMoonOrMoonlessOrPitchBack()) {
visualRange += " (" + Compute.getMaxVisualRange(entity, true) + ")";
}
result += addToTT("Sensors", BR, getSensorDesc(entity), visualRange);
sensors += addToTT("Sensors", BR, getSensorDesc(entity), visualRange);
} else {
String visualRange = Compute.getMaxVisualRange(entity, false) + "";
if (conditions.getLight().isDuskOrFullMoonOrMoonlessOrPitchBack()) {
visualRange += " (" + Compute.getMaxVisualRange(entity, true) + ")";
}
result += addToTT("Visual", BR, visualRange);
sensors += addToTT("Visual", BR, visualRange);
}
if (gameOptions.booleanOption(OptionsConstants.ADVANCED_TACOPS_BAP) && entity.hasBAP()) {
result += addToTT("BAPRange", NOBR, entity.getBAPRange());
sensors += addToTT("BAPRange", NOBR, entity.getBAPRange());
}
result += "<span class=small>" + sensors + "</span>";
}

if (entity.hasAnyTypeNarcPodsAttached()) {
Expand Down Expand Up @@ -2012,7 +2015,8 @@ private static StringBuilder forceEntry(Entity entity, Player localPlayer) {
sForceEntry += forceChain.get(i).getName();
sForceEntry += i != 0 ? ", " : "";
}
result = UIUtil.fontHTML(color) + sForceEntry + "</FONT>";
sForceEntry = UIUtil.fontHTML(color) + sForceEntry + "</FONT>";

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
UIUtil.fontHTML
should be avoided because it has been deprecated.
result = "<span class=x-small>" + sForceEntry + "</span>";
}

return new StringBuilder().append(result);
Expand Down

0 comments on commit ad8cb63

Please sign in to comment.