diff options
author | xander <xander@isxander.dev> | 2022-09-04 18:29:32 +0100 |
---|---|---|
committer | xander <xander@isxander.dev> | 2022-09-04 18:29:38 +0100 |
commit | 89f4185969e347c8649dea58bf85a09aad9d9983 (patch) | |
tree | be1aa640ce099558f3f1ca7f7943b98a54584af0 /src/main/java/dev/isxander/yacl/gui/controllers/EnumController.java | |
parent | 80a9a0e744ed2bf3c00c75b2d6edc25bd93801a2 (diff) | |
download | YetAnotherConfigLib-89f4185969e347c8649dea58bf85a09aad9d9983.tar.gz YetAnotherConfigLib-89f4185969e347c8649dea58bf85a09aad9d9983.tar.bz2 YetAnotherConfigLib-89f4185969e347c8649dea58bf85a09aad9d9983.zip |
collapsible groups, string controller
Diffstat (limited to 'src/main/java/dev/isxander/yacl/gui/controllers/EnumController.java')
-rw-r--r-- | src/main/java/dev/isxander/yacl/gui/controllers/EnumController.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/dev/isxander/yacl/gui/controllers/EnumController.java b/src/main/java/dev/isxander/yacl/gui/controllers/EnumController.java index cb25963..9d8e59c 100644 --- a/src/main/java/dev/isxander/yacl/gui/controllers/EnumController.java +++ b/src/main/java/dev/isxander/yacl/gui/controllers/EnumController.java @@ -4,6 +4,7 @@ import dev.isxander.yacl.api.Controller; import dev.isxander.yacl.api.NameableEnum; import dev.isxander.yacl.api.Option; import dev.isxander.yacl.api.utils.Dimension; +import dev.isxander.yacl.gui.AbstractWidget; import dev.isxander.yacl.gui.YACLScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.text.Text; @@ -72,7 +73,7 @@ public class EnumController<T extends Enum<T>> implements Controller<T> { * {@inheritDoc} */ @Override - public ControllerWidget<EnumController<T>> provideWidget(YACLScreen screen, Dimension<Integer> widgetDimension) { + public AbstractWidget provideWidget(YACLScreen screen, Dimension<Integer> widgetDimension) { return new EnumControllerElement<>(this, screen, widgetDimension, option().typeClass().getEnumConstants()); } @@ -108,7 +109,7 @@ public class EnumController<T extends Enum<T>> implements Controller<T> { @Override public boolean keyPressed(int keyCode, int scanCode, int modifiers) { - if (!focused && !hovered) + if (!focused) return false; switch (keyCode) { |