aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/GuiData.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobeKeybinds.kt5
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