summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorJ10a1n15 <45315647+j10a1n15@users.noreply.github.com>2024-06-16 17:31:50 +0200
committerGitHub <noreply@github.com>2024-06-16 17:31:50 +0200
commite9ea84e533f5db928a47850e87000f63bad49c45 (patch)
tree332596fc17517a97b38d3d263d5b08dba385c4e5 /src/main/java/at/hannibal2/skyhanni/data
parent37bb14382e8aac7798de1e567b8e9410727ef5fd (diff)
downloadskyhanni-e9ea84e533f5db928a47850e87000f63bad49c45.tar.gz
skyhanni-e9ea84e533f5db928a47850e87000f63bad49c45.tar.bz2
skyhanni-e9ea84e533f5db928a47850e87000f63bad49c45.zip
Improvement: Add Keybinds to Custom Wardrobe (#2105)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/GuiData.kt15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt
index 782f3224a..a96574a2b 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt
@@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.NEURenderEvent
import at.hannibal2.skyhanni.events.minecraft.ClientDisconnectEvent
+import at.hannibal2.skyhanni.features.inventory.wardrobe.CustomWardrobeKeybinds
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld
@@ -40,10 +41,18 @@ object GuiData {
@SubscribeEvent(priority = EventPriority.HIGH)
fun onGuiKeyPress(event: GuiScreenEvent.KeyboardInputEvent.Pre) {
- val (escKey, invKey) = Minecraft.getMinecraft().gameSettings.let {
- Keyboard.KEY_ESCAPE to it.keyBindInventory.keyCode
+ val keys = Minecraft.getMinecraft().gameSettings.let {
+ listOf(
+ Keyboard.KEY_ESCAPE,
+ it.keyBindInventory.keyCode,
+ it.keyBindScreenshot.keyCode,
+ it.keyBindFullscreen.keyCode,
+ )
}
- if (escKey.isKeyHeld() || invKey.isKeyHeld()) return
+ if (keys.any { it.isKeyHeld() }) return
+
+ if (CustomWardrobeKeybinds.allowKeyboardClick()) return
+
if (preDrawEventCancelled) event.isCanceled = true
}