Skip to content

Commit

Permalink
use xx-small on 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 1a5f474 commit bc6a532
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions megamek/src/megamek/client/ui/swing/tooltip/UnitToolTip.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -1046,7 +1046,7 @@ private static StringBuilder weaponList(Entity entity) {
col2 = "<S>" + col2 + "</S>";
}
} else {
col1 = "";
col1 = "&nbsp;";
col2 = "";
// few weapons: list each weapon separately
for (int i = 0; i < currentEquip.count; i++) {
Expand All @@ -1057,12 +1057,15 @@ private static StringBuilder weaponList(Entity entity) {
}
col2 += "<BR>";
}
col2 = col2.substring(1, col2.length() - 4);
}
;

col1 = UIUtil.fontHTML(GUIP.getUnitToolTipWeaponColor()) + col1 + "</FONT>";
col1 = "<span class=xx-small>" + col1 + "</span>";
col1 = "<TD>" + col1 + "</TD>";
col2 = UIUtil.fontHTML(GUIP.getUnitToolTipWeaponColor()) + col2 + "</FONT>";
col2 = "<span class=xx-small>" + col2 + "</span>";
col2 = "<TD>" + col2 + "</TD>";
row = "<TR>" + col1 + col2 + "</TR>";
}
Expand Down Expand Up @@ -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 = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + msg_outofammo;
col1 = "&nbsp;";
col1 = "<span class=xx-small>" + col1 + "</span>";
col1 = "<TD>" + col1 + "</TD>";
col2 = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + msg_outofammo;
col2 = UIUtil.fontHTML(GUIP.getCautionColor()) + col2 + "</FONT>";

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
UIUtil.fontHTML
should be avoided because it has been deprecated.
col2 = "<span class=xx-small>" + col2 + "</span>";
col2 = "<TD>" + col2 + "</TD>";
Expand All @@ -1163,7 +1168,7 @@ private static StringBuilder createAmmoEntry(WeaponInfo ammoInfo) {
if (ammo.getValue() == 0) {
continue;
}
col1 = "";
col1 = "&nbsp;";
col2 = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
String msg_shots = Messages.getString("BoardView1.Tooltip.Shots");
if (ammoInfo.ammoActiveWeaponCount > 1) {
Expand All @@ -1177,6 +1182,7 @@ private static StringBuilder createAmmoEntry(WeaponInfo ammoInfo) {
col2 += ammoName + ammo.getValue() + " " + msg_shots;
}

col1 = "<span class=xx-small>" + col1 + "</span>";
col1 = "<TD>" + col1 + "</TD>";
col2 = UIUtil.fontHTML(GUIP.getCautionColor()) + col2 + "</FONT>";

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
UIUtil.fontHTML
should be avoided because it has been deprecated.
col2 = "<span class=xx-small>" + col2 + "</span>";
Expand All @@ -1202,7 +1208,8 @@ private static StringBuilder ecmInfo(Entity entity) {
sECMInfo += ECM_SIGN + " " + msg_eccmsource;
}

result = UIUtil.fontHTML() + sECMInfo + "</FONT>";
sECMInfo = UIUtil.fontHTML() + sECMInfo + "</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>" + sECMInfo + "</span>";
result = UIUtil.fontHTML() + result + "</FONT>";

return new StringBuilder().append(result);
Expand Down Expand Up @@ -1959,7 +1966,8 @@ private static StringBuilder carriedUnits(Entity entity) {
}
}

result = UIUtil.fontHTML() + sCarriedUnits + "</FONT>";
sCarriedUnits = UIUtil.fontHTML() + sCarriedUnits + "</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>" + sCarriedUnits + "</span>";
}

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

0 comments on commit bc6a532

Please sign in to comment.