From b45139932346aeb3b0dbe9821f478f8132b0fce5 Mon Sep 17 00:00:00 2001 From: Lumberjacksparrow Date: Mon, 29 Dec 2025 13:17:18 -0800 Subject: [PATCH] Fix for inventory key not exiting the Arcane Workbench GUI #897 (Lumberjacksparrow) --- .../wizardry/client/gui/GuiArcaneWorkbench.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/electroblob/wizardry/client/gui/GuiArcaneWorkbench.java b/src/main/java/electroblob/wizardry/client/gui/GuiArcaneWorkbench.java index 6037008c..693c9987 100644 --- a/src/main/java/electroblob/wizardry/client/gui/GuiArcaneWorkbench.java +++ b/src/main/java/electroblob/wizardry/client/gui/GuiArcaneWorkbench.java @@ -515,12 +515,13 @@ public class GuiArcaneWorkbench extends GuiContainer { @Override protected void keyTyped(char typedChar, int keyCode) throws IOException { - if(this.searchNeedsClearing){ - this.searchNeedsClearing = false; + if(this.searchNeedsClearing){ + this.searchNeedsClearing = false; this.searchField.setText(""); } - if(this.searchField.textboxKeyTyped(typedChar, keyCode)){ + // Allow exiting the GUI by pressing the inventory button. Does not work if bookshelves are present by default + if(this.searchField.getVisible() && this.searchField.textboxKeyTyped(typedChar, keyCode)){ arcaneWorkbenchContainer.setSearchText(searchField.getText().toLowerCase(Locale.ROOT)); }else{ super.keyTyped(typedChar, keyCode); @@ -1062,4 +1063,4 @@ public class GuiArcaneWorkbench extends GuiContainer { } } -} \ No newline at end of file +}