diff options
author | J10a1n15 <45315647+j10a1n15@users.noreply.github.com> | 2024-07-07 11:25:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-07 11:25:13 +0200 |
commit | 63fe8d8986954ab8c274018e069957886503e5e6 (patch) | |
tree | b435103ed4a7c2961d10db24e91614e6601e2c6b /src | |
parent | bcbdf74c9563c555c767dc6ef26558152810e645 (diff) | |
download | skyhanni-63fe8d8986954ab8c274018e069957886503e5e6.tar.gz skyhanni-63fe8d8986954ab8c274018e069957886503e5e6.tar.bz2 skyhanni-63fe8d8986954ab8c274018e069957886503e5e6.zip |
Fix: Wardrobe Keybinds (#2198)
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/GuiData.kt | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobeKeybinds.kt | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt index a96574a2b..38ac99d1b 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt @@ -39,9 +39,9 @@ object GuiData { if (preDrawEventCancelled) event.isCanceled = true } - @SubscribeEvent(priority = EventPriority.HIGH) + @SubscribeEvent(priority = EventPriority.HIGHEST) fun onGuiKeyPress(event: GuiScreenEvent.KeyboardInputEvent.Pre) { - val keys = Minecraft.getMinecraft().gameSettings.let { + val allowedKeys = Minecraft.getMinecraft().gameSettings.let { listOf( Keyboard.KEY_ESCAPE, it.keyBindInventory.keyCode, @@ -49,7 +49,7 @@ object GuiData { it.keyBindFullscreen.keyCode, ) } - if (keys.any { it.isKeyHeld() }) return + if (allowedKeys.any { it.isKeyHeld() }) return if (CustomWardrobeKeybinds.allowKeyboardClick()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobeKeybinds.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobeKeybinds.kt index 2e3716cb2..502255afa 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobeKeybinds.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobeKeybinds.kt @@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.events.GuiKeyPressEvent import at.hannibal2.skyhanni.features.inventory.wardrobe.CustomWardrobe.clickSlot import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyClicked +import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.SimpleTimeMark import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -33,8 +34,8 @@ object CustomWardrobeKeybinds { if (!isEnabled()) return val slots = WardrobeAPI.slots.filter { it.isInCurrentPage() } - for ((key, index) in keybinds.withIndex().map { it.value to it.index }) { - if (!key.isKeyClicked()) continue + for ((index, key) in keybinds.withIndex()) { + if (!key.isKeyHeld()) continue if (lastClick.passedSince() < 200.milliseconds) break val slot = slots.getOrNull(index) ?: continue |