remove gap between arraylist name and module info
info now sits tight against the name, separated only by a single space character
This commit is contained in:
@@ -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<Align> alignment = mode("Alignment", Align.RIGHT);
|
||||
public final Setting<Sort> 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<Module> comparator() {
|
||||
|
||||
Reference in New Issue
Block a user