diff options
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java index bcfebd3..887d8d2 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java @@ -16,6 +16,7 @@ public class BasicElement { protected boolean disabled = false; protected int currentColor; protected final float radius; + private boolean block = false; public BasicElement(int width, int height, int colorPalette, boolean hoverFx) { this(width, height, colorPalette, hoverFx, 12f); @@ -50,7 +51,7 @@ public class BasicElement { return; } hovered = InputUtils.isAreaHovered(x - hitBoxX, y - hitBoxY, width + hitBoxX, height + hitBoxY); - clicked = InputUtils.isClicked() && hovered; + clicked = InputUtils.isClicked(block) && hovered; if (clicked) { toggled = !toggled; @@ -58,6 +59,10 @@ public class BasicElement { } } + public void ignoreBlockedTouches(boolean state) { + block = state; + } + public void onClick() { |