Rounded rect & more animations

This commit is contained in:
ThisIsALegitUsername 2023-01-30 23:14:49 +00:00
parent 9d8d3eca93
commit e7b80c834b
6 changed files with 27835 additions and 27792 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,20 @@
package dev.resent.animation.impl;
import dev.resent.animation.Animation;
import dev.resent.animation.Direction;
public class DecelerateAnimation extends Animation {
public DecelerateAnimation(int ms, double endPoint) {
super(ms, endPoint);
}
public DecelerateAnimation(int ms, double endPoint, Direction direction) {
super(ms, endPoint, direction);
}
protected double getEquation(double x) {
double x1 = x / duration;
return 1 - ((x1 - 1) * (x1 - 1));
}
}

View File

@ -0,0 +1,21 @@
package dev.resent.animation.impl;
import dev.resent.animation.Animation;
import dev.resent.animation.Direction;
public class EaseInOutQuad extends Animation {
public EaseInOutQuad(int ms, double endPoint) {
super(ms, endPoint);
}
public EaseInOutQuad(int ms, double endPoint, Direction direction) {
super(ms, endPoint, direction);
}
protected double getEquation(double x1) {
double x = x1 / duration;
return x < 0.5 ? 2 * Math.pow(x, 2) : 1 - Math.pow(-2 * x + 2, 2) / 2;
}
}

View File

@ -5,6 +5,7 @@ import java.io.IOException;
import dev.resent.Resent; import dev.resent.Resent;
import dev.resent.animation.Animation; import dev.resent.animation.Animation;
import dev.resent.animation.Direction; import dev.resent.animation.Direction;
import dev.resent.animation.impl.EaseInOutQuad;
import dev.resent.animation.impl.ElasticAnimation; import dev.resent.animation.impl.ElasticAnimation;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.setting.BooleanSetting; import dev.resent.module.setting.BooleanSetting;
@ -256,7 +257,8 @@ public class ClickGUI extends GuiScreen {
@Override @Override
public void initGui() { public void initGui() {
mc.gameSettings.loadOptions(); mc.gameSettings.loadOptions();
introAnimation = new ElasticAnimation(750, 1, 3.8f, 1.35f, false); introAnimation = new EaseInOutQuad(750, 1);
//introAnimation = new ElasticAnimation(750, 1, 3.8f, 1.35f, false);
} }
protected void keyTyped(char par1, int par2) { protected void keyTyped(char par1, int par2) {

View File

@ -1,6 +1,7 @@
package net.minecraft.client.gui.inventory; package net.minecraft.client.gui.inventory;
import dev.resent.util.misc.GlUtils; import dev.resent.util.misc.GlUtils;
import dev.resent.animation.impl.DecelerateAnimation;
import dev.resent.animation.impl.EaseBackIn; import dev.resent.animation.impl.EaseBackIn;
import dev.resent.animation.Animation; import dev.resent.animation.Animation;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -63,7 +64,7 @@ public class GuiInventory extends InventoryEffectRenderer {
*/ */
public void initGui() { public void initGui() {
this.buttonList.clear(); this.buttonList.clear();
openAnim = new EaseBackIn(450, 1, 2); openAnim = new DecelerateAnimation(450, 1);
if (this.mc.playerController.isInCreativeMode()) { if (this.mc.playerController.isInCreativeMode()) {
this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer));
} else { } else {