aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-05-03 18:25:32 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-05-03 18:25:32 +0200
commita0ff501947a84b268e099524a06b56a6b900dad2 (patch)
treedb27ca1b28dbc7e57b8c99f54c80732d3042e856 /src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java
parentb798930b21b89b81be05a31281f768667a6dd7f3 (diff)
downloadOneConfig-a0ff501947a84b268e099524a06b56a6b900dad2.tar.gz
OneConfig-a0ff501947a84b268e099524a06b56a6b900dad2.tar.bz2
OneConfig-a0ff501947a84b268e099524a06b56a6b900dad2.zip
move to cc.polyfrost
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java b/src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java
deleted file mode 100644
index 054da16..0000000
--- a/src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package io.polyfrost.oneconfig.utils;
-
-import io.polyfrost.oneconfig.gui.OneConfigGui;
-import net.minecraft.client.Minecraft;
-import org.lwjgl.input.Mouse;
-
-public class InputUtils {
- /**
- * function to determine weather the mouse is currently over a specific region. Uses the current nvgScale to fix to any scale.
- *
- * @return true if mouse is over region, false if not.
- */
- public static boolean isAreaHovered(int x, int y, int width, int height) {
- int mouseX = Mouse.getX();
- int mouseY = Minecraft.getMinecraft().displayHeight - Math.abs(Mouse.getY());
- return mouseX > x && mouseY > y && mouseX < x + width && mouseY < y + height; // TODO add scaling info
- }
-
- 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 != null && OneConfigGui.INSTANCE.mouseDown && !Mouse.isButtonDown(0);
- }
-
- public static int mouseX() {
- return Mouse.getX();
- }
-
- public static int mouseY() {
- return Minecraft.getMinecraft().displayHeight - Math.abs(Mouse.getY());
- }
-}