diff --git a/src/main/java/cc/fros/features/modules/hud/ArrayListHudModule.java b/src/main/java/cc/fros/features/modules/hud/ArrayListHudModule.java index e6ca73e..44da058 100644 --- a/src/main/java/cc/fros/features/modules/hud/ArrayListHudModule.java +++ b/src/main/java/cc/fros/features/modules/hud/ArrayListHudModule.java @@ -13,7 +13,6 @@ import java.util.Locale; public class ArrayListHudModule extends HudModule { private static final int DISABLED_COLOR = 0xFF555555; private static final int BRACKET_COLOR = 0xFFAAAAAA; - private static final int GAP = 4; public final Setting alignment = mode("Alignment", Align.RIGHT); public final Setting sort = mode("Sort", Sort.LENGTH); @@ -52,7 +51,7 @@ public class ArrayListHudModule extends HudModule { int rowWidth = nameWidth; String info = module.getDisplayInfo(); if (info != null) { - rowWidth += GAP + infoWidth(info); + rowWidth += mc.font.width(" ") + infoWidth(info); } content = Math.max(content, rowWidth); } @@ -73,13 +72,15 @@ public class ArrayListHudModule extends HudModule { e.getContext().drawString(mc.font, name, nameX, rowY, baseColor); if (info != null) { - // info sits on the opposite side of the name + // info sits directly on the opposite side of the name, + // separated by a single space instead of a gap int blockWidth = infoWidth(info); - int infoX = right ? nameX - GAP - blockWidth : nameX + nameWidth + GAP; + int space = mc.font.width(" "); + int infoX = right ? nameX - space - blockWidth : nameX + nameWidth + space; int bracketColor = on ? BRACKET_COLOR : DISABLED_COLOR; - e.getContext().drawString(mc.font, " [", infoX, rowY, bracketColor); - infoX += mc.font.width(" ["); + e.getContext().drawString(mc.font, "[", infoX, rowY, bracketColor); + infoX += mc.font.width("["); e.getContext().drawString(mc.font, info, infoX, rowY, on ? -1 : DISABLED_COLOR); infoX += mc.font.width(info); e.getContext().drawString(mc.font, "]", infoX, rowY, bracketColor); @@ -91,7 +92,7 @@ public class ArrayListHudModule extends HudModule { } private int infoWidth(String info) { - return mc.font.width(" [") + mc.font.width(info) + mc.font.width("]"); + return mc.font.width("[") + mc.font.width(info) + mc.font.width("]"); } private Comparator comparator() {