This commit is contained in:
Jess H 2024-05-27 10:21:39 +01:00
commit 5674d94163
2 changed files with 35 additions and 40 deletions

View file

@ -69,19 +69,16 @@ public class HUD extends Feature {
Left, Center, Right Left, Center, Right
} }
@Config("Notifications") @Config("Include status in length")
@Marker(1) @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.")
@Gate(Integer.MIN_VALUE) public boolean includeStatus = false;
public boolean notifications = true;
@Config("Notification location") @Config("Notification location")
@Description("Where to display notifications. Left and Right display the most recent at the top, Center displays the most recent at the bottom.") @Description("Where to display notifications. Left and Right display the most recent at the top, Center displays the most recent at the bottom.")
@Gate(1)
public NotificationLocation nLocation = NotificationLocation.Center; public NotificationLocation nLocation = NotificationLocation.Center;
@Config("Advanced") @Config("Advanced")
@Description("Show rendering controls for notifications.") @Description("Show rendering controls for notifications.")
@Gate(1)
@Marker(2) @Marker(2)
public boolean advancedNotifs = false; public boolean advancedNotifs = false;
@ -132,11 +129,10 @@ public class HUD extends Feature {
mc.fontRenderer.drawStringWithShadow("§lBaseBand§r - \"" + BaseBand.buildString + "\"", 2,2, BaseBand.getFeature(Client.class).getTheme().getGreenColor()); mc.fontRenderer.drawStringWithShadow("§lBaseBand§r - \"" + BaseBand.buildString + "\"", 2,2, BaseBand.getFeature(Client.class).getTheme().getGreenColor());
int y = 11; 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()); mc.fontRenderer.drawStringWithShadow(f.text, 2, y, BaseBand.getFeature(Client.class).getTheme().getGreenColor());
y = y + mc.fontRenderer.FONT_HEIGHT; y = y + mc.fontRenderer.FONT_HEIGHT;
} }
if(notifications) {
int dir = (nLocation == NotificationLocation.Center ? -1 : 1); int dir = (nLocation == NotificationLocation.Center ? -1 : 1);
int isCenter = (nLocation == NotificationLocation.Center ? 1 : 0); int isCenter = (nLocation == NotificationLocation.Center ? 1 : 0);
@ -174,7 +170,6 @@ public class HUD extends Feature {
y += (localYSize + nVSpace) * dir; y += (localYSize + nVSpace) * dir;
} }
} }
}
private void drawSizedBox(int x, int y, int sx, int sy, int color, boolean backwards) { private void drawSizedBox(int x, int y, int sx, int sy, int color, boolean backwards) {
Gui.drawRect(x, y, x + sx, y + sy * (backwards ? -1 : 1), color); Gui.drawRect(x, y, x + sx, y + sy * (backwards ? -1 : 1), color);

View file

@ -17,8 +17,8 @@ public class Ping extends Feature {
@Config("Seconds") @Config("Seconds")
@Description("How many seconds to add to your ping.\n" + @Description("How many seconds to add to your ping.\n" +
"§lWarning§r: You might get timed out on high settings (Time-out happens at 30 seconds including real ping).") "§lWarning§r: You might get timed out on high settings (Time-out happens at 15 seconds including real ping).")
@Range("0..28") @Range("0..14")
public int seconds; public int seconds;
@Override @Override