Rounded rect & more animations
This commit is contained in:
parent
9d8d3eca93
commit
e7b80c834b
55577
javascript/classes.js
55577
javascript/classes.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -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));
|
||||
}
|
||||
}
|
21
src/main/java/dev/resent/animation/impl/EaseInOutQuad.java
Normal file
21
src/main/java/dev/resent/animation/impl/EaseInOutQuad.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
|
@ -5,6 +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.EaseInOutQuad;
|
||||
import dev.resent.animation.impl.ElasticAnimation;
|
||||
import dev.resent.module.base.Mod;
|
||||
import dev.resent.module.setting.BooleanSetting;
|
||||
|
@ -256,7 +257,8 @@ public class ClickGUI extends GuiScreen {
|
|||
@Override
|
||||
public void initGui() {
|
||||
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) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.minecraft.client.gui.inventory;
|
||||
|
||||
import dev.resent.util.misc.GlUtils;
|
||||
import dev.resent.animation.impl.DecelerateAnimation;
|
||||
import dev.resent.animation.impl.EaseBackIn;
|
||||
import dev.resent.animation.Animation;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
|
@ -63,7 +64,7 @@ public class GuiInventory extends InventoryEffectRenderer {
|
|||
*/
|
||||
public void initGui() {
|
||||
this.buttonList.clear();
|
||||
openAnim = new EaseBackIn(450, 1, 2);
|
||||
openAnim = new DecelerateAnimation(450, 1);
|
||||
if (this.mc.playerController.isInCreativeMode()) {
|
||||
this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer));
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user