temp commit

This commit is contained in:
UnknownUser1789 2023-01-20 02:43:42 +00:00
parent 3987f44574
commit b88b41dfda
17 changed files with 26800 additions and 26800 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -13,11 +13,11 @@ public class Theme {
public static int getFontColor(int id, int opacity){ public static int getFontColor(int id, int opacity){
switch(id){ switch(id){
case 1: case 1:
return Color.white.getRGB(); return -1;
case 2: case 2:
return Color.black.getRGB(); return Color.black.getRGB();
case 3: case 3:
return Color.white.getGreen(); return Color.white.getRGB();
case 50: case 50:
return RainbowUtil.getRainbow(4f, 0.8f, 0.85f); return RainbowUtil.getRainbow(4f, 0.8f, 0.85f);
} }

View File

@ -9,8 +9,10 @@ import dev.resent.event.impl.Event;
import dev.resent.module.Theme; import dev.resent.module.Theme;
import dev.resent.setting.Setting; import dev.resent.setting.Setting;
import dev.resent.util.render.Color; import dev.resent.util.render.Color;
import dev.resent.util.render.RainbowUtil;
import dev.resent.util.render.RenderUtils; import dev.resent.util.render.RenderUtils;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
public class Mod { public class Mod {
@ -59,8 +61,8 @@ public class Mod {
RenderUtils.drawRect(left, top, right, bottom, new Color(255, 255, 255, 200).getRGB()); RenderUtils.drawRect(left, top, right, bottom, new Color(255, 255, 255, 200).getRGB());
case 3: case 3:
RenderUtils.drawRect(left, top, right, bottom, new Color(0, 0, 0, 140).getRGB()); RenderUtils.drawRect(left, top, right, bottom, new Color(0, 0, 0, 140).getRGB());
case 4: case 50:
RenderUtils.drawChromaRect(left, top, right, bottom); Gui.drawRect(left, top, right, bottom, RainbowUtil.getRainbow(4, 0.8f, 0.85f));
} }
} }

View File

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

View File

@ -36,10 +36,6 @@ public class CPS extends RenderModule {
@Override @Override
public void draw() { public void draw() {
mc.fontRendererObj.drawString(getText(), this.x + 2, this.y + 2, Theme.getFontColor(Theme.getId()), tshadow.getValue());
}
public String getText(){
boolean pressedLMB = Keyboard.isKeyDown(mc.gameSettings.keyBindAttack.getKeyCode()); boolean pressedLMB = Keyboard.isKeyDown(mc.gameSettings.keyBindAttack.getKeyCode());
if(pressedLMB != this.wasPressedLMB) { if(pressedLMB != this.wasPressedLMB) {
@ -60,18 +56,21 @@ public class CPS extends RenderModule {
} }
} }
final long time = System.currentTimeMillis();
FuncUtils.removeIf(clicksRMB, aLong -> aLong + 1000 < time);
FuncUtils.removeIf(clicksLMB, aLong -> aLong + 1000 < time);
mc.fontRendererObj.drawString(getText(), this.x + 2, this.y + 2, Theme.getFontColor(Theme.getId()), tshadow.getValue());
}
public String getText(){
return "[ " + getLMB() + " | " + getRMB() + " ]"; return "[ " + getLMB() + " | " + getRMB() + " ]";
} }
public int getLMB() { public int getLMB() {
final long time = System.currentTimeMillis();
FuncUtils.removeIf(clicksLMB, aLong -> aLong + 1000 < time);
return this.clicksLMB.size(); return this.clicksLMB.size();
} }
public int getRMB() { public int getRMB() {
final long time = System.currentTimeMillis();
FuncUtils.removeIf(clicksRMB, aLong -> aLong + 1000 < time);
return this.clicksRMB.size(); return this.clicksRMB.size();
} }

View File

@ -1,5 +1,6 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import dev.resent.module.Theme;
import dev.resent.module.base.Category; import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule; import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting; import dev.resent.setting.BooleanSetting;
@ -23,6 +24,6 @@ public class Health extends RenderModule {
@Override @Override
public void draw() { public void draw() {
mc.fontRendererObj.drawString("[" + mc.thePlayer.getHealth() + " Health]", this.x + 2, this.y + 2, -1, tshadow.getValue()); mc.fontRendererObj.drawString("[" + mc.thePlayer.getHealth() + " Health]", this.x + 2, this.y + 2, Theme.getFontColor(Theme.getId()), tshadow.getValue());
} }
} }

View File

@ -1,10 +1,10 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import dev.resent.module.Theme;
import dev.resent.module.base.Category; import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule; import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting; import dev.resent.setting.BooleanSetting;
import dev.resent.util.render.Color; import dev.resent.util.render.Color;
import net.minecraft.client.gui.Gui;
import net.minecraft.util.BlockPos; import net.minecraft.util.BlockPos;
public class Info extends RenderModule { public class Info extends RenderModule {
@ -33,14 +33,14 @@ public class Info extends RenderModule {
//int rot = MathHelper.floor_double(this.mc.thePlayer.rotationYaw*4/360+0.5) & 3; //int rot = MathHelper.floor_double(this.mc.thePlayer.rotationYaw*4/360+0.5) & 3;
if (mc.thePlayer != null) { if (mc.thePlayer != null) {
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(" X: " + px, this.x + 5, this.y + 14, Theme.getFontColor(Theme.getId()));
mc.fontRendererObj.drawStringWithShadow(" Y: " + py, this.x + 5, this.y + 24, -1); mc.fontRendererObj.drawStringWithShadow(" Y: " + py, this.x + 5, this.y + 24, Theme.getFontColor(Theme.getId()));
mc.fontRendererObj.drawStringWithShadow(" Z: " + pz, this.x + 5, this.y + 34, -1); mc.fontRendererObj.drawStringWithShadow(" Z: " + pz, this.x + 5, this.y + 34, Theme.getFontColor(Theme.getId()));
if (!direction.getValue()) yes = 6; if (!direction.getValue()) yes = 6;
//if (direction.getValue()) { //if (direction.getValue()) {
// mc.fontRendererObj.drawStringWithShadow(" Dir: " + Direction.directionsF[rot], this.x+5+mc.fontRendererObj.getStringWidth(" X: " + px), this.y + 14, -1); // mc.fontRendererObj.drawStringWithShadow(" Dir: " + Direction.directionsF[rot], this.x+5+mc.fontRendererObj.getStringWidth(" X: " + px), this.y + 14, Theme.getFontColor(Theme.getId()));
mc.fontRendererObj.drawStringWithShadow(" Biome: " + mc.theWorld.getBiomeGenForCoords(new BlockPos(px, py, pz)).biomeName, this.x + 5, this.y + 44, -1); mc.fontRendererObj.drawStringWithShadow(" Biome: " + mc.theWorld.getBiomeGenForCoords(new BlockPos(px, py, pz)).biomeName, this.x + 5, this.y + 44, Theme.getFontColor(Theme.getId()));
//mc.fontRendererObj.drawStringWithShadow(" A: " + MathHelper.floor_double((double)mc.thePlayer.rotationYaw>360 || mc.thePlayer.rotationYaw<-360 ? mc.thePlayer.rotationYaw-360 : mc.thePlayer.rotationYaw) + "°", this.x + mc.fontRendererObj.getStringWidth(" D: N "), this.y + 44, -1); //mc.fontRendererObj.drawStringWithShadow(" A: " + MathHelper.floor_double((double)mc.thePlayer.rotationYaw>360 || mc.thePlayer.rotationYaw<-360 ? mc.thePlayer.rotationYaw-360 : mc.thePlayer.rotationYaw) + "°", this.x + mc.fontRendererObj.getStringWidth(" D: N "), this.y + 44, Theme.getFontColor(Theme.getId()));
yes = 7; yes = 7;
//} //}

View File

@ -1,5 +1,6 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import dev.resent.module.Theme;
import dev.resent.module.base.Category; import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule; import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting; import dev.resent.setting.BooleanSetting;
@ -17,12 +18,12 @@ public class Ping extends RenderModule {
public void draw() { public void draw() {
int ms = 0; int ms = 0;
if (mc.isSingleplayer()) { if (mc.isSingleplayer()) {
ms = -1; ms = Theme.getFontColor(Theme.getId());
} }
ms = (int) mc.getCurrentServerData().pingToServer; ms = (int) mc.getCurrentServerData().pingToServer;
this.setHeight(mc.fontRendererObj.FONT_HEIGHT + 4); this.setHeight(mc.fontRendererObj.FONT_HEIGHT + 4);
this.setWidth(mc.fontRendererObj.getStringWidth("[" + ms + " ms]") + 4); this.setWidth(mc.fontRendererObj.getStringWidth("[" + ms + " ms]") + 4);
mc.fontRendererObj.drawString("[" + ms + " ms]", this.x + 2, this.y + 2, -1, tshadow.getValue()); mc.fontRendererObj.drawString("[" + ms + " ms]", this.x + 2, this.y + 2, Theme.getFontColor(Theme.getId()), tshadow.getValue());
} }
} }

View File

@ -1,5 +1,6 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import dev.resent.module.Theme;
import dev.resent.module.base.Category; import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule; import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting; import dev.resent.setting.BooleanSetting;
@ -35,6 +36,6 @@ public class PotCounter extends RenderModule {
} }
} }
mc.fontRendererObj.drawString("[" + potinv + " Pots]", this.x + 2, this.y + 2, -1, tshadow.getValue()); mc.fontRendererObj.drawString("[" + potinv + " Pots]", this.x + 2, this.y + 2, Theme.getFontColor(Theme.getId()), tshadow.getValue());
} }
} }

View File

@ -1,10 +1,12 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import java.text.DecimalFormat;
import dev.resent.event.impl.Event; import dev.resent.event.impl.Event;
import dev.resent.event.impl.EventAttack; import dev.resent.event.impl.EventAttack;
import dev.resent.module.Theme;
import dev.resent.module.base.Category; import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule; import dev.resent.module.base.RenderModule;
import java.text.DecimalFormat;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
public class ReachDisplay extends RenderModule { public class ReachDisplay extends RenderModule {
@ -26,7 +28,7 @@ public class ReachDisplay extends RenderModule {
@Override @Override
public void draw() { public void draw() {
mc.fontRendererObj.drawStringWithShadow("[" + df2.format(range) + " Blocks]", this.x + 2, this.y + 2, -1); mc.fontRendererObj.drawStringWithShadow("[" + df2.format(range) + " Blocks]", this.x + 2, this.y + 2, Theme.getFontColor(Theme.getId()));
} }
@Override @Override

View File

@ -1,5 +1,6 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import dev.resent.module.Theme;
import dev.resent.module.base.Category; import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule; import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting; import dev.resent.setting.BooleanSetting;
@ -22,7 +23,7 @@ public class ServerInfo extends RenderModule {
} }
public void draw() { public void draw() {
mc.fontRendererObj.drawString(getText(), this.x + 2, this.y + 2, -1, tshadow.getValue()); mc.fontRendererObj.drawString(getText(), this.x + 2, this.y + 2, Theme.getFontColor(Theme.getId()), tshadow.getValue());
} }
public String getText() { public String getText() {

View File

@ -1,6 +1,7 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import dev.resent.Resent; import dev.resent.Resent;
import dev.resent.module.Theme;
import dev.resent.module.base.Category; import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule; import dev.resent.module.base.RenderModule;
import dev.resent.util.render.Color; import dev.resent.util.render.Color;
@ -27,7 +28,7 @@ public class Watermark extends RenderModule {
GlStateManager.scale(2f, 2f, 2f); GlStateManager.scale(2f, 2f, 2f);
int i = fr.drawString(Resent.NAME + " client", (this.x + 1) / 2, (this.y + 1) / 2, Color.RED.getRGB(), true); int i = fr.drawString(Resent.NAME + " client", (this.x + 1) / 2, (this.y + 1) / 2, Color.RED.getRGB(), true);
GlStateManager.scale(0.5f, 0.5f, 0.5f); GlStateManager.scale(0.5f, 0.5f, 0.5f);
fr.drawString(Resent.VERSION + "", (i * 2), this.y + (fr.FONT_HEIGHT * 2 - 7), -1, true); fr.drawString(Resent.VERSION + "", (i * 2), this.y + (fr.FONT_HEIGHT * 2 - 7), Theme.getFontColor(Theme.getId()), true);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
} }
} }

View File

@ -15,7 +15,7 @@ public class ClientButton extends GuiButton
public void drawButton(final Minecraft mc, final int mouseX, final int mouseY) { public void drawButton(final Minecraft mc, final int mouseX, final int mouseY) {
FontRenderer fr = mc.fontRendererObj; FontRenderer fr = mc.fontRendererObj;
this.hovered = (mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height); this.hovered = (mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height);
drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, hovered ? 0x30ffffff :0x20ffffff); Gui.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); 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) { public void drawScreen(int mx, int my, float par3) {
offset = MathHelper.clamp_int(MathHelper.clamp_int(offset, 0, getListMaxScroll()), 0, getListMaxScroll()); offset = MathHelper.clamp_int(MathHelper.clamp_int(offset, 0, getListMaxScroll()), 0, getListMaxScroll());
drawRect(0, 0, MathHelper.clamp_int(this.width / 4, 200, this.width / 4), this.height, 0xFF090909); Gui.drawRect(0, 0, MathHelper.clamp_int(this.width / 4, 200, this.width / 4), this.height, 0xFF090909);
if (!this.watchingMod && this.modWatching == null) { if (!this.watchingMod && this.modWatching == null) {
int i = 0; int i = 0;
for (int z = 0; z < Resent.INSTANCE.modManager.modules.size(); z++) { 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 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 width = MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10 - x;
int height = frho - y; int height = frho - y;
drawRect(10, (10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10) + 60 * i + 10 - offset, Gui.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, MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10,
frho, 0xff1c1c1c); frho, 0xff1c1c1c);
fontRenderer.drawString(m.name, 20, fontRenderer.drawString(m.name, 20,
(10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10) + 60 * i + 10 - offset + 10, -1); (10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10) + 60 * i + 10 - offset + 10, -1);
drawRect(x, y, x + width, y + 1, m.isEnabled() ? 0xff009e00 : 0xff9e0000); Gui.drawRect(x, y, x + width, y + 1, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
drawRect(x, y, x + 1, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000); Gui.drawRect(x, y, x + 1, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
drawRect(x + width - 1, y, x + width, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000); Gui.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, y + height - 1, x + width, y + height, m.isEnabled() ? 0xff009e00 : 0xff9e0000);
drawRect(x + 5, y + height - 5 - 15, x + width - 5, y + height - 5, 0xff333333); Gui.drawRect(x + 5, y + height - 5 - 15, x + width - 5, y + height - 5, 0xff333333);
fontRenderer.drawString("Settings", fontRenderer.drawString("Settings",
(x + width / 2) - fontRenderer.getStringWidth("Settings") / 2, (x + width / 2) - fontRenderer.getStringWidth("Settings") / 2,
y + height - 5 - 15 + fontRenderer.FONT_HEIGHT / 2, -1); y + height - 5 - 15 + fontRenderer.FONT_HEIGHT / 2, -1);
@ -122,7 +122,7 @@ public class GuiScreenModule extends GuiScreen {
i++; i++;
} }
} }
drawRect(0, 0, MathHelper.clamp_int(this.width / 4, 200, this.width / 4), Gui.drawRect(0, 0, MathHelper.clamp_int(this.width / 4, 200, this.width / 4),
10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10, 0xFF090909); 10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10, 0xFF090909);
this.search.drawTextBox(); this.search.drawTextBox();
fontRenderer.drawString(screenTitle + " - ClickGui", this.width / 4 / 2 - fontRenderer.getStringWidth(screenTitle + "") / 2, fontRenderer.drawString(screenTitle + " - ClickGui", this.width / 4 / 2 - fontRenderer.getStringWidth(screenTitle + "") / 2,
@ -130,10 +130,10 @@ public class GuiScreenModule extends GuiScreen {
-1); -1);
} else { } else {
int frho3 = (10+fontRenderer.FONT_HEIGHT+6)/2/2; int frho3 = (10+fontRenderer.FONT_HEIGHT+6)/2/2;
drawRect(frho3, frho3, frho3+(10+fontRenderer.FONT_HEIGHT+6)/2, frho3+(10+fontRenderer.FONT_HEIGHT+6)/2,0xff1c1c1c); Gui.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("<", 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); fontRenderer.drawString(screenTitle + " - "+modWatching.name, MathHelper.clamp_int(this.width/4, 200, this.width/4)/2-fontRenderer.getStringWidth(screenTitle + " - "+modWatching.name)/2, 10, -1);
drawRect(0, 10+fontRenderer.FONT_HEIGHT+6, MathHelper.clamp_int(this.width/4, 200, this.width/4), 10+fontRenderer.FONT_HEIGHT+7, -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);
int i = 0; int i = 0;
Mod m = this.modWatching; Mod m = this.modWatching;
for (int amongus = 0; amongus < m.settings.size(); amongus++) { 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 frho1 = (10 + fontRenderer.FONT_HEIGHT * 2 + 15 + 10 + 10);
int width = MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10 - x; 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; int height = (fontRenderer.FONT_HEIGHT*2+45)+60*i+60-offset-y;
drawRect(10, y, Gui.drawRect(10, y,
MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10, MathHelper.clamp_int(this.width / 4, 200, this.width / 4) - 10,
frho1 + 60 * i + 60 - offset, 0xff1c1c1c); frho1 + 60 * i + 60 - offset, 0xff1c1c1c);
fontRenderer.drawString(s.name, 20,frho1 + 60 * i + 10 - offset + 10, -1); fontRenderer.drawString(s.name, 20,frho1 + 60 * i + 10 - offset + 10, -1);
if (bS != null) { if (bS != null) {
drawRect(x, y, x + width, y + 1, bS.getValue() ? 0xff009e00 : 0xff9e0000); Gui.drawRect(x, y, x + width, y + 1, bS.getValue() ? 0xff009e00 : 0xff9e0000);
drawRect(x, y, x + 1, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000); Gui.drawRect(x, y, x + 1, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000);
drawRect(x + width - 1, y, x + width, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000); Gui.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); Gui.drawRect(x, y + height - 1, x + width, y + height, bS.getValue() ? 0xff009e00 : 0xff9e0000);
} }
i++; i++;
} }

View File

@ -18,7 +18,7 @@ public class PreGUI extends GuiScreen{
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/logo.png")); 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.drawModalRectWithCustomSizedTexture(GuiScreen.width/2-20, GuiScreen.height/2-50, 0, 0, 60, 60, 60, 60);
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); 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);
RenderUtils.drawRectOutline(GuiScreen.width/2-30, GuiScreen.height/2+20, GuiScreen.width/2+50, GuiScreen.height/2+50, 0x080FFFFFF); 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); RenderUtils.drawCenteredScaledString("Mods", GuiScreen.width/2+10, GuiScreen.height/2+35-mc.fontRendererObj.FONT_HEIGHT/2, -1, 1.25f);

View File

@ -33,6 +33,19 @@ public class RenderUtils {
return -1; return -1;
} }
public static void drawChromaString(String string, int x, int y, boolean shadow) {
Minecraft mc = Minecraft.getMinecraft();
int xTmp = x;
for (char textChar : string.toCharArray()) {
long l = System.currentTimeMillis() - (xTmp * 10 - y * 10);
int i = Color.HSBtoRGB(l % (int) 2000.0F / 2000.0F, 0.8F, 0.8F);
String tmp = String.valueOf(textChar);
mc.fontRendererObj.drawString(tmp, xTmp, y, i, shadow);
xTmp += mc.fontRendererObj.getCharWidth(textChar);
}
}
public static void drawRect(int left, int top, int right, int bottom, int color) { public static void drawRect(int left, int top, int right, int bottom, int color) {
if (left < right) { if (left < right) {
int i = left; int i = left;
@ -66,31 +79,6 @@ public class RenderUtils {
GlStateManager.disableBlend(); 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) { public static Color getColorWithoutRGB(ModeSetting asdf) {
switch (asdf.getValue()) { switch (asdf.getValue()) {
case "Red": case "Red":
@ -114,10 +102,10 @@ public class RenderUtils {
} }
public static void drawRectOutline(int x, int y, int width, int height, int color) { public static void drawRectOutline(int x, int y, int width, int height, int color) {
drawRect(x, y, width, y + 1, color); Gui.drawRect(x, y, width, y + 1, color);
drawRect(x, y, x + 1, height, color); Gui.drawRect(x, y, x + 1, height, color);
drawRect(width - 1, y, width, height, color); Gui.drawRect(width - 1, y, width, height, color);
drawRect(x, height - 1, width, height, color); Gui.drawRect(x, height - 1, width, height, color);
} }
public static void drawCenteredScaledString(String text, int x,int y, int color, float scale){ public static void drawCenteredScaledString(String text, int x,int y, int color, float scale){