From 0f853804ef7c626e9c31749d6f948aa6bb23f4db Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Sun, 12 Jun 2022 12:17:43 +0200 Subject: prefernces, keybinds, scrolling fixes --- .../java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/elements') diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java index b7d1a68..1aa5d66 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java @@ -6,6 +6,7 @@ import cc.polyfrost.oneconfig.config.core.OneKeyBind; import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.gui.elements.BasicButton; +import cc.polyfrost.oneconfig.internal.config.core.KeyBindHandler; import cc.polyfrost.oneconfig.renderer.RenderManager; import cc.polyfrost.oneconfig.renderer.font.Fonts; import cc.polyfrost.oneconfig.internal.assets.SVGs; @@ -22,6 +23,7 @@ public class ConfigKeyBind extends BasicOption { super(field, parent, name, category, subcategory, size); button = new BasicButton(256, 32, "", SVGs.KEYSTROKE, null, BasicButton.ALIGNMENT_JUSTIFIED, ColorPalette.SECONDARY); button.setToggleable(true); + KeyBindHandler.addKeyBind(getKeyBind()); } public static ConfigKeyBind create(Field field, Object parent) { @@ -71,6 +73,7 @@ public class ConfigKeyBind extends BasicOption { private OneKeyBind getKeyBind() { OneKeyBind keyBind = new OneKeyBind(); try { + field.setAccessible(true); keyBind = (OneKeyBind) get(); } catch (IllegalAccessException ignored) { } -- cgit