animation fine-tuning, easing change
can change between ease-in-out and ease-out (default)
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
package org.saturnclient.saturnclient.config;
|
package org.saturnclient.saturnclient.config;
|
||||||
|
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
import org.saturnclient.ui2.anim.Curve;
|
||||||
import org.saturnclient.ui2.resources.Textures;
|
import org.saturnclient.ui2.resources.Textures;
|
||||||
|
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
@@ -13,11 +16,19 @@ public class SaturnClientConfig {
|
|||||||
public static Property<Boolean> bendyCloaks = Property.bool(true);
|
public static Property<Boolean> bendyCloaks = Property.bool(true);
|
||||||
public static Property<Integer> openEmoteWheel = Property.keybinding(GLFW.GLFW_KEY_B);
|
public static Property<Integer> openEmoteWheel = Property.keybinding(GLFW.GLFW_KEY_B);
|
||||||
public static Property<Boolean> stagger = Property.bool(true);
|
public static Property<Boolean> stagger = Property.bool(true);
|
||||||
|
public static Property<Integer> animationCurve = Property.select(1, "Ease In Out", "Ease Out");
|
||||||
|
|
||||||
public static Identifier getLogo() {
|
public static Identifier getLogo() {
|
||||||
return realisticLogo.value ? Textures.REALISTIC_LOGO : Textures.LOGO;
|
return realisticLogo.value ? Textures.REALISTIC_LOGO : Textures.LOGO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Function<Double, Double> getAnimationCurve() {
|
||||||
|
switch (animationCurve.value) {
|
||||||
|
case 1: return Curve::easeOutCubic;
|
||||||
|
default: return Curve::easeInOutCubic;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
config = new ConfigManager("Saturn Client");
|
config = new ConfigManager("Saturn Client");
|
||||||
config.property("Realistic logo", realisticLogo);
|
config.property("Realistic logo", realisticLogo);
|
||||||
@@ -25,6 +36,7 @@ public class SaturnClientConfig {
|
|||||||
config.property("Open Emote Wheel", openEmoteWheel);
|
config.property("Open Emote Wheel", openEmoteWheel);
|
||||||
config.property("Bendy Cloaks", bendyCloaks);
|
config.property("Bendy Cloaks", bendyCloaks);
|
||||||
config.property("Stagger Animations", stagger);
|
config.property("Stagger Animations", stagger);
|
||||||
|
config.property("Animation Curve", animationCurve);
|
||||||
|
|
||||||
// Initialize a sub namespace for theme
|
// Initialize a sub namespace for theme
|
||||||
Theme.init(config);
|
Theme.init(config);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.saturnclient.ui2.screens;
|
|||||||
|
|
||||||
import org.saturnclient.modules.ModManager;
|
import org.saturnclient.modules.ModManager;
|
||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
|
import org.saturnclient.saturnclient.config.SaturnClientConfig;
|
||||||
import org.saturnclient.ui2.SaturnScreen;
|
import org.saturnclient.ui2.SaturnScreen;
|
||||||
import org.saturnclient.ui2.anim.SlideFade;
|
import org.saturnclient.ui2.anim.SlideFade;
|
||||||
import org.saturnclient.ui2.components.SaturnModule;
|
import org.saturnclient.ui2.components.SaturnModule;
|
||||||
@@ -26,11 +27,13 @@ public class ModMenu extends SaturnScreen {
|
|||||||
int row = 0;
|
int row = 0;
|
||||||
int col = 0;
|
int col = 0;
|
||||||
|
|
||||||
AnimationStagger moduleStagger = new AnimationStagger(10);
|
AnimationStagger moduleStagger = new AnimationStagger(20);
|
||||||
|
|
||||||
for (Module mod : ModManager.ALL_MODS) {
|
for (Module mod : ModManager.ALL_MODS) {
|
||||||
moduleStagger.draw(
|
moduleStagger.draw(
|
||||||
new SaturnModule(mod).position((160 + g) * col, (50 + g) * row).animation(new SlideFade(600, -12)));
|
new SaturnModule(mod)
|
||||||
|
.position((160 + g) * col, (50 + g) * row)
|
||||||
|
.animation(new SlideFade(600, -12), SaturnClientConfig.getAnimationCurve()));
|
||||||
|
|
||||||
if (col == 2) {
|
if (col == 2) {
|
||||||
col = 0;
|
col = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user