From f77c856cdde7ec365be7c448f2dd8cc18d0f1f32 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Wed, 1 Jun 2022 20:13:36 +0200 Subject: better reverse maybe idk --- src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java | 4 ++-- .../java/cc/polyfrost/oneconfig/gui/animations/Animation.java | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/main/java/cc') diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java index 169aef0..6e9c1a5 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java @@ -127,14 +127,14 @@ public class OneConfigGui extends UScreen { if (backArrow.isClicked() && previousPages.size() > 0) { try { nextPages.add(0, currentPage); - openPage(previousPages.get(0), new EaseInOutQuad(300, 224, 2128, false), true); + openPage(previousPages.get(0), false); previousPages.remove(0); } catch (Exception ignored) { } } else if (forwardArrow.isClicked() && nextPages.size() > 0) { try { previousPages.add(0, currentPage); - openPage(nextPages.get(0), false); + openPage(nextPages.get(0), new EaseInOutQuad(300, 224, 2128, true), false); nextPages.remove(0); } catch (Exception ignored) { } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/animations/Animation.java b/src/main/java/cc/polyfrost/oneconfig/gui/animations/Animation.java index d8d672d..ebb9145 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/animations/Animation.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/animations/Animation.java @@ -16,9 +16,13 @@ public abstract class Animation { */ public Animation(float duration, float start, float end, boolean reverse) { this.duration = duration; + if (reverse) { + float temp = start; + start = end; + end = temp; + } this.start = start; - if (!reverse) this.change = end - start; - else this.change = start - end; + this.change = end - start; } /** -- cgit