diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-08-24 22:51:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-24 22:51:58 +0200 |
commit | daed9569a0f1d2231c4f824f6cffd72d5f8ae8bd (patch) | |
tree | 6efee702c616d96e40a3e69ce89425f0936a7598 /versions/src/main/java/cc/polyfrost/oneconfig | |
parent | a76b49be6dbeb0be3f88870e33d3e10e0e7f8e1c (diff) | |
download | OneConfig-daed9569a0f1d2231c4f824f6cffd72d5f8ae8bd.tar.gz OneConfig-daed9569a0f1d2231c4f824f6cffd72d5f8ae8bd.tar.bz2 OneConfig-daed9569a0f1d2231c4f824f6cffd72d5f8ae8bd.zip |
Notifs (#111)
* Start on notifications
* Finish notifications (pog)
* oop
* internalizing
* misc: set default duration to 4000ms
* Scaling notifs stuff
Co-authored-by: Wyvest <45589059+Wyvest@users.noreply.github.com>
Diffstat (limited to 'versions/src/main/java/cc/polyfrost/oneconfig')
-rw-r--r-- | versions/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java | 2 | ||||
-rw-r--r-- | versions/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/versions/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java b/versions/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java index 1e0704e..c67bd90 100644 --- a/versions/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java +++ b/versions/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java @@ -42,6 +42,7 @@ import cc.polyfrost.oneconfig.libs.eventbus.Subscribe; import cc.polyfrost.oneconfig.utils.commands.CommandManager; import cc.polyfrost.oneconfig.utils.gui.GuiUtils; import cc.polyfrost.oneconfig.utils.hypixel.HypixelUtils; +import cc.polyfrost.oneconfig.utils.Notifications; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import org.apache.logging.log4j.LogManager; @@ -150,6 +151,7 @@ public class OneConfig { EventManager.INSTANCE.register(new HudCore()); HypixelUtils.INSTANCE.initialize(); EventManager.INSTANCE.register(KeyBindHandler.INSTANCE); + EventManager.INSTANCE.register(Notifications.INSTANCE); ConfigCore.sortMods(); initialized = true; diff --git a/versions/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java b/versions/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java index 0b14d38..48d52cb 100644 --- a/versions/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java +++ b/versions/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java @@ -33,9 +33,14 @@ import cc.polyfrost.oneconfig.config.data.*; import cc.polyfrost.oneconfig.config.Config; import cc.polyfrost.oneconfig.config.data.ModType; import cc.polyfrost.oneconfig.config.migration.VigilanceMigrator; +import cc.polyfrost.oneconfig.gui.animations.Animation; +import cc.polyfrost.oneconfig.gui.animations.EaseInOutQuart; import cc.polyfrost.oneconfig.gui.pages.HomePage; +import cc.polyfrost.oneconfig.internal.assets.SVGs; import cc.polyfrost.oneconfig.libs.universal.UChat; import cc.polyfrost.oneconfig.libs.universal.UKeyboard; +import cc.polyfrost.oneconfig.renderer.Icon; +import cc.polyfrost.oneconfig.utils.Notifications; public class TestConfig_Test extends Config { @@ -189,6 +194,16 @@ public class TestConfig_Test extends Config { super(new Mod("Test Mod", ModType.UTIL_QOL, new VigilanceMigrator("./config/testConfig.toml")), "hacksConfig.json"); initialize(); addDependency("testCheckBox", "testSwitch"); + + registerKeyBind(testKeyBind, () -> { + Animation barAnimation = new EaseInOutQuart(4000, 0f, 1f, false); + Notifications.INSTANCE.send( + "Title", + "Very epic long message that will need to wrap because yes.", + new Icon(SVGs.APERTURE_FILL), + () -> barAnimation.get() + ); + }); } } |