allow setting whether status is included in length

This commit is contained in:
Daniella / Tove 2024-05-27 11:11:41 +02:00
parent f3dfd97030
commit c024ac10b7

View file

@ -69,6 +69,10 @@ public class HUD extends Feature {
Left, Center, Right
}
@Config("Include status in length")
@Description("By default, status (greyed out information tucked on the end of module names) is not factored into the sorting. This setting lets you change that.")
public boolean includeStatus = false;
@Config("Notifications")
@Marker(1)
@Gate(Integer.MIN_VALUE)
@ -132,7 +136,7 @@ public class HUD extends Feature {
mc.fontRenderer.drawStringWithShadow("§lBaseBand§r - \"" + BaseBand.buildString + "\"", 2,2, BaseBand.getFeature(Client.class).getTheme().getGreenColor());
int y = 11;
for (Feature f : Arrays.stream(features).filter(m -> m.enabled && m.category != Category.COMMAND && m.getClass() != Client.class && m != this).sorted(Comparator.comparingDouble(value -> -Minecraft.getMinecraft().fontRenderer.getStringWidth(value.toString()))).toArray(Feature[]::new)) {
for (Feature f : Arrays.stream(features).filter(m -> m.enabled && m.category != Category.COMMAND && m.getClass() != Client.class && m != this).sorted(Comparator.comparingDouble(value -> -Minecraft.getMinecraft().fontRenderer.getStringWidth(includeStatus ? value.text : value.toString()))).toArray(Feature[]::new)) {
mc.fontRenderer.drawStringWithShadow(f.text, 2, y, BaseBand.getFeature(Client.class).getTheme().getGreenColor());
y = y + mc.fontRenderer.FONT_HEIGHT;
}