Inventory animation.

This commit is contained in:
UnknownUser1789 2023-01-30 20:26:42 +00:00
parent 629aa8439b
commit fd8c9da82b
13 changed files with 34514 additions and 34500 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,6 @@
package dev.resent;
import dev.resent.module.base.ModManager;
import net.minecraft.client.Minecraft;
public class Resent {
@ -9,8 +8,7 @@ public class Resent {
INSTANCE = new Resent();
}
public static String NAME = "Resent", VERSION = "3.3.2";
public static Minecraft mc = Minecraft.getMinecraft();
public static String NAME = "Resent", VERSION = "3.4";
public static Resent INSTANCE;
public ModManager modManager;

View File

@ -30,4 +30,8 @@ public class Theme {
return -1;
}
public static boolean getRounded(){
return HUD.round.getValue();
}
}

View File

@ -50,10 +50,9 @@ 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 50:
if(Theme.getRounded()){
RenderUtils.drawRoundedRect(left, top, right, bottom, 4, color);
}else {
Gui.drawRect(left, top, right, bottom, color);
}
}

View File

@ -3,6 +3,7 @@ package dev.resent.module.impl.hud;
import java.util.ArrayList;
import java.util.List;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.setting.BooleanSetting;
@ -20,7 +21,7 @@ public class CPS extends RenderModule {
private long lastPressed;
public BooleanSetting tshadow = new BooleanSetting("Text shadow", "", true);
public int getWidth() { return mc.fontRendererObj.getStringWidth("[CPS: 00]") + 4; }
public int getWidth() { return mc.fontRendererObj.getStringWidth("[CPS: "+ clicks.size() + "]") + 4; }
public int getHeight() { return mc.fontRendererObj.FONT_HEIGHT+4; }
@Override
@ -39,7 +40,7 @@ public class CPS extends RenderModule {
final long time = System.currentTimeMillis();
FuncUtils.removeIf(clicks, aLong -> aLong + 1000 < time);
mc.fontRendererObj.drawString("CPS: " + clicks.size(), this.x+2, this.y+2, -1, tshadow.getValue());
mc.fontRendererObj.drawString("[CPS: " + clicks.size() + "]", this.x+2, this.y+2, Theme.getFontColor(Theme.getId()), tshadow.getValue());
}
}

View File

@ -104,34 +104,34 @@ public class KeyStrokes extends RenderModule{
if (!transparent.getValue()) {
//W
RenderUtils.drawRoundedRect(this.x + 30, this.y + 3, this.x + 55, this.y + 25 + 3, 8,
RenderUtils.drawRoundedRect(this.x + 30, this.y + 3, this.x + 55, this.y + 25 + 3, 4,
wKey ? getColor(gcolor) : getColor(gcolorp));
// S
RenderUtils.drawRoundedRect(this.x + 30, this.y + 30, this.x + 55, this.y + 55, 8,
RenderUtils.drawRoundedRect(this.x + 30, this.y + 30, this.x + 55, this.y + 55, 4,
sKey ? getColor(gcolor) : getColor(gcolorp));
// A
RenderUtils.drawRoundedRect(this.x + 3, this.y + 30, this.x + 25 + 3, this.y + 55, 8,
RenderUtils.drawRoundedRect(this.x + 3, this.y + 30, this.x + 25 + 3, this.y + 55, 4,
aKey ? getColor(gcolor) : getColor(gcolorp));
// D
RenderUtils.drawRoundedRect(this.x + 60 - 3, this.y + 30, this.x + 85 - 3, this.y + 25 + 5 + 25, 8,
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
RenderUtils.drawRoundedRect(this.x+3, this.y+57, this.x+41, this.y+82, 8,
RenderUtils.drawRoundedRect(this.x+3, this.y+57, this.x+41, this.y+82, 4,
pressed ? getColor(gcolor) : getColor(gcolorp));
// RMB
RenderUtils.drawRoundedRect(this.x + 45 - 1, this.y + 60 - 3, this.x + 85 - 3, this.y + 85 - 3, 8,
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
if(jump.getValue())
RenderUtils.drawRoundedRect(this.x + 3, this.y+84, this.x+85-3,
this.y + 105 - 6, 8, jumpKey ? getColor(gcolor) : getColor(gcolorp));
this.y + 105 - 6, 4, jumpKey ? getColor(gcolor) : getColor(gcolorp));
}
// Sneak
if (sneak.getValue() && !transparent.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, mc.gameSettings.keyBindSneak.pressed ? getColor(gcolor) : getColor(gcolorp));
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, chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : wKey ? getColor(colorp) : getColor(color), tshadow.getValue());
@ -139,7 +139,7 @@ public class KeyStrokes extends RenderModule{
mc.fontRendererObj.drawString("A", this.x+3+(25/2-mc.fontRendererObj.getStringWidth("A") + 4), this.y+38, chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : aKey ? getColor(colorp) : getColor(color), tshadow.getValue());
mc.fontRendererObj.drawString("D", this.x+-3+25+25+10+(25/2-mc.fontRendererObj.getStringWidth("D") + 4), this.y+38, chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : dKey ? getColor(colorp) : getColor(color), tshadow.getValue());
if(jump.getValue())
mc.fontRendererObj.drawString("\u00A7m------", this.x+85+(25/2-mc.fontRendererObj.getStringWidth("u00A7m------") + 4), this.y+92-3, (chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : jumpKey ? getColor(colorp) : getColor(color)), tshadow.getValue());
mc.fontRendererObj.drawString("\u00A7m-------", this.x+85+(25/2-mc.fontRendererObj.getStringWidth("u00A7m-------") + 4), this.y+92-3, (chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : jumpKey ? getColor(colorp) : getColor(color)), tshadow.getValue());
if(sneak.getValue())
mc.fontRendererObj.drawString("Sneak", this.x+38+3+(25/2-mc.fontRendererObj.getStringWidth("Sneak") + 4), jump.getValue() ? this.y+92+15+1-3 : this.y+92-4, (chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : mc.gameSettings.keyBindSneak.pressed ? getColor(colorp) : getColor(color)), tshadow.getValue());
mc.fontRendererObj.drawString("LMB", this.x+3+40/2-mc.fontRendererObj.getStringWidth("LMB")/2, (this.y+60+25/2)-mc.fontRendererObj.FONT_HEIGHT/2-3, chroma.getValue() ? RainbowUtil.getRainbow(4f, 0.8f, 0.85f) : Mouse.isButtonDown(0) ? getColor(colorp) : getColor(color), tshadow.getValue());

View File

@ -2,6 +2,7 @@ package dev.resent.module.impl.misc;
import dev.resent.module.base.Category;
import dev.resent.module.base.Mod;
import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting;
public class HUD extends Mod{
@ -11,6 +12,7 @@ public class HUD extends Mod{
}
public static final ModeSetting theme = new ModeSetting("Theme", "", "Classic", "Rainbow");
public static final BooleanSetting round = new BooleanSetting("Rounded", "", true);
//public static final BooleanSetting animated = new BooleanSetting("Animated", "", true);
}

View File

@ -5,7 +5,7 @@ import java.io.IOException;
import dev.resent.Resent;
import dev.resent.animation.Animation;
import dev.resent.animation.Direction;
import dev.resent.animation.impl.EaseBackIn;
import dev.resent.animation.impl.ElasticAnimation;
import dev.resent.module.base.Mod;
import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting;
@ -142,13 +142,13 @@ public class ClickGUI extends GuiScreen {
// RenderUtils.drawRectOutline(width+15, height-5, width+26, height+8, new Color(200, 200, 200, 90).getRGB());
fr.drawString("X", width + 18, height - 2, -1);
GlUtils.stopScale();
// white line
drawRect(x - 8, height + 29, width + 33, height + 30, -1);
GlUtils.stopScale();
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) {
if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 30 - fh * (-off) + 30 + 2 - offset < y + 20 && introAnimation.isDone()) {
// 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());
drawRect(
@ -256,7 +256,7 @@ public class ClickGUI extends GuiScreen {
@Override
public void initGui() {
mc.gameSettings.loadOptions();
introAnimation = new EaseBackIn(450, 1, 2);
introAnimation = new ElasticAnimation(750, 1, 3.8f, 1.35f, false);
}
protected void keyTyped(char par1, int par2) {

View File

@ -13,15 +13,15 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
public class RenderUtils {
public static void drawChromaString(String string, int x, int y, boolean shadow) {
public static void drawChromaString(String string, int param1, int param2, boolean shadow) {
Minecraft mc = Minecraft.getMinecraft();
int xTmp = x;
int xTmp = param1;
for (char textChar : string.toCharArray()) {
long l = System.currentTimeMillis() - (xTmp * 10 - y * 10);
long l = System.currentTimeMillis() - (xTmp * 10 - param2 * 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);
mc.fontRendererObj.drawString(tmp, xTmp, param2, i, shadow);
xTmp += mc.fontRendererObj.getCharWidth(textChar);
}
}
@ -166,25 +166,25 @@ public class RenderUtils {
return Color.WHITE;
}
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);
public static void drawRectOutline(int param1, int param2, int width1, int height1, int color) {
Gui.drawRect(param1, param2, width1, param2 + 1, color);
Gui.drawRect(param1, param2, param1 + 1, height1, color);
Gui.drawRect(width1 - 1, param2, width1, height1, color);
Gui.drawRect(param1, height1 - 1, width1, height1, color);
}
public static void drawCenteredScaledString(String text, int x,int y, int color, float scale){
public static void drawCenteredScaledString(String text, int param1,int param2, int color, float scale){
GlStateManager.pushMatrix();
GlStateManager.scale(scale,scale,scale);
Gui.drawCenteredString(Minecraft.getMinecraft().fontRendererObj, text, (int) (x / scale), (int) (y / scale), color);
Gui.drawCenteredString(Minecraft.getMinecraft().fontRendererObj, text, (int) (param1 / scale), (int) (param2 / scale), color);
GlStateManager.popMatrix();
}
public static void startScale(float x, float y, float scale) {
public static void startScale(float param1, float param2, float scale) {
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, 0);
GlStateManager.translate(param1, param2, 0);
GlStateManager.scale(scale, scale, 1);
GlStateManager.translate(-x, -y, 0);
GlStateManager.translate(-param1, -param2, 0);
}
}

View File

@ -1,5 +1,8 @@
package net.minecraft.client.gui.inventory;
import dev.resent.util.misc.GlUtils;
import dev.resent.animation.impl.EaseBackIn;
import dev.resent.animation.Animation;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
import net.minecraft.client.Minecraft;
@ -52,6 +55,7 @@ public class GuiInventory extends InventoryEffectRenderer {
this.updateActivePotionEffects();
}
public Animation openAnim;
/**+
* Adds the buttons (and other controls) to the screen in
* question. Called when the GUI is displayed and when the
@ -59,6 +63,7 @@ public class GuiInventory extends InventoryEffectRenderer {
*/
public void initGui() {
this.buttonList.clear();
openAnim = new EaseBackIn(450, 1, 2);
if (this.mc.playerController.isInCreativeMode()) {
this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer));
} else {
@ -88,6 +93,7 @@ public class GuiInventory extends InventoryEffectRenderer {
* Args : renderPartialTicks, mouseX, mouseY
*/
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
GlUtils.startScale(this.width/2, this.height/2, (float)openAnim.getValue());
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(inventoryBackground);
int i = this.guiLeft;
@ -96,6 +102,7 @@ public class GuiInventory extends InventoryEffectRenderer {
GlStateManager.enableDepth();
drawEntityOnScreen(i + 51, j + 75, 30, (float) (i + 51) - this.oldMouseX, (float) (j + 75 - 50) - this.oldMouseY, this.mc.thePlayer);
GlStateManager.disableDepth();
GlUtils.stopScale();
}
/**+