diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-06 22:05:48 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-06 22:05:48 +0200 |
commit | 23c8e2ad407d1889cdb4af38c64f0155f33bb105 (patch) | |
tree | ab637738a3b209546d35620e1a5eb3b4df751d4c /src/main/java/at/hannibal2/skyhanni/features | |
parent | 37bf7ad88fdfe9f431a1466a3ec2c86c70762e8a (diff) | |
download | skyhanni-23c8e2ad407d1889cdb4af38c64f0155f33bb105.tar.gz skyhanni-23c8e2ad407d1889cdb4af38c64f0155f33bb105.tar.bz2 skyhanni-23c8e2ad407d1889cdb4af38c64f0155f33bb105.zip |
Fixed Chat peek activating while inside a sign gui
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/ChatPeek.kt | 23 |
2 files changed, 25 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt index 382c5459f..e7051405c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt @@ -142,11 +142,11 @@ class GardenVisitorFeatures { list.add(Renderable.optionalLink("$name §ex${amount.addSeparators()}", { if (Minecraft.getMinecraft().currentScreen is GuiEditSign) { LorenzUtils.setTextIntoSign("$amount") - } else if (!InventoryUtils.inStorage() && !LorenzUtils.noTradeMode) { + } else if (!NEUItems.neuHasFocus() && !LorenzUtils.noTradeMode) { LorenzUtils.sendCommandToServer("bz ${name.removeColor()}") OSUtils.copyToClipboard("$amount") } - }) { GardenAPI.inGarden() && !InventoryUtils.inStorage() }) + }) { GardenAPI.inGarden() && !NEUItems.neuHasFocus() }) if (config.visitorNeedsShowPrice) { val price = NEUItems.getPrice(internalName) * amount diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ChatPeek.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ChatPeek.kt new file mode 100644 index 000000000..795c56290 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ChatPeek.kt @@ -0,0 +1,23 @@ +package at.hannibal2.skyhanni.features.misc + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.utils.NEUItems +import net.minecraft.client.Minecraft +import net.minecraft.client.gui.inventory.GuiEditSign +import org.lwjgl.input.Keyboard + + +object ChatPeek { + @JvmStatic + fun peek(): Boolean { + val key = SkyHanniMod.feature.chat.peekChat + + if (Minecraft.getMinecraft().thePlayer == null) return false + if (key <= Keyboard.KEY_NONE) return false + if (Minecraft.getMinecraft().currentScreen is GuiEditSign) return false + + if (NEUItems.neuHasFocus()) return false + + return Keyboard.isKeyDown(key) + } +}
\ No newline at end of file |