From e3b0c5d5a0d05017a3f5e8fc8ecf17580e2c5474 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 1 Nov 2023 22:26:31 +0100 Subject: Disabled diana warp key while inside every gui. --- .../at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt | 2 ++ src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt index 32fa93e6d..0810d53e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt @@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.sorted import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.SimpleTimeMark +import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds @@ -22,6 +23,7 @@ class BurrowWarpHelper { if (!config.burrowNearestWarp) return if (event.keyCode != config.keyBindWarp) return + if (Minecraft.getMinecraft().currentScreen != null) return currentWarp?.let { if (lastWarpTime.passedSince() > 5.seconds) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt b/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt index 3314bde7f..5078a492f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt @@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent import io.github.moulberry.moulconfig.gui.GuiScreenElementWrapper import io.github.moulberry.moulconfig.internal.KeybindHelper import net.minecraft.client.Minecraft +import net.minecraft.client.gui.GuiChat import net.minecraft.client.settings.KeyBinding import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.apache.commons.lang3.SystemUtils @@ -27,8 +28,10 @@ object KeyboardManager { @SubscribeEvent fun onTick(event: LorenzTickEvent) { - val isConfigScreen = Minecraft.getMinecraft().currentScreen is GuiScreenElementWrapper + val currentScreen = Minecraft.getMinecraft().currentScreen + val isConfigScreen = currentScreen is GuiScreenElementWrapper if (isConfigScreen) return + if (currentScreen is GuiChat) return if (Mouse.getEventButtonState() && Mouse.getEventButton() != -1) { -- cgit