This commit is contained in:
UnknownUser1789 2023-01-19 19:36:49 +00:00
parent 9c172f251d
commit 3c6e672b2f
12 changed files with 29772 additions and 29708 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,12 +1,15 @@
package dev.resent.module.base;
import dev.resent.Resent;
import dev.resent.event.impl.Event;
import dev.resent.setting.Setting;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import dev.resent.Resent;
import dev.resent.event.impl.Event;
import dev.resent.module.Theme;
import dev.resent.setting.Setting;
import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils;
import net.minecraft.client.Minecraft;
public class Mod {
@ -37,7 +40,6 @@ public class Mod {
}
public void onEnable() {}
public void onDisable() {}
public void toggle() {
@ -49,10 +51,20 @@ public class Mod {
}
}
protected void drawRect(int left, int top, int right, int bottom, int color){
switch(Theme.getId()){
case 1:
RenderUtils.drawRect(left, top, right, bottom, color);
case 2:
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());
}
}
public void onEvent(Event e) {
for (int i = 0; i < Resent.INSTANCE.modManager.modules.size(); i++) {
if (!Resent.INSTANCE.modManager.modules.get(i).isEnabled()) continue;
Resent.INSTANCE.modManager.modules.get(i).onEvent(e);
}
}
@ -62,11 +74,7 @@ public class Mod {
if (this.enabled) onEnable(); else onDisable();
}
public boolean isEnabled() {
return enabled;
}
public boolean isEnabled() { return enabled; }
public String getName() { return name; }
public String getName() {
return name;
}
}

View File

@ -58,11 +58,11 @@ public class RenderModule extends Mod {
boolean hovered = mouseX >= getX() && mouseY >= getY() && mouseX < getX() + getWidth() && mouseY < getY() + this.getHeight();
Gui.drawRect(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), hovered ? 0x50FFFFFF : 0x40FFFFFF);
Gui.drawRect(this.x, this.y, this.x + this.getWidth(), this.y + 1, -1);
Gui.drawRect(this.x, this.y, this.x + 1, this.y + getHeight(), -1);
Gui.drawRect(this.x + this.getWidth() - 1, this.y, this.x + getWidth(), this.y + this.getHeight(), -1);
Gui.drawRect(this.x, this.y + this.getHeight() - 1, this.x + getWidth(), this.y + this.getHeight(), -1);
drawRect(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), hovered ? 0x50FFFFFF : 0x40FFFFFF);
drawRect(this.x, this.y, this.x + this.getWidth(), this.y + 1, -1);
drawRect(this.x, this.y, this.x + 1, this.y + getHeight(), -1);
drawRect(this.x + this.getWidth() - 1, this.y, this.x + getWidth(), this.y + this.getHeight(), -1);
drawRect(this.x, this.y + this.getHeight() - 1, this.x + getWidth(), this.y + this.getHeight(), -1);
boolean mouseOverX = (mouseX >= this.getX() && mouseX <= this.getX() + this.getWidth());
boolean mouseOverY = (mouseY >= this.getY() && mouseY <= this.getY() + this.getHeight());

View File

@ -32,7 +32,7 @@ public class Info extends RenderModule {
int pz = (int) mc.thePlayer.posZ;
//int rot = MathHelper.floor_double(this.mc.thePlayer.rotationYaw*4/360+0.5) & 3;
if (mc.thePlayer != null) {
Gui.drawRect(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), new Color(0, 0, 0, 200).getRGB());
drawRect(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), new Color(0, 0, 0, 200).getRGB());
mc.fontRendererObj.drawStringWithShadow(" X: " + px, this.x + 5, this.y + 14, -1);
mc.fontRendererObj.drawStringWithShadow(" Y: " + py, this.x + 5, this.y + 24, -1);
mc.fontRendererObj.drawStringWithShadow(" Z: " + pz, this.x + 5, this.y + 34, -1);

View File

@ -10,7 +10,6 @@ import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
public class KeyStrokes extends RenderModule {
public static KeyStrokes INSTANCE = new KeyStrokes();
@ -59,23 +58,23 @@ public class KeyStrokes extends RenderModule {
if (!transparent.getValue()) {
//W
Gui.drawRect(this.x + 30, this.y + 3, this.x + 55, this.y + 25 + 3, wKey ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
drawRect(this.x + 30, this.y + 3, this.x + 55, this.y + 25 + 3, wKey ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// S
Gui.drawRect(this.x + 30, this.y + 30, this.x + 55, this.y + 55, sKey ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
drawRect(this.x + 30, this.y + 30, this.x + 55, this.y + 55, sKey ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// A
Gui.drawRect(this.x + 3, this.y + 30, this.x + 25 + 3, this.y + 55, aKey ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
drawRect(this.x + 3, this.y + 30, this.x + 25 + 3, this.y + 55, aKey ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// D
Gui.drawRect(this.x + 60 - 3, this.y + 30, this.x + 85 - 3, this.y + 25 + 5 + 25, dKey ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
drawRect(this.x + 60 - 3, this.y + 30, this.x + 85 - 3, this.y + 25 + 5 + 25, dKey ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// LMB
Gui.drawRect(this.x + 3, this.y + 57, this.x + 41, this.y + 82, pressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
drawRect(this.x + 3, this.y + 57, this.x + 41, this.y + 82, pressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// RMB
Gui.drawRect(this.x + 45 - 1, this.y + 60 - 3, this.x + 85 - 3, this.y + 85 - 3, rpressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
drawRect(this.x + 45 - 1, this.y + 60 - 3, this.x + 85 - 3, this.y + 85 - 3, rpressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// Jump
if (jump.getValue()) Gui.drawRect(this.x + 3, this.y + 84, this.x + 85 - 3, this.y + 105 - 6, spaceKey ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
if (jump.getValue()) drawRect(this.x + 3, this.y + 84, this.x + 85 - 3, this.y + 105 - 6, spaceKey ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
// Sneak
if (sneak.getValue()) Gui.drawRect(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, mc.gameSettings.keyBindSneak.pressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
if (sneak.getValue()) drawRect(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, mc.gameSettings.keyBindSneak.pressed ? RenderUtils.getColor(gcolor) : RenderUtils.getColor(gcolorp));
}
mc.fontRendererObj.drawString("W", this.x + 25 + 5 + (25 / 2 - mc.fontRendererObj.getStringWidth("W") + 4), this.y + 8 + 3, chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : wKey ? RenderUtils.getColor(colorp) : RenderUtils.getColor(color), tshadow.getValue());

View File

@ -125,10 +125,10 @@ public class ClickGUI extends GuiScreen {
GlUtils.startScale(((this.x) + (this.x + this.width)) / 2, ((this.y) + (this.y + this.height)) / 2, (float) introAnimation.getValue());
// background
Gui.drawRect(x - 10, y + 20, width + 35, height - 10, new Color(35, 39, 42, 200).getRGB());
drawRect(x - 10, y + 20, width + 35, height - 10, new Color(35, 39, 42, 200).getRGB());
fr.drawString(Resent.NAME + " Client " + Resent.VERSION, x + 8, height - 2, -1);
RenderUtils.drawRectOutline(GuiScreen.width / 2 - fr.getStringWidth("Edit Layout") / 2 - 5, GuiScreen.height - y - fr.FONT_HEIGHT, GuiScreen.width / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout"), GuiScreen.height - y + 5, -1);
Gui.drawRect(
drawRect(
GuiScreen.width / 2 - fr.getStringWidth("Edit Layout") / 2 - 4,
GuiScreen.height - y - fr.FONT_HEIGHT + 1,
GuiScreen.width / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout") - 1,
@ -144,14 +144,14 @@ public class ClickGUI extends GuiScreen {
GlUtils.stopScale();
// white line
Gui.drawRect(x - 8, height + 29, width + 33, height + 30, -1);
drawRect(x - 8, height + 29, width + 33, height + 30, -1);
for (Mod m : Resent.INSTANCE.modManager.modules) {
if (this.modWatching == null) {
int fh = fr.FONT_HEIGHT;
if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 30 - fh * (-off) + 30 + 2 - offset < y + 20) {
// Enabled outline
RenderUtils.drawRectOutline(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, m.isEnabled() ? Color.GREEN.getRGB() : Color.RED.getRGB());
Gui.drawRect(
drawRect(
this.x + 10 + xo - 1 + 10,
height - 2 - fh * -(off) + 50 - 1 - offset,
this.x + 90 + xo - 1 + 22,
@ -172,7 +172,7 @@ public class ClickGUI extends GuiScreen {
//RenderUtils.drawRectOutline(this.x+90+xo-1+10, height-2-fh*-(off)+51+1-offset, this.x+90+xo-1+10+fr.getStringWidth("o"), height-2-fh*-(off)+51+1-offset+fr.FONT_HEIGHT, -1);
//fr.drawString("+", this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 + 1 - offset, -1);
//fr.drawString(" x", this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 + 1 - offset, -1);
// Gui.drawRect(this.x+90+xo-1+10, height-2-fh*-(off)+51-1-offset,
// drawRect(this.x+90+xo-1+10, height-2-fh*-(off)+51-1-offset,
// this.x+90+xo-1+21, height+30-fh*(-off)+30-1+2-1-offset, -1);
}
@ -190,7 +190,7 @@ public class ClickGUI extends GuiScreen {
if (s instanceof BooleanSetting) {
b = (BooleanSetting) s;
RenderUtils.drawRectOutline(this.x + 6 + 6, height - fr.FONT_HEIGHT + 50 + var, this.x + 15 + 6, height - fr.FONT_HEIGHT + 50 + fr.FONT_HEIGHT + var, b.getValue() ? Color.GREEN.getRGB() : Color.RED.getRGB());
Gui.drawRect(
drawRect(
this.x + 6 + 1 + 6,
height - fr.FONT_HEIGHT + 50 + var + 1,
this.x + 15 - 1 + 6,

View File

@ -15,7 +15,7 @@ public class ClientButton extends GuiButton
public void drawButton(final Minecraft mc, final int mouseX, final int mouseY) {
FontRenderer fr = mc.fontRendererObj;
this.hovered = (mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height);
Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, hovered ? 0x30ffffff :0x20ffffff);
drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, hovered ? 0x30ffffff :0x20ffffff);
drawCenteredString(fr, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, -1);
}

View File

@ -92,7 +92,7 @@ public class GuiScreenModule extends GuiScreen {
public void drawScreen(int mx, int my, float par3) {
offset = MathHelper.clamp_int(MathHelper.clamp_int(offset, 0, getListMaxScroll()), 0, getListMaxScroll());
Gui.drawRect(0, 0, MathHelper.clamp_int(this.width / 4, 200, this.width / 4), this.height, 0xFF090909);
drawRect(0, 0, MathHelper.clamp_int(this.width / 4, 200, this.width / 4), this.height, 0xFF090909);
if (!this.watchingMod && this.modWatching == null) {
int i = 0;
for (int z = 0; z < Resent.INSTANCE.modManager.modules.size(); z++) {
@ -103,18 +103,18 @@ public class GuiScreenModule extends GuiScreen {
int y = (fontRenderer.FONT_HEIGHT*2+45) + 60 * i + 10 - offset;
int width = MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10 - x;
int height = frho - y;
Gui.drawRect(10, (10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10) + 60 * i + 10 - offset,
drawRect(10, (10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10) + 60 * i + 10 - offset,
MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10,
frho, 0xff1c1c1c);
fontRenderer.drawString(m.name, 20,
(10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10) + 60 * i + 10 - offset + 10, -1);
Gui.drawRect(x, y, x + width, y + 1, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
Gui.drawRect(x, y, x + 1, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
Gui.drawRect(x + width - 1, y, x + width, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
Gui.drawRect(x, y + height - 1, x + width, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
drawRect(x, y, x + width, y + 1, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
drawRect(x, y, x + 1, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
drawRect(x + width - 1, y, x + width, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
drawRect(x, y + height - 1, x + width, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
Gui.drawRect(x + 5, y + height - 5 - 15, x + width - 5, y + height - 5, 0xff333333);
drawRect(x + 5, y + height - 5 - 15, x + width - 5, y + height - 5, 0xff333333);
fontRenderer.drawString("Settings",
(x + width / 2) - fontRenderer.getStringWidth("Settings") / 2,
y + height - 5 - 15 + fontRenderer.FONT_HEIGHT / 2, -1);
@ -122,7 +122,7 @@ public class GuiScreenModule extends GuiScreen {
i++;
}
}
Gui.drawRect(0, 0, MathHelper.clamp_int(this.width / 4, 200, this.width / 4),
drawRect(0, 0, MathHelper.clamp_int(this.width / 4, 200, this.width / 4),
10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10, 0xFF090909);
this.search.drawTextBox();
fontRenderer.drawString(screenTitle + " - ClickGui", this.width / 4 / 2 - fontRenderer.getStringWidth(screenTitle + "") / 2,
@ -130,10 +130,10 @@ public class GuiScreenModule extends GuiScreen {
-1);
} else {
int frho3 = (10+fontRenderer.FONT_HEIGHT+6)/2/2;
Gui.drawRect(frho3, frho3, frho3+(10+fontRenderer.FONT_HEIGHT+6)/2, frho3+(10+fontRenderer.FONT_HEIGHT+6)/2,0xff1c1c1c);
drawRect(frho3, frho3, frho3+(10+fontRenderer.FONT_HEIGHT+6)/2, frho3+(10+fontRenderer.FONT_HEIGHT+6)/2,0xff1c1c1c);
fontRenderer.drawString("<", frho3+frho3-fontRenderer.getStringWidth("<")/2, frho3+frho3-fontRenderer.FONT_HEIGHT/2, -1);
fontRenderer.drawString(screenTitle + " - "+modWatching.name, MathHelper.clamp_int(this.width/4, 200, this.width/4)/2-fontRenderer.getStringWidth(screenTitle + " - "+modWatching.name)/2, 10, -1);
Gui.drawRect(0, 10+fontRenderer.FONT_HEIGHT+6, MathHelper.clamp_int(this.width/4, 200, this.width/4), 10+fontRenderer.FONT_HEIGHT+7, -1);
drawRect(0, 10+fontRenderer.FONT_HEIGHT+6, MathHelper.clamp_int(this.width/4, 200, this.width/4), 10+fontRenderer.FONT_HEIGHT+7, -1);
int i = 0;
Mod m = this.modWatching;
for (int amongus = 0; amongus < m.settings.size(); amongus++) {
@ -148,16 +148,16 @@ public class GuiScreenModule extends GuiScreen {
int frho1 = (10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10);
int width = MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10 - x;
int height = (fontRenderer.FONT_HEIGHT*2+45)+60*i+60-offset-y;
Gui.drawRect(10, y,
drawRect(10, y,
MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10,
frho1 + 60 * i + 60 - offset, 0xff1c1c1c);
fontRenderer.drawString(s.name, 20,frho1 + 60 * i + 10 - offset + 10, -1);
if (bS != null) {
Gui.drawRect(x, y, x + width, y + 1, bS.getValue() ? 0xff009e00 : 0xff9e0000);
Gui.drawRect(x, y, x + 1, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000);
Gui.drawRect(x + width - 1, y, x + width, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000);
Gui.drawRect(x, y + height - 1, x + width, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000);
drawRect(x, y, x + width, y + 1, bS.getValue() ? 0xff009e00 : 0xff9e0000);
drawRect(x, y, x + 1, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000);
drawRect(x + width - 1, y, x + width, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000);
drawRect(x, y + height - 1, x + width, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000);
}
i++;
}

View File

@ -18,11 +18,11 @@ public class PreGUI extends GuiScreen{
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/logo.png"));
Gui.drawModalRectWithCustomSizedTexture(GuiScreen.width/2-20, GuiScreen.height/2-50, 0, 0, 60, 60, 60, 60);
Gui.drawRect(GuiScreen.width/2-30, GuiScreen.height/2+20, GuiScreen.width/2+50, GuiScreen.height/2+50, isMouseInside(i, j, GuiScreen.width/2-30, GuiScreen.height/2+20, GuiScreen.width/2+50, GuiScreen.height/2+50) ? 0x40FFFFFF : 0x50FFFFFF);
drawRect(GuiScreen.width/2-30, GuiScreen.height/2+20, GuiScreen.width/2+50, GuiScreen.height/2+50, isMouseInside(i, j, GuiScreen.width/2-30, GuiScreen.height/2+20, GuiScreen.width/2+50, GuiScreen.height/2+50) ? 0x40FFFFFF : 0x50FFFFFF);
RenderUtils.drawRectOutline(GuiScreen.width/2-30, GuiScreen.height/2+20, GuiScreen.width/2+50, GuiScreen.height/2+50, 0x080FFFFFF);
RenderUtils.drawCenteredScaledString("Mods", GuiScreen.width/2+10, GuiScreen.height/2+35-mc.fontRendererObj.FONT_HEIGHT/2, -1, 1.25f);
/*Gui.drawRect(GuiScreen.width/2-30, GuiScreen.height/2+55, GuiScreen.width/2+50, GuiScreen.height/2+85, isMouseInside(i, j, GuiScreen.width/2-30, GuiScreen.height/2+55, GuiScreen.width/2+50, GuiScreen.height/2+85) ? 0x40FFFFFF : 0x50FFFFFF);
/*drawRect(GuiScreen.width/2-30, GuiScreen.height/2+55, GuiScreen.width/2+50, GuiScreen.height/2+85, isMouseInside(i, j, GuiScreen.width/2-30, GuiScreen.height/2+55, GuiScreen.width/2+50, GuiScreen.height/2+85) ? 0x40FFFFFF : 0x50FFFFFF);
RenderUtils.drawRectOutline(GuiScreen.width/2-30, GuiScreen.height/2+55, GuiScreen.width/2+50, GuiScreen.height/2+85, 0x080FFFFFF);
RenderUtils.drawCenteredScaledString("Cosmetics", GuiScreen.width/2+10, GuiScreen.height/2+70-mc.fontRendererObj.FONT_HEIGHT/2, -1, 1.25f);*/
super.drawScreen(i, j, var3);

View File

@ -104,7 +104,7 @@ public void drawScreen(int mouseX, int mouseY, float par3) {
b.getValue() ? Color.GREEN.getRGB() : Color.RED.getRGB());
//Draw outline fill
Gui.drawRect(this.x+4+5, height-1-fh*-(off)-offset, this.x+11+5,
drawRect(this.x+4+5, height-1-fh*-(off)-offset, this.x+11+5,
height-3-fh*(-off)+fh-offset, isMouseInside(mouseX, mouseY, this.x+4+5,
height-1-fh*-(off)-offset, this.x+11+5,
height-3-fh*(-off)+fh-offset) ? Color.LIGHT_GRAY.getRGB() : Color.GRAY.getRGB());

View File

@ -1,9 +1,13 @@
package dev.resent.util.render;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import dev.resent.setting.ModeSetting;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
public class RenderUtils {
@ -29,6 +33,39 @@ public class RenderUtils {
return -1;
}
public static void drawRect(int left, int top, int right, int bottom, int color) {
if (left < right) {
int i = left;
left = right;
right = i;
}
if (top < bottom) {
int j = top;
top = bottom;
bottom = j;
}
float f3 = (float) (color >> 24 & 255) / 255.0F;
float f = (float) (color >> 16 & 255) / 255.0F;
float f1 = (float) (color >> 8 & 255) / 255.0F;
float f2 = (float) (color & 255) / 255.0F;
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
GlStateManager.enableBlend();
GlStateManager.disableTexture2D();
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.color(f, f1, f2, f3);
worldrenderer.begin(7, DefaultVertexFormats.POSITION);
worldrenderer.pos((double) left, (double) bottom, 0.0D).endVertex();
worldrenderer.pos((double) right, (double) bottom, 0.0D).endVertex();
worldrenderer.pos((double) right, (double) top, 0.0D).endVertex();
worldrenderer.pos((double) left, (double) top, 0.0D).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
}
public static Color getColorWithoutRGB(ModeSetting asdf) {
switch (asdf.getValue()) {
case "Red":
@ -52,10 +89,10 @@ public class RenderUtils {
}
public static void drawRectOutline(int x, int y, int width, int height, int color) {
Gui.drawRect(x, y, width, y + 1, color);
Gui.drawRect(x, y, x + 1, height, color);
Gui.drawRect(width - 1, y, width, height, color);
Gui.drawRect(x, height - 1, width, height, color);
drawRect(x, y, width, y + 1, color);
drawRect(x, y, x + 1, height, color);
drawRect(width - 1, y, width, height, color);
drawRect(x, height - 1, width, height, color);
}
public static void drawCenteredScaledString(String text, int x,int y, int color, float scale){