diff --git a/src/main/java/com/syuto/bytes/module/impl/render/Hud.java b/src/main/java/com/syuto/bytes/module/impl/render/Hud.java index a99e8b8..e5703e4 100644 --- a/src/main/java/com/syuto/bytes/module/impl/render/Hud.java +++ b/src/main/java/com/syuto/bytes/module/impl/render/Hud.java @@ -6,6 +6,7 @@ import com.syuto.bytes.module.Module; import com.syuto.bytes.module.ModuleManager; import com.syuto.bytes.module.api.Category; +import com.syuto.bytes.setting.impl.ModeSetting; import com.syuto.bytes.utils.impl.render.RenderUtils; import dev.blend.util.render.Alignment; import dev.blend.util.render.DrawUtil; @@ -29,6 +30,8 @@ public class Hud extends Module { public static HashMap modules = new HashMap<>(); public List sortedModules = List.of(); + public ModeSetting modes = new ModeSetting("ColorMode", this, "White", "Red", "TransFlag"); + private String colorstuff; public Hud() { super("Hud", "hud bro", Category.RENDER); @@ -46,6 +49,23 @@ public Hud() { ); + private List whiteColors = Arrays.asList( + new Color(255, 255, 255), + new Color(255, 255, 255), + new Color(255, 255, 255), + new Color(255, 255, 255), + new Color(255, 255, 255) + ); + + private List redColors = Arrays.asList( + new Color(255, 0, 0), + new Color(200, 0, 0), + new Color(150, 0, 0), + new Color(100, 0, 0), + new Color(50, 0, 0) + ); + + @EventHandler void onPreUpdate(PreUpdateEvent event) { sortedModules = ModuleManager.modules.stream() @@ -73,20 +93,28 @@ public void onRenderTick(RenderTickEvent event) { int yPosition = 1; int colorIndex = 0; + List activeColors; - - //matrices.push(); - //DrawUtil.begin(); + if (modes.getValue().equals("White")) { + activeColors = whiteColors; + } else if (modes.getValue().equals("Red")) { + activeColors = redColors; + } else if (modes.getValue().equals("TransFlag")) { + activeColors = transFlagColors; + } else { + activeColors = whiteColors; + } for (Module mod : sortedModules) { String moduleName = mod.getName(); Module module = ModuleManager.getModule(moduleName.toLowerCase()); if (module != null) { String suffix = module.getSuffix(); - String displayText = suffix.isEmpty() ? moduleName : moduleName + Formatting.GRAY + " " + suffix; - - Color currentColor = transFlagColors.get(colorIndex % transFlagColors.size()); + String displayText = suffix.isEmpty() + ? moduleName + : moduleName + Formatting.GRAY + " " + suffix; + Color currentColor = activeColors.get(colorIndex % activeColors.size()); int textWidth = mc.textRenderer.getWidth(displayText); int xPosition = screenWidth - textWidth - 2; @@ -96,28 +124,11 @@ public void onRenderTick(RenderTickEvent event) { xPosition, yPosition, currentColor.getRGB() - ); + yPosition += mc.textRenderer.fontHeight + 3; colorIndex++; } } - - //Vec3d pos = mc.player.getPos(); - //String text = String.format("%.1f", pos.x) + " X " + String.format("%.1f", pos.y) + " Y " + String.format("%.1f", pos.x) + " Z"; - - /*RenderUtils.drawText( - event.context, - text, - 10, - 10, - cyan.getRGB() - - );*/ - - - //DrawUtil.end(); - //matrices.pop(); } -} - +} \ No newline at end of file diff --git a/src/main/java/com/syuto/bytes/utils/impl/render/RenderUtils.java b/src/main/java/com/syuto/bytes/utils/impl/render/RenderUtils.java index 1213f1f..535fdd1 100644 --- a/src/main/java/com/syuto/bytes/utils/impl/render/RenderUtils.java +++ b/src/main/java/com/syuto/bytes/utils/impl/render/RenderUtils.java @@ -262,7 +262,7 @@ public static void drawText(DrawContext context, String text, float x, float y, (int) x, (int) y, color, - false + true );