From 285fc5cd67628f22c69eff2f1ce5f6aa91f570d3 Mon Sep 17 00:00:00 2001 From: ThisIsALegitUsername <73719631+ThisIsALegitUsername@users.noreply.github.com> Date: Mon, 27 Feb 2023 21:58:24 -0500 Subject: [PATCH] none animation theme --- src/main/java/dev/resent/visual/ui/ClickGUI.java | 9 +++++++-- .../java/dev/resent/visual/ui/animation/Animation.java | 5 +++++ .../net/minecraft/client/gui/inventory/GuiInventory.java | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/dev/resent/visual/ui/ClickGUI.java b/src/main/java/dev/resent/visual/ui/ClickGUI.java index d96b5e02..c1224415 100644 --- a/src/main/java/dev/resent/visual/ui/ClickGUI.java +++ b/src/main/java/dev/resent/visual/ui/ClickGUI.java @@ -130,13 +130,18 @@ public class ClickGUI extends GuiScreen { int off = 0; if (close) { + if(introAnimation == null) { + mc.displayGuiScreen(null); + return; + } + introAnimation.setDirection(Direction.BACKWARDS); if (introAnimation.isDone(Direction.BACKWARDS)) { mc.displayGuiScreen(null); } } - GlUtils.startScale((this.x + this.width) / 2, (this.y + this.height) / 2, (float) introAnimation.getValue()); + GlUtils.startScale((this.x + this.width) / 2, (this.y + this.height) / 2, introAnimation != null ? (float) introAnimation.getValue() : 1); // background drawRect(x - 10, y + 20, width + 35, height - 10, new Color(35, 39, 42, 200).getRGB()); @@ -170,7 +175,7 @@ public class ClickGUI extends GuiScreen { for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) { if (this.modWatching == null) { int fh = 9; - if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 40 - fh * (-off) + 30 +15 - offset < y + 20 && introAnimation.isDone()) { + if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 40 - fh * (-off) + 30 +15 - offset < y + 20 && (introAnimation != null ? introAnimation.isDone() : true)) { // Enabled outline m.toggleAnimation.setAnimation(m.isEnabled() ? 20 : 0, 5); diff --git a/src/main/java/dev/resent/visual/ui/animation/Animation.java b/src/main/java/dev/resent/visual/ui/animation/Animation.java index 470b319a..4b075cf9 100644 --- a/src/main/java/dev/resent/visual/ui/animation/Animation.java +++ b/src/main/java/dev/resent/visual/ui/animation/Animation.java @@ -1,5 +1,8 @@ package dev.resent.visual.ui.animation; +import dev.resent.module.base.ModManager; +import dev.resent.module.impl.misc.HUD; + public abstract class Animation { public AnimationTimer timer = new AnimationTimer(); @@ -54,6 +57,8 @@ public abstract class Animation { } public double getValue() { + if(HUD.animationTheme.getValue().equals("None")) + return 0; if (direction == Direction.FORWARDS) { if (isDone()) return endPoint; return (getEquation(timer.getTime()) * endPoint); diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java b/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java index 2da48c83..aec5f698 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java @@ -94,7 +94,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()); + GlUtils.startScale(this.width / 2, this.height / 2, openAnim != null ? (float) openAnim.getValue() : 1); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(inventoryBackground); int i = this.guiLeft;