summaryrefslogtreecommitdiff
path: root/src/main/kotlin/gui/ScreenUtil.kt
blob: bb3dfc38a961a74d637713c987c3b6e363a6766e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
		}
	}
}