From ad8cb63976086066dcfaf679a6ed2dbc70a39d41 Mon Sep 17 00:00:00 2001 From: kuronekochomusuke Date: Thu, 10 Oct 2024 20:47:44 -0400 Subject: [PATCH] use xx-small on even more items in unittooltip --- .../client/ui/swing/tooltip/UnitToolTip.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/megamek/src/megamek/client/ui/swing/tooltip/UnitToolTip.java b/megamek/src/megamek/client/ui/swing/tooltip/UnitToolTip.java index 0f4dc65ccf..c8b0784e1e 100644 --- a/megamek/src/megamek/client/ui/swing/tooltip/UnitToolTip.java +++ b/megamek/src/megamek/client/ui/swing/tooltip/UnitToolTip.java @@ -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 + ""; + sSeenBy = UIUtil.fontHTML() + sSeenBy + ""; + result += "" + sSeenBy + ""; } } } 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)) @@ -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 += "" + sensors + ""; } if (entity.hasAnyTypeNarcPodsAttached()) { @@ -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 + ""; + sForceEntry = UIUtil.fontHTML(color) + sForceEntry + ""; + result = "" + sForceEntry + ""; } return new StringBuilder().append(result);