From 8eb2a20924b4aacd9d3f470d52191ff9165c6042 Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Sun, 12 Sep 2021 15:23:48 +0300 Subject: Fix #137, bump version to 4.2.1 --- gradle.properties | 2 +- .../cotton/gui/client/CottonInventoryScreen.java | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/gradle.properties b/gradle.properties index 9a05455..4d860e1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G loader_version=0.11.6 # Mod Properties - mod_version = 4.2.0 + mod_version = 4.2.1 maven_group = io.github.cottonmc archives_base_name = LibGui diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java index 953563c..82d8d4b 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java @@ -163,21 +163,12 @@ public class CottonInventoryScreen extends Handl @Override public boolean keyPressed(int ch, int keyCode, int modifiers) { - //System.out.println("Key " + Integer.toHexString(ch)+" "+Integer.toHexString(keyCode)); - if (ch==GLFW.GLFW_KEY_ESCAPE) { - onClose(); - return true; - } else if (ch==GLFW.GLFW_KEY_TAB) { - changeFocus(!hasShiftDown()); - return true; + if (ch == GLFW.GLFW_KEY_ESCAPE || ch == GLFW.GLFW_KEY_TAB) { + // special hardcoded keys, these will never be delivered to widgets + return super.keyPressed(ch, keyCode, modifiers); } else { - //if (super.keyPressed(ch, keyCode, modifiers)) return true; if (description.getFocus()==null) { - if (client.options.keyInventory.matchesKey(ch, keyCode)) { - this.client.player.closeHandledScreen(); - return true; - } - return false; + return super.keyPressed(ch, keyCode, modifiers); } else { description.getFocus().onKeyPressed(ch, keyCode, modifiers); return true; -- cgit