aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl/gui/controllers/slider
diff options
context:
space:
mode:
authorxander <xander@isxander.dev>2022-09-15 19:22:40 +0100
committerxander <xander@isxander.dev>2022-09-15 19:22:40 +0100
commitb9ce9513c8e55ed53321d78b6fbbd07aacd5e987 (patch)
tree445836336f061c0be2cf601ecc294022f0cace33 /src/main/java/dev/isxander/yacl/gui/controllers/slider
parente8b6e383b368706c992425f7de7023f24d376d7c (diff)
downloadYetAnotherConfigLib-b9ce9513c8e55ed53321d78b6fbbd07aacd5e987.tar.gz
YetAnotherConfigLib-b9ce9513c8e55ed53321d78b6fbbd07aacd5e987.tar.bz2
YetAnotherConfigLib-b9ce9513c8e55ed53321d78b6fbbd07aacd5e987.zip
available property + fix category tooltips not showing
Diffstat (limited to 'src/main/java/dev/isxander/yacl/gui/controllers/slider')
-rw-r--r--src/main/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java b/src/main/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java
index fa763b7..d07377a 100644
--- a/src/main/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java
+++ b/src/main/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java
@@ -51,7 +51,7 @@ public class SliderControllerElement extends ControllerWidget<ISliderController<
@Override
protected void drawValueText(MatrixStack matrices, int mouseX, int mouseY, float delta) {
matrices.push();
- if (hovered || focused)
+ if (isHovered())
matrices.translate(-(sliderBounds.width() + 6 + getThumbWidth() / 2f), 0, 0);
super.drawValueText(matrices, mouseX, mouseY, delta);
matrices.pop();
@@ -59,7 +59,7 @@ public class SliderControllerElement extends ControllerWidget<ISliderController<
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
- if (button != 0 || !sliderBounds.isPointInside((int) mouseX, (int) mouseY))
+ if (!isAvailable() || button != 0 || !sliderBounds.isPointInside((int) mouseX, (int) mouseY))
return false;
mouseDown = true;
@@ -70,7 +70,7 @@ public class SliderControllerElement extends ControllerWidget<ISliderController<
@Override
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) {
- if (button != 0 || !mouseDown)
+ if (!isAvailable() || button != 0 || !mouseDown)
return false;
setValueFromMouse(mouseX);
@@ -84,7 +84,7 @@ public class SliderControllerElement extends ControllerWidget<ISliderController<
@Override
public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
- if ((!isMouseOver(mouseX, mouseY)) || (!Screen.hasShiftDown() && !Screen.hasControlDown()))
+ if (!isAvailable() || (!isMouseOver(mouseX, mouseY)) || (!Screen.hasShiftDown() && !Screen.hasControlDown()))
return false;
incrementValue(amount);
@@ -93,7 +93,7 @@ public class SliderControllerElement extends ControllerWidget<ISliderController<
@Override
public boolean mouseReleased(double mouseX, double mouseY, int button) {
- if (mouseDown)
+ if (isAvailable() && mouseDown)
playDownSound();
mouseDown = false;