none animation theme

This commit is contained in:
ThisIsALegitUsername 2023-02-27 21:58:24 -05:00
parent d87867c13d
commit 285fc5cd67
3 changed files with 13 additions and 3 deletions

View File

@ -130,13 +130,18 @@ public class ClickGUI extends GuiScreen {
int off = 0; int off = 0;
if (close) { if (close) {
if(introAnimation == null) {
mc.displayGuiScreen(null);
return;
}
introAnimation.setDirection(Direction.BACKWARDS); introAnimation.setDirection(Direction.BACKWARDS);
if (introAnimation.isDone(Direction.BACKWARDS)) { if (introAnimation.isDone(Direction.BACKWARDS)) {
mc.displayGuiScreen(null); 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 // background
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());
@ -170,7 +175,7 @@ public class ClickGUI extends GuiScreen {
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) { for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) {
if (this.modWatching == null) { if (this.modWatching == null) {
int fh = 9; 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 // Enabled outline
m.toggleAnimation.setAnimation(m.isEnabled() ? 20 : 0, 5); m.toggleAnimation.setAnimation(m.isEnabled() ? 20 : 0, 5);

View File

@ -1,5 +1,8 @@
package dev.resent.visual.ui.animation; package dev.resent.visual.ui.animation;
import dev.resent.module.base.ModManager;
import dev.resent.module.impl.misc.HUD;
public abstract class Animation { public abstract class Animation {
public AnimationTimer timer = new AnimationTimer(); public AnimationTimer timer = new AnimationTimer();
@ -54,6 +57,8 @@ public abstract class Animation {
} }
public double getValue() { public double getValue() {
if(HUD.animationTheme.getValue().equals("None"))
return 0;
if (direction == Direction.FORWARDS) { if (direction == Direction.FORWARDS) {
if (isDone()) return endPoint; if (isDone()) return endPoint;
return (getEquation(timer.getTime()) * endPoint); return (getEquation(timer.getTime()) * endPoint);

View File

@ -94,7 +94,7 @@ public class GuiInventory extends InventoryEffectRenderer {
* Args : renderPartialTicks, mouseX, mouseY * Args : renderPartialTicks, mouseX, mouseY
*/ */
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { 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); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(inventoryBackground); this.mc.getTextureManager().bindTexture(inventoryBackground);
int i = this.guiLeft; int i = this.guiLeft;