aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/utils
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-09-04 13:29:43 +0200
committerGitHub <noreply@github.com>2022-09-04 07:29:43 -0400
commit17cfe96255f1ec3ab5609aa153d4abed2075c435 (patch)
tree5fd414d196140a97492ef25ef4d0ea925e107ac3 /src/main/java/cc/polyfrost/oneconfig/utils
parent4c60b452efda24794c0faa5f300fdd830edcd383 (diff)
downloadOneConfig-17cfe96255f1ec3ab5609aa153d4abed2075c435.tar.gz
OneConfig-17cfe96255f1ec3ab5609aa153d4abed2075c435.tar.bz2
OneConfig-17cfe96255f1ec3ab5609aa153d4abed2075c435.zip
Disable the flashbang feature (#124)
Bang! I get up, I get down and I'm jumping around And the rumpus and ruckus are comfortable now Been a hell of a ride but I'm thinking it's time to grow Bang! Bang! Bang! So I got an apartment across from the park Put quinoa in my fridge, still I'm not feeling grown Been a hell of a ride but I'm thinking it's time to go Bang! Bang! Bang! (Here we go) So put your best face on everybody Pretend you know this song Everybody come hang (come hang) Let's go out with a bang Bang! Bang! Bang! I'm way too young to lie here forever I'm way too old to try so whatever come hang (come hang) Let's go out with a bang Bang! Bang! Bang! Feel like I'm gonna puke 'cause my taxes are due Do my password begin with a one or a two? Been a hell of a ride but I'm thinking it's time to grow Bang! Bang! Bang! (Metronome) Man, I'm up to something (up to something) Ooh de la de do, thank you all for coming (all for coming) I hope you like the show 'Cause it's on a budget (on a budget) So ooh de la de do Yeah, come on, here we go Yeah, come on (Here we go) So put your best face on everybody Pretend you know this song Everybody come hang (come hang) Let's go out with a bang Bang! Bang! Bang! I'm way too young to lie here forever I'm way too old to try so whatever come hang (come hang) Let's go out with a bang Bang! Bang! Bang! (Bang! Bang! Bang! Bang!) Bang! Bang! Bang! (Bang! Bang! Bang! Bang! Bang! Bang!) Been a hell of a ride but I'm thinking it's time to go So put your best face on everybody Pretend you know this song Everybody come hang Let's go out with a bang Bang! Bang! Bang! (Here we go) So put your best face on everybody Pretend you know this song Everybody come hang (come hang) Let's go out with a bang Bang! Bang! Bang! (Bang! Bang! Bang! Bang! Bang! Bang!) I'm way too young to lie here forever I'm way too old to try so whatever come hang (come hang) Let's go out with a bang Bang! Bang! Bang! (Here we go) Bang! Bang!
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/utils')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/utils/Notifications.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/Notifications.java b/src/main/java/cc/polyfrost/oneconfig/utils/Notifications.java
index b1fb387..2e64040 100644
--- a/src/main/java/cc/polyfrost/oneconfig/utils/Notifications.java
+++ b/src/main/java/cc/polyfrost/oneconfig/utils/Notifications.java
@@ -27,6 +27,8 @@
package cc.polyfrost.oneconfig.utils;
import cc.polyfrost.oneconfig.events.event.HudRenderEvent;
+import cc.polyfrost.oneconfig.events.event.RenderEvent;
+import cc.polyfrost.oneconfig.events.event.Stage;
import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.gui.animations.Animation;
import cc.polyfrost.oneconfig.gui.animations.DummyAnimation;
@@ -36,6 +38,7 @@ import cc.polyfrost.oneconfig.libs.eventbus.Subscribe;
import cc.polyfrost.oneconfig.libs.universal.UResolution;
import cc.polyfrost.oneconfig.renderer.Icon;
import cc.polyfrost.oneconfig.renderer.RenderManager;
+import cc.polyfrost.oneconfig.utils.gui.GuiUtils;
import org.jetbrains.annotations.Nullable;
import java.util.LinkedHashMap;
@@ -219,6 +222,8 @@ public final class Notifications {
send(title, message, (Callable<Float>) null);
}
+ private float deltaTime = 0;
+
@Subscribe
private void onHudRender(HudRenderEvent event) {
RenderManager.setupAndDraw((vg) -> {
@@ -229,10 +234,18 @@ public final class Notifications {
entry.setValue(new DummyAnimation(desiredPosition));
else if (desiredPosition != entry.getValue().getEnd())
entry.setValue(new EaseInOutQuad(250, entry.getValue().get(0), desiredPosition, false));
- float height = entry.getKey().draw(vg, UResolution.getWindowHeight() / scale + entry.getValue().get(), scale);
+ float height = entry.getKey().draw(vg, UResolution.getWindowHeight() / scale + entry.getValue().get(deltaTime), scale, deltaTime);
desiredPosition -= height + 16f;
}
notifications.entrySet().removeIf(entry -> entry.getKey().isFinished());
});
+ deltaTime = 0;
+ }
+
+ @Subscribe
+ private void onRenderEvent(RenderEvent event) {
+ if (event.stage == Stage.START) {
+ deltaTime += GuiUtils.getDeltaTime(); // add up deltatime since we might not render every frame because of hud caching
+ }
}
}