diff options
| author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2023-10-12 22:31:49 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-12 13:31:49 +0200 |
| commit | db0cd17c7019c072a5043ae8d0dca8ce6459fb32 (patch) | |
| tree | 3e8a33b6d434d02d637e596eecd707d4e8c17495 /src/main/java/at/hannibal2/skyhanni/data | |
| parent | d4084e697899f6dc3ceb87b4d229e0fe3819440a (diff) | |
| download | skyhanni-db0cd17c7019c072a5043ae8d0dca8ce6459fb32.tar.gz skyhanni-db0cd17c7019c072a5043ae8d0dca8ce6459fb32.tar.bz2 skyhanni-db0cd17c7019c072a5043ae8d0dca8ce6459fb32.zip | |
Fix + Backend: Made mouse buttons work as key binds (#560)
Fix + Backend: Made mouse buttons work as key binds #560
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt index 4313fcb35..2201ffd8b 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.core.config.Position import at.hannibal2.skyhanni.config.core.config.gui.GuiPositionEditor import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.isRancherSign import at.hannibal2.skyhanni.utils.NEUItems @@ -15,32 +15,22 @@ import net.minecraft.client.gui.inventory.GuiInventory import net.minecraft.client.renderer.GlStateManager import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import org.lwjgl.input.Keyboard import java.util.UUID class GuiEditManager { - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { + fun onKeyClick(event: LorenzKeyPressEvent) { if (!LorenzUtils.inSkyBlock) return + if (isInGui()) return Minecraft.getMinecraft().currentScreen?.let { if (it !is GuiInventory && it !is GuiChest && it !is GuiEditSign) return + if (it is GuiEditSign && !it.isRancherSign()) return } - if (!Keyboard.getEventKeyState()) return - val key = if (Keyboard.getEventKey() == 0) Keyboard.getEventCharacter().code + 256 else Keyboard.getEventKey() - if (SkyHanniMod.feature.gui.keyBindOpen != key) return - if (NEUItems.neuHasFocus()) return - val screen = Minecraft.getMinecraft().currentScreen - if (screen is GuiEditSign && !screen.isRancherSign()) { - return - } - - if (isInGui()) return - openGuiPositionEditor() + if (event.keyCode == SkyHanniMod.feature.gui.keyBindOpen) openGuiPositionEditor() } @SubscribeEvent(priority = EventPriority.LOWEST) |
