From 3987f445746c7ed1270ee00872d79b80803ce77a Mon Sep 17 00:00:00 2001 From: UnknownUser1789 Date: Thu, 19 Jan 2023 21:49:48 +0000 Subject: [PATCH] Chroma rectangles --- src/main/java/dev/resent/module/base/Mod.java | 2 ++ .../dev/resent/util/render/RenderUtils.java | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/main/java/dev/resent/module/base/Mod.java b/src/main/java/dev/resent/module/base/Mod.java index 9376637b..f3d8368d 100644 --- a/src/main/java/dev/resent/module/base/Mod.java +++ b/src/main/java/dev/resent/module/base/Mod.java @@ -59,6 +59,8 @@ public class Mod { RenderUtils.drawRect(left, top, right, bottom, new Color(255, 255, 255, 200).getRGB()); case 3: RenderUtils.drawRect(left, top, right, bottom, new Color(0, 0, 0, 140).getRGB()); + case 4: + RenderUtils.drawChromaRect(left, top, right, bottom); } } diff --git a/src/main/java/dev/resent/util/render/RenderUtils.java b/src/main/java/dev/resent/util/render/RenderUtils.java index 368a54b1..8339ae0a 100644 --- a/src/main/java/dev/resent/util/render/RenderUtils.java +++ b/src/main/java/dev/resent/util/render/RenderUtils.java @@ -66,6 +66,31 @@ public class RenderUtils { GlStateManager.disableBlend(); } + public static void drawChromaRect(int x, int y, int width, int height) { + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)(y + height), (float)0.0f); + GlStateManager.rotate((float)-90.0f, (float)0.0f, (float)0.0f, (float)1.0f); + int p_drawGradientRect_6_ = Color.HSBtoRGB((float)((System.currentTimeMillis() - (long)(x + width / 2) * 10L - (long)y * 10L) % 2000L) / 2000.0f, 0.8f, 0.8f); + float lvt_11_1_ = (float)(p_drawGradientRect_6_ >> 24 & 0xFF) / 255.0f; + float lvt_12_1_ = (float)(p_drawGradientRect_6_ >> 16 & 0xFF) / 255.0f; + float lvt_13_1_ = (float)(p_drawGradientRect_6_ >> 8 & 0xFF) / 255.0f; + float lvt_14_1_ = (float)(p_drawGradientRect_6_ & 0xFF) / 255.0f; + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.tryBlendFuncSeparate((int)770, (int)771, (int)1, (int)0); + GlStateManager.shadeModel((int)7425); + Tessellator lvt_15_1_ = Tessellator.getInstance(); + WorldRenderer lvt_16_1_ = lvt_15_1_.getWorldRenderer(); + lvt_16_1_.begin(7, DefaultVertexFormats.POSITION_COLOR); + lvt_16_1_.pos((double)height, (double)width, 0).color(lvt_12_1_, lvt_13_1_, lvt_14_1_, lvt_11_1_).endVertex(); + lvt_15_1_.draw(); + GlStateManager.shadeModel((int)7424); + GlStateManager.disableBlend(); + GlStateManager.enableTexture2D(); + GlStateManager.popMatrix(); + } + public static Color getColorWithoutRGB(ModeSetting asdf) { switch (asdf.getValue()) { case "Red":