From daf3168671bc9c0cd64693d7129cddfdb1a08bb2 Mon Sep 17 00:00:00 2001 From: isXander Date: Sat, 3 Dec 2022 18:57:03 +0000 Subject: number fields + StringControllerElement improvements when highlighted text, arrow keys go to each side of the selection switch to InputUtil instead of GLFW bump yarn --- .../yacl/gui/controllers/cycling/CyclingControllerElement.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/java/dev/isxander/yacl/gui/controllers/cycling') diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/cycling/CyclingControllerElement.java b/src/client/java/dev/isxander/yacl/gui/controllers/cycling/CyclingControllerElement.java index ab0a9c3..246fbec 100644 --- a/src/client/java/dev/isxander/yacl/gui/controllers/cycling/CyclingControllerElement.java +++ b/src/client/java/dev/isxander/yacl/gui/controllers/cycling/CyclingControllerElement.java @@ -4,7 +4,7 @@ import dev.isxander.yacl.api.utils.Dimension; import dev.isxander.yacl.gui.YACLScreen; import dev.isxander.yacl.gui.controllers.ControllerWidget; import net.minecraft.client.gui.screen.Screen; -import org.lwjgl.glfw.GLFW; +import net.minecraft.client.util.InputUtil; public class CyclingControllerElement extends ControllerWidget> { @@ -39,11 +39,11 @@ public class CyclingControllerElement extends ControllerWidget + case InputUtil.GLFW_KEY_LEFT, InputUtil.GLFW_KEY_DOWN -> cycleValue(-1); - case GLFW.GLFW_KEY_RIGHT, GLFW.GLFW_KEY_UP -> + case InputUtil.GLFW_KEY_RIGHT, InputUtil.GLFW_KEY_UP -> cycleValue(1); - case GLFW.GLFW_KEY_ENTER, GLFW.GLFW_KEY_SPACE, GLFW.GLFW_KEY_KP_ENTER -> + case InputUtil.GLFW_KEY_ENTER, InputUtil.GLFW_KEY_SPACE, InputUtil.GLFW_KEY_KP_ENTER -> cycleValue(Screen.hasControlDown() || Screen.hasShiftDown() ? -1 : 1); default -> { return false; -- cgit