From bc6a532a5fb97d6d2c66b73d1bf5518c2ac7fcbe Mon Sep 17 00:00:00 2001 From: kuronekochomusuke Date: Thu, 10 Oct 2024 20:11:31 -0400 Subject: [PATCH] use xx-small on more items in unittooltip --- .../client/ui/swing/tooltip/UnitToolTip.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/megamek/src/megamek/client/ui/swing/tooltip/UnitToolTip.java b/megamek/src/megamek/client/ui/swing/tooltip/UnitToolTip.java index 2a28b3c97e..0f4dc65ccf 100644 --- a/megamek/src/megamek/client/ui/swing/tooltip/UnitToolTip.java +++ b/megamek/src/megamek/client/ui/swing/tooltip/UnitToolTip.java @@ -1037,7 +1037,7 @@ private static StringBuilder weaponList(Entity entity) { String msg_x = Messages.getString("BoardView1.Tooltip.X"); col1 = currentEquip.count + " " + msg_x + " "; } else { - col1 = ""; + col1 = " "; } col2 = addToTT("Weapon", false, currentEquip.count, techBase, nameStr, destStr).toString(); @@ -1046,7 +1046,7 @@ private static StringBuilder weaponList(Entity entity) { col2 = "" + col2 + ""; } } else { - col1 = ""; + col1 = " "; col2 = ""; // few weapons: list each weapon separately for (int i = 0; i < currentEquip.count; i++) { @@ -1057,12 +1057,15 @@ private static StringBuilder weaponList(Entity entity) { } col2 += "
"; } + col2 = col2.substring(1, col2.length() - 4); } ; col1 = UIUtil.fontHTML(GUIP.getUnitToolTipWeaponColor()) + col1 + ""; + col1 = "" + col1 + ""; col1 = "" + col1 + ""; col2 = UIUtil.fontHTML(GUIP.getUnitToolTipWeaponColor()) + col2 + ""; + col2 = "" + col2 + ""; col2 = "" + col2 + ""; row = "" + col1 + col2 + ""; } @@ -1147,8 +1150,10 @@ private static StringBuilder createAmmoEntry(WeaponInfo ammoInfo) { int totalAmmo = ammoInfo.ammos.values().stream().mapToInt(n -> n).sum(); if (totalAmmo == 0 && ammoInfo.ammoActiveWeaponCount > 0) { String msg_outofammo = Messages.getString("BoardView1.Tooltip.OutOfAmmo"); - col2 = "      " + msg_outofammo; + col1 = " "; + col1 = "" + col1 + ""; col1 = "" + col1 + ""; + col2 = "      " + msg_outofammo; col2 = UIUtil.fontHTML(GUIP.getCautionColor()) + col2 + ""; col2 = "" + col2 + ""; col2 = "" + col2 + ""; @@ -1163,7 +1168,7 @@ private static StringBuilder createAmmoEntry(WeaponInfo ammoInfo) { if (ammo.getValue() == 0) { continue; } - col1 = ""; + col1 = " "; col2 = "      "; String msg_shots = Messages.getString("BoardView1.Tooltip.Shots"); if (ammoInfo.ammoActiveWeaponCount > 1) { @@ -1177,6 +1182,7 @@ private static StringBuilder createAmmoEntry(WeaponInfo ammoInfo) { col2 += ammoName + ammo.getValue() + " " + msg_shots; } + col1 = "" + col1 + ""; col1 = "" + col1 + ""; col2 = UIUtil.fontHTML(GUIP.getCautionColor()) + col2 + ""; col2 = "" + col2 + ""; @@ -1202,7 +1208,8 @@ private static StringBuilder ecmInfo(Entity entity) { sECMInfo += ECM_SIGN + " " + msg_eccmsource; } - result = UIUtil.fontHTML() + sECMInfo + ""; + sECMInfo = UIUtil.fontHTML() + sECMInfo + ""; + result = "" + sECMInfo + ""; result = UIUtil.fontHTML() + result + ""; return new StringBuilder().append(result); @@ -1959,7 +1966,8 @@ private static StringBuilder carriedUnits(Entity entity) { } } - result = UIUtil.fontHTML() + sCarriedUnits + ""; + sCarriedUnits = UIUtil.fontHTML() + sCarriedUnits + ""; + result = "" + sCarriedUnits + ""; } return new StringBuilder().append(result);