From eb6ac3662d86c3f1fbe2f73299407c83d83c96bd Mon Sep 17 00:00:00 2001 From: JTK222 | Lukas Date: Thu, 31 Oct 2024 18:36:10 +0100 Subject: [PATCH] Implements #480 --- .../main/java/hunternif/mc/impl/atlas/client/KeyHandler.java | 4 ++-- .../java/hunternif/mc/impl/atlas/client/gui/GuiAtlas.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/hunternif/mc/impl/atlas/client/KeyHandler.java b/common/src/main/java/hunternif/mc/impl/atlas/client/KeyHandler.java index 075701d23..e14e48a95 100644 --- a/common/src/main/java/hunternif/mc/impl/atlas/client/KeyHandler.java +++ b/common/src/main/java/hunternif/mc/impl/atlas/client/KeyHandler.java @@ -9,11 +9,11 @@ import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.option.KeyBinding; import net.minecraft.client.util.InputUtil; - +import org.lwjgl.glfw.GLFW; @Environment(EnvType.CLIENT) public class KeyHandler { - public static final KeyBinding ATLAS_KEYMAPPING = new KeyBinding("key.openatlas.desc", InputUtil.Type.KEYSYM, 77, "key.antiqueatlas.category"); + public static final KeyBinding ATLAS_KEYMAPPING = new KeyBinding("key.openatlas.desc", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_M, "key.antiqueatlas.category"); public static void registerBindings() { KeyMappingRegistry.register(ATLAS_KEYMAPPING); diff --git a/common/src/main/java/hunternif/mc/impl/atlas/client/gui/GuiAtlas.java b/common/src/main/java/hunternif/mc/impl/atlas/client/gui/GuiAtlas.java index 0511dcfb2..fa12e188f 100644 --- a/common/src/main/java/hunternif/mc/impl/atlas/client/gui/GuiAtlas.java +++ b/common/src/main/java/hunternif/mc/impl/atlas/client/gui/GuiAtlas.java @@ -652,7 +652,7 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) { setMapScale(mapScale * 2); } else if (keyCode == GLFW.GLFW_KEY_MINUS || keyCode == GLFW.GLFW_KEY_KP_SUBTRACT) { setMapScale(mapScale / 2); - } else if (keyCode == GLFW.GLFW_KEY_ESCAPE) { + } else if (keyCode == GLFW.GLFW_KEY_ESCAPE || (AntiqueAtlasMod.CONFIG.itemNeeded &&KeyHandler.ATLAS_KEYMAPPING.matchesKey(keyCode, scanCode))) { close(); } else { KeyBinding[] hotbarKeys = MinecraftClient.getInstance().options.hotbarKeys;