summaryrefslogtreecommitdiff
path: root/src/main/kotlin/gui/ScreenUtil.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/gui/ScreenUtil.kt')
-rw-r--r--src/main/kotlin/gui/ScreenUtil.kt19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/kotlin/gui/ScreenUtil.kt b/src/main/kotlin/gui/ScreenUtil.kt
new file mode 100644
index 0000000..bb3dfc3
--- /dev/null
+++ b/src/main/kotlin/gui/ScreenUtil.kt
@@ -0,0 +1,19 @@
+package moe.nea.ultranotifier.gui
+
+import gg.essential.universal.UScreen
+import moe.nea.ultranotifier.event.SubscriptionTarget
+import moe.nea.ultranotifier.event.TickEvent
+import moe.nea.ultranotifier.event.UltraSubscribe
+import net.minecraft.client.gui.screen.Screen
+
+object ScreenUtil : SubscriptionTarget {
+ var openScreen: Screen? = null
+
+ @UltraSubscribe
+ fun onTick(event: TickEvent) {
+ openScreen?.let {
+ UScreen.displayScreen(it)
+ openScreen = null
+ }
+ }
+}