aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/utils
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-04-28 20:45:50 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-04-28 20:45:50 +0200
commit117d80ff0e343eecf260fd363db896166d8061d7 (patch)
tree8ef0ead687b69caf646874458beefa1d1710a38a /src/main/java/io/polyfrost/oneconfig/utils
parent7c5123ff64c751c19411982189321be3511a9815 (diff)
downloadOneConfig-117d80ff0e343eecf260fd363db896166d8061d7.tar.gz
OneConfig-117d80ff0e343eecf260fd363db896166d8061d7.tar.bz2
OneConfig-117d80ff0e343eecf260fd363db896166d8061d7.zip
better mousepressed handling, some more option types and some other things I forgor
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/utils')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java b/src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java
index e030c29..ab8d708 100644
--- a/src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java
+++ b/src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java
@@ -1,5 +1,6 @@
package io.polyfrost.oneconfig.utils;
+import io.polyfrost.oneconfig.gui.OneConfigGui;
import net.minecraft.client.Minecraft;
import org.lwjgl.input.Mouse;
@@ -15,8 +16,12 @@ public class InputUtils {
return mouseX > x && mouseY > y && mouseX < x + width && mouseY < y + height; // TODO add scaling info
}
- public static boolean isClicked(int x, int y, int width, int height) {
- return isAreaHovered(x, y, width, height) && Mouse.isButtonDown(0); // TODO make actually do what its meant to do (only 1 event)
+ public static boolean isAreaClicked(int x, int y, int width, int height) {
+ return isAreaHovered(x, y, width, height) && isClicked();
+ }
+
+ public static boolean isClicked() {
+ return OneConfigGui.INSTANCE.mouseDown && !Mouse.isButtonDown(0);
}
public static int mouseX() {