Move KeyMappings and KeyAccessor to fabric, to replace them using a RegisterKeyMappingsEvent in neoforge
Signed-off-by: Username404-59 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
2fa0575f68
commit
9503ac000b
|
@ -3,8 +3,6 @@
|
||||||
"package": "fr.username404.snowygui.mixins",
|
"package": "fr.username404.snowygui.mixins",
|
||||||
"compatibilityLevel": "JAVA_18",
|
"compatibilityLevel": "JAVA_18",
|
||||||
"client": [
|
"client": [
|
||||||
"KeysAccessor",
|
|
||||||
"KeyMappings",
|
|
||||||
"OptionValueAccessor"
|
"OptionValueAccessor"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
"client": [
|
"client": [
|
||||||
"EndTickMixin",
|
"EndTickMixin",
|
||||||
"TitleScreenMixin",
|
"TitleScreenMixin",
|
||||||
|
"KeysAccessor",
|
||||||
|
"KeyMappings",
|
||||||
"ZoomMixin",
|
"ZoomMixin",
|
||||||
"OkZoomerAlternativeMixin"
|
"OkZoomerAlternativeMixin"
|
||||||
],
|
],
|
||||||
|
|
|
@ -2,7 +2,9 @@ package fr.username404.snowygui.forge
|
||||||
|
|
||||||
import fr.username404.snowygui.ClickGui
|
import fr.username404.snowygui.ClickGui
|
||||||
import fr.username404.snowygui.gui.feature.ButtonImpl
|
import fr.username404.snowygui.gui.feature.ButtonImpl
|
||||||
|
import fr.username404.snowygui.misc.AddKeyMaps
|
||||||
import net.neoforged.bus.api.SubscribeEvent
|
import net.neoforged.bus.api.SubscribeEvent
|
||||||
|
import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent
|
||||||
import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent
|
import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent
|
||||||
|
|
||||||
object MiscHandlers {
|
object MiscHandlers {
|
||||||
|
@ -11,4 +13,10 @@ object MiscHandlers {
|
||||||
ClickGui.tick()
|
ClickGui.tick()
|
||||||
ButtonImpl.initButtons()
|
ButtonImpl.initButtons()
|
||||||
}
|
}
|
||||||
|
@SubscribeEvent
|
||||||
|
fun handleKeys(event: RegisterKeyMappingsEvent) {
|
||||||
|
AddKeyMaps.list.forEach {
|
||||||
|
event.register(it.key)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue