Animation picker

This commit is contained in:
ThisIsALegitUsername 2023-01-30 23:54:29 +00:00
parent 3b02e08424
commit 643bd36ec1
8 changed files with 30081 additions and 30059 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -25,12 +25,12 @@ public class Theme {
return -1; return -1;
} }
public static Animation getAnimation(int id, int ms, int endpoint, float... etc){ public static Animation getAnimation(int id, int ms, int endpoint, float easeAmount, float elasticity, float smooth, boolean moreElasticity){
switch(id){ switch(id){
case 1: case 1:
return new EaseBackIn(ms, endpoint, etc[0]); return new EaseBackIn(ms, endpoint, easeAmount);
case 2: case 2:
return new ElasticAnimation(ms, endpoint, etc[0], etc[1], false); return new ElasticAnimation(ms, endpoint, elasticity, smooth, moreElasticity);
case 3: case 3:
return new EaseInOutQuad(ms, endpoint); return new EaseInOutQuad(ms, endpoint);
case 4: case 4:

View File

@ -3,7 +3,7 @@ package dev.resent.module.impl.hud;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import dev.resent.animation.SimpleAnimation; //import dev.resent.animation.SimpleAnimation;
import dev.resent.module.base.Category; import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule; import dev.resent.module.base.RenderModule;
import dev.resent.module.setting.BooleanSetting; import dev.resent.module.setting.BooleanSetting;
@ -64,7 +64,7 @@ public class KeyStrokes extends RenderModule{
return this.clicks2.size(); return this.clicks2.size();
} }
public static SimpleAnimation wOpacityAnimation = new SimpleAnimation(0), aOpacityAnimation = new SimpleAnimation(0), dOpacityAnimation = new SimpleAnimation(0), sOpacityAnimation = new SimpleAnimation(0), jumpOpacityAnimation = new SimpleAnimation(0); //public static SimpleAnimation wOpacityAnimation = new SimpleAnimation(0), aOpacityAnimation = new SimpleAnimation(0), dOpacityAnimation = new SimpleAnimation(0), sOpacityAnimation = new SimpleAnimation(0), jumpOpacityAnimation = new SimpleAnimation(0);
@Override @Override
public void draw() { public void draw() {
@ -77,11 +77,11 @@ public class KeyStrokes extends RenderModule{
boolean sKey = mc.gameSettings.keyBindBack.pressed; boolean sKey = mc.gameSettings.keyBindBack.pressed;
boolean jumpKey = mc.gameSettings.keyBindJump.pressed; boolean jumpKey = mc.gameSettings.keyBindJump.pressed;
wOpacityAnimation.setAnimation(wKey ? 0.8f*255 : 0, 14); // wOpacityAnimation.setAnimation(wKey ? 0.8f*255 : 0, 14);
aOpacityAnimation.setAnimation(aKey ? 0.8f*255 : 0, 14); // aOpacityAnimation.setAnimation(aKey ? 0.8f*255 : 0, 14);
dOpacityAnimation.setAnimation(dKey ? 0.8f*255 : 0, 14); // dOpacityAnimation.setAnimation(dKey ? 0.8f*255 : 0, 14);
sOpacityAnimation.setAnimation(sKey ? 0.8f*255 : 0, 14); // sOpacityAnimation.setAnimation(sKey ? 0.8f*255 : 0, 14);
jumpOpacityAnimation.setAnimation(jumpKey ? 0.8f*255 : 0, 14); // jumpOpacityAnimation.setAnimation(jumpKey ? 0.8f*255 : 0, 14);
if (pressed != this.wasPressed) { if (pressed != this.wasPressed) {
this.lastPressed = System.currentTimeMillis(); this.lastPressed = System.currentTimeMillis();

View File

@ -5,7 +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.SmoothStepAnimation; import dev.resent.module.Theme;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.setting.BooleanSetting; import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting; import dev.resent.module.setting.ModeSetting;
@ -256,7 +256,7 @@ public class ClickGUI extends GuiScreen {
@Override @Override
public void initGui() { public void initGui() {
mc.gameSettings.loadOptions(); mc.gameSettings.loadOptions();
introAnimation = new SmoothStepAnimation(750, 1); introAnimation = Theme.getAnimation(Theme.getAnimationId(), 750, 1, 2, 3.8f, 1.25f, false);
//introAnimation = new ElasticAnimation(750, 1, 3.8f, 1.35f, false); //introAnimation = new ElasticAnimation(750, 1, 3.8f, 1.35f, false);
} }

View File

@ -15,5 +15,12 @@ public class GlUtils {
GlStateManager.popMatrix(); GlStateManager.popMatrix();
} }
public static void startTranslate(float x, float y) {
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, 0);
}
public static void stopTranslate() {
GlStateManager.popMatrix();
}
} }

View File

@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.resent.animation.SimpleAnimation; import dev.resent.animation.SimpleAnimation;
import dev.resent.util.misc.GlUtils;
import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
@ -281,6 +282,7 @@ public class GuiChat extends GuiScreen {
*/ */
public void drawScreen(int i, int j, float f) { public void drawScreen(int i, int j, float f) {
animation.setAnimation(30, 20); animation.setAnimation(30, 20);
GlUtils.startTranslate(0, 29 - (int) animation.getValue());
drawRect(2, this.height - 14, this.width - 2, this.height - 2, Integer.MIN_VALUE); drawRect(2, this.height - 14, this.width - 2, this.height - 2, Integer.MIN_VALUE);
this.inputField.drawTextBox(); this.inputField.drawTextBox();
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
@ -293,6 +295,7 @@ public class GuiChat extends GuiScreen {
exitButton.yPosition = 3 + mc.guiAchievement.getHeight(); exitButton.yPosition = 3 + mc.guiAchievement.getHeight();
} }
GlUtils.stopTranslate();
super.drawScreen(i, j, f); super.drawScreen(i, j, f);
} }

View File

@ -1,9 +1,8 @@
package net.minecraft.client.gui.inventory; 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 dev.resent.animation.Animation;
import dev.resent.module.Theme;
import dev.resent.util.misc.GlUtils;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper; import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -64,7 +63,7 @@ public class GuiInventory extends InventoryEffectRenderer {
*/ */
public void initGui() { public void initGui() {
this.buttonList.clear(); this.buttonList.clear();
openAnim = new DecelerateAnimation(450, 1); openAnim = Theme.getAnimation(Theme.getAnimationId(), 450, 1, 2, 3.8f, 1.35f, false);
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 {