fix being able to interact with the color chooser when it's disabled
@@ -68,21 +68,22 @@ public class ColorChooser extends Screen implements GuiEventListener, Narratable
@Override
public boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) {
+ if (!disabled) {
super.mouseDragged(mouseX, mouseY, button, dragX, dragY);
- if (!disabled && button == 0 && clickedInDragRegion) {
+ if (button == 0 && clickedInDragRegion) {
setSelection(mouseX, mouseY);
return true;
}
+ }
return false;
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
- super.mouseClicked(mouseX, mouseY, button);
-
if (!disabled) {
+ super.mouseClicked(mouseX, mouseY, button);
clickedInDragRegion = colorFieldHoverChecker.checkHover(mouseX, mouseY);
if (clickedInDragRegion)
@@ -94,10 +95,10 @@ public class ColorChooser extends Screen implements GuiEventListener, Narratable
@Override
public boolean mouseReleased(double mouseX, double mouseY, int button) {
+ if (!disabled) {
super.mouseReleased(mouseX, mouseY, button);
-
- if (!disabled)
clickedInDragRegion = false;
+ }
return false;
}
