This commit is contained in:
ThisIsALegitUsername 2023-02-27 14:31:35 +00:00
parent 3ee80fcef1
commit 3d81d001f5
6 changed files with 27282 additions and 27296 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,14 +1,13 @@
package dev.resent.module.base; package dev.resent.module.base;
import dev.resent.annotation.Module;
import dev.resent.module.base.setting.Setting;
import dev.resent.util.render.RenderUtils;
import dev.resent.visual.ui.Theme;
import dev.resent.visual.ui.animation.SimpleAnimation;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import dev.resent.annotation.Module;
import dev.resent.module.base.setting.Setting;
import dev.resent.util.render.RenderUtils;
import dev.resent.visual.ui.animation.SimpleAnimation;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
public abstract class Mod { public abstract class Mod {
@ -16,11 +15,11 @@ public abstract class Mod {
protected Minecraft mc = Minecraft.getMinecraft(); protected Minecraft mc = Minecraft.getMinecraft();
private String name; private String name;
private Category category; private Category category;
private boolean enabled = false; private boolean enabled;
private boolean hasSetting; private boolean hasSetting;
public boolean expanded; public boolean expanded;
public int index; public int index;
public SimpleAnimation animation = new SimpleAnimation(0); public SimpleAnimation toggleAnimation = new SimpleAnimation(0);
public List<Setting> settings = new ArrayList<>(); public List<Setting> settings = new ArrayList<>();
@ -57,7 +56,7 @@ public abstract class Mod {
} }
protected void drawRect(final int left, final int top, final int right, final int bottom, final int color) { protected void drawRect(final int left, final int top, final int right, final int bottom, final int color) {
RenderUtils.drawRoundedRect(left, top, right, bottom, 4, color, Theme.getRounded()); RenderUtils.drawRoundedRect(left, top, right, bottom, 4, color);
} }
protected int drawString(final String text, final int x, final int y, final int color, final boolean idk) { protected int drawString(final String text, final int x, final int y, final int color, final boolean idk) {

View File

@ -1,17 +1,16 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.setting.BooleanSetting;
import dev.resent.module.base.setting.ModeSetting;
import dev.resent.module.base.RenderMod;
import dev.resent.util.misc.FuncUtils;
import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils;
import dev.resent.visual.ui.Theme;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod;
import dev.resent.module.base.setting.BooleanSetting;
import dev.resent.module.base.setting.ModeSetting;
import dev.resent.util.misc.FuncUtils;
import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils;
import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -81,23 +80,23 @@ public class KeyStrokes extends RenderMod {
} }
//W //W
RenderUtils.drawRoundedRect(this.x + 30, this.y + 3, this.x + 55, this.y + 25 + 3, 4, wKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded()); RenderUtils.drawRoundedRect(this.x + 30, this.y + 3, this.x + 55, this.y + 25 + 3, 4, wKey ? getColor(gcolor) : getColor(gcolorp));
// S // S
RenderUtils.drawRoundedRect(this.x + 30, this.y + 30, this.x + 55, this.y + 55, 4, sKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded()); RenderUtils.drawRoundedRect(this.x + 30, this.y + 30, this.x + 55, this.y + 55, 4, sKey ? getColor(gcolor) : getColor(gcolorp));
// A // A
RenderUtils.drawRoundedRect(this.x + 3, this.y + 30, this.x + 25 + 3, this.y + 55, 4, aKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded()); RenderUtils.drawRoundedRect(this.x + 3, this.y + 30, this.x + 25 + 3, this.y + 55, 4, aKey ? getColor(gcolor) : getColor(gcolorp));
// D // D
RenderUtils.drawRoundedRect(this.x + 60 - 3, this.y + 30, this.x + 85 - 3, this.y + 25 + 5 + 25, 4, dKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded()); RenderUtils.drawRoundedRect(this.x + 60 - 3, this.y + 30, this.x + 85 - 3, this.y + 25 + 5 + 25, 4, dKey ? getColor(gcolor) : getColor(gcolorp));
// LMB // LMB
RenderUtils.drawRoundedRect(this.x + 3, this.y + 57, this.x + 41, this.y + 82, 4, pressed ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded()); RenderUtils.drawRoundedRect(this.x + 3, this.y + 57, this.x + 41, this.y + 82, 4, pressed ? getColor(gcolor) : getColor(gcolorp));
// RMB // RMB
RenderUtils.drawRoundedRect(this.x + 45 - 1, this.y + 60 - 3, this.x + 85 - 3, this.y + 85 - 3, 4, rpressed ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded()); RenderUtils.drawRoundedRect(this.x + 45 - 1, this.y + 60 - 3, this.x + 85 - 3, this.y + 85 - 3, 4, rpressed ? getColor(gcolor) : getColor(gcolorp));
// Jump // Jump
if (jump.getValue()) RenderUtils.drawRoundedRect(this.x + 3, this.y + 84, this.x + 85 - 3, this.y + 105 - 6, 4, jumpKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded()); if (jump.getValue()) RenderUtils.drawRoundedRect(this.x + 3, this.y + 84, this.x + 85 - 3, this.y + 105 - 6, 4, jumpKey ? getColor(gcolor) : getColor(gcolorp));
// Sneak // Sneak
if (sneak.getValue()) RenderUtils.drawRoundedRect(this.x + 3, jump.getValue() ? this.y + 102 : this.y + 84, this.x + 85 - 3, jump.getValue() ? this.y + 120 - 3 : this.y + 105 - 6, 4, mc.gameSettings.keyBindSneak.pressed ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded()); if (sneak.getValue()) RenderUtils.drawRoundedRect(this.x + 3, jump.getValue() ? this.y + 102 : this.y + 84, this.x + 85 - 3, jump.getValue() ? this.y + 120 - 3 : this.y + 105 - 6, 4, mc.gameSettings.keyBindSneak.pressed ? getColor(gcolor) : getColor(gcolorp));
mc.fontRendererObj.drawString("W", this.x + 25 + 5 + (25 / 2 - mc.fontRendererObj.getStringWidth("W") + 4), this.y + 8 + 3, wKey ? getColor(colorp) : getColor(color), tshadow.getValue()); mc.fontRendererObj.drawString("W", this.x + 25 + 5 + (25 / 2 - mc.fontRendererObj.getStringWidth("W") + 4), this.y + 8 + 3, wKey ? getColor(colorp) : getColor(color), tshadow.getValue());
mc.fontRendererObj.drawString("S", this.x + 25 + 5 + (25 / 2 - mc.fontRendererObj.getStringWidth("S") + 4), this.y + 38, sKey ? getColor(colorp) : getColor(color), tshadow.getValue()); mc.fontRendererObj.drawString("S", this.x + 25 + 5 + (25 / 2 - mc.fontRendererObj.getStringWidth("S") + 4), this.y + 38, sKey ? getColor(colorp) : getColor(color), tshadow.getValue());

View File

@ -1,6 +1,7 @@
package dev.resent.util.render; package dev.resent.util.render;
import dev.resent.module.base.setting.ModeSetting; import dev.resent.module.base.setting.ModeSetting;
import dev.resent.visual.ui.Theme;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -55,13 +56,13 @@ public class RenderUtils {
return Color.HSBtoRGB(hue, 0.5f, 1f); return Color.HSBtoRGB(hue, 0.5f, 1f);
} }
public static void drawRoundedRect(final float paramInt1, final float paramInt2, final float paramInt3, final float paramInt4, final float radius, final int color, boolean... rounded) { public static void drawRoundedRect(final float paramInt1, final float paramInt2, final float paramInt3, final float paramInt4, final float radius, final int color, boolean... forceOverride) {
final float f1 = (color >> 24 & 0xFF) / 255.0f; final float f1 = (color >> 24 & 0xFF) / 255.0f;
final float f2 = (color >> 16 & 0xFF) / 255.0f; final float f2 = (color >> 16 & 0xFF) / 255.0f;
final float f3 = (color >> 8 & 0xFF) / 255.0f; final float f3 = (color >> 8 & 0xFF) / 255.0f;
final float f4 = (color & 0xFF) / 255.0f; final float f4 = (color & 0xFF) / 255.0f;
GlStateManager.color(f2, f3, f4, f1); GlStateManager.color(f2, f3, f4, f1);
if (rounded[0]) { if (Theme.getRounded() || forceOverride[0]) {
drawRoundedRect(paramInt1, paramInt2, paramInt3, paramInt4, radius); drawRoundedRect(paramInt1, paramInt2, paramInt3, paramInt4, radius);
} else { } else {
Gui.drawRect((int) paramInt1, (int) paramInt2, (int) paramInt3, (int) paramInt4, color); Gui.drawRect((int) paramInt1, (int) paramInt2, (int) paramInt3, (int) paramInt4, color);

View File

@ -14,7 +14,6 @@ import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils; import dev.resent.util.render.RenderUtils;
import dev.resent.visual.ui.animation.Animation; import dev.resent.visual.ui.animation.Animation;
import dev.resent.visual.ui.animation.Direction; import dev.resent.visual.ui.animation.Direction;
import dev.resent.visual.ui.animation.SimpleAnimation;
import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -153,9 +152,6 @@ public class ClickGUI extends GuiScreen {
fr.drawString("X", width + 18, height - 2, -1); fr.drawString("X", width + 18, height - 2, -1);
//categories //categories
//RenderUtils.drawRectOutline(x+0.8d, height+14, x+20, height+25, -1);
//RenderUtils.drawRectOutline(x+23d, height+14, x+47, height+25, -1);
//RenderUtils.drawRectOutline(x+50, height+14, x+75, height+25, -1);
drawRect(x+0.8d, height+14, x+20, height+25, isMouseInside(mouseX, mouseY, x, height+14, x+20, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB()); drawRect(x+0.8d, height+14, x+20, height+25, isMouseInside(mouseX, mouseY, x, height+14, x+20, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB());
drawRect(x+23d, height+14, x+47, height+25, isMouseInside(mouseX, mouseY, x+24, height+14, x+46, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB()); drawRect(x+23d, height+14, x+47, height+25, isMouseInside(mouseX, mouseY, x+24, height+14, x+46, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB());
drawRect(x+50, height+14, x+75, height+25, isMouseInside(mouseX, mouseY, x+50, height+14, x+74, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB()); drawRect(x+50, height+14, x+75, height+25, isMouseInside(mouseX, mouseY, x+50, height+14, x+74, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB());
@ -172,10 +168,11 @@ public class ClickGUI extends GuiScreen {
if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 30 - fh * (-off) + 30 + 2 - offset < y + 20 && introAnimation.isDone()) { if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 30 - fh * (-off) + 30 + 2 - offset < y + 20 && introAnimation.isDone()) {
// Enabled outline // Enabled outline
m.animation.setAnimation(m.isEnabled() ? 20 : 0, 5); m.toggleAnimation.setAnimation(m.isEnabled() ? 20 : 0, 5);
//RenderUtils.drawRoundedRect(this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset, this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset, 4, m.isEnabled() ? Color.GREEN.getRGB() : Color.RED.getRGB(), true); //RenderUtils.drawRoundedRect(this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset, this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset, 4, m.isEnabled() ? Color.GREEN.getRGB() : Color.RED.getRGB(), true);
RenderUtils.drawRoundedRect(this.x+48+xo, height-2-fh*-(off)+50-1-offset+15, this.x+80+xo, height+30-fh*-off+30+2-offset+10, 5, -1, true); RenderUtils.drawRoundedRect(this.x+48+xo, height-2-fh*-(off)+50-1-offset+15, this.x+80+xo, height+30-fh*-off+30+2-offset+10, 5, new Color(221, 219, 224).getRGB(), true);
RenderUtils.drawRoundedRect(this.x+48+xo+m.animation.getValue(), height-2-fh*-(off)+50-1-offset+15, this.x+60+xo+m.animation.getValue(), height+30-fh*-off+30+2-offset+10, 5, 0xFF990000, true); RenderUtils.drawRoundedRect(this.x+48+xo, height-2-fh*-(off)+50-1-offset+15, this.x+60+xo+m.toggleAnimation.getValue(), height+30-fh*-off+30+2-offset+10, 5, Color.green.getRGB(), true);
RenderUtils.drawRoundedRect(this.x+48+xo+m.toggleAnimation.getValue(), height-2-fh*-(off)+50-1-offset+15, this.x+60+xo+m.toggleAnimation.getValue(), height+30-fh*-off+30+2-offset+10, 5, -1, true);
drawRect( drawRect(
this.x + 10 + xo - 1 + 10, this.x + 10 + xo - 1 + 10,
@ -187,7 +184,6 @@ public class ClickGUI extends GuiScreen {
if (m.isHasSetting()) { if (m.isHasSetting()) {
GlStateManager.enableBlend(); GlStateManager.enableBlend();
GlStateManager.color(1, 1, 1);
this.mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear.png")); this.mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear.png"));
Gui.drawModalRectWithCustomSizedTexture(this.x + 99 + xo, height - 2 - fh * -(off) + 51 + 1 - offset, 0, 0, 8, 8, 8, 8); Gui.drawModalRectWithCustomSizedTexture(this.x + 99 + xo, height - 2 - fh * -(off) + 51 + 1 - offset, 0, 0, 8, 8, 8, 8);
GlStateManager.disableBlend(); GlStateManager.disableBlend();
@ -212,7 +208,6 @@ public class ClickGUI extends GuiScreen {
drawRect(this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1, isMouseInside(mouseX, mouseY, this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1) ? new Color(211, 211, 211, 65).getRGB() : new Color(105, 105, 105, 65).getRGB()); drawRect(this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1, isMouseInside(mouseX, mouseY, this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1) ? new Color(211, 211, 211, 65).getRGB() : new Color(105, 105, 105, 65).getRGB());
fr.drawStringWithShadow(s.name, this.x + 18 + 6, height - fr.FONT_HEIGHT + 50 + var, -1); fr.drawStringWithShadow(s.name, this.x + 18 + 6, height - fr.FONT_HEIGHT + 50 + var, -1);
if (((BooleanSetting)s).getValue()) { if (((BooleanSetting)s).getValue()) {
GlStateManager.color(1, 1, 1);
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/check.png")); mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/check.png"));
Gui.drawModalRectWithCustomSizedTexture(this.x + 9, height + 39 + var, 0, 0, 12, 12, 12, 12); Gui.drawModalRectWithCustomSizedTexture(this.x + 9, height + 39 + var, 0, 0, 12, 12, 12, 12);
} }