aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl3/gui/controllers/PopupControllerScreen.java
diff options
context:
space:
mode:
authorCrendgrim <Crendgrim@users.noreply.github.com>2024-04-14 20:35:24 +0200
committerGitHub <noreply@github.com>2024-04-14 19:35:24 +0100
commitbb0690af2536edf9ff920c0c229de8b919215850 (patch)
tree4569fb3e674bf6d48c8108cb05e0427d077e4eae /src/main/java/dev/isxander/yacl3/gui/controllers/PopupControllerScreen.java
parent34b62af39b4c9a64e5c04ab8fdf5a978c1cde310 (diff)
downloadYetAnotherConfigLib-bb0690af2536edf9ff920c0c229de8b919215850.tar.gz
YetAnotherConfigLib-bb0690af2536edf9ff920c0c229de8b919215850.tar.bz2
YetAnotherConfigLib-bb0690af2536edf9ff920c0c229de8b919215850.zip
Make dropdown controllers use the new popup widget technology (#162)
* Make dropdown controllers use the new popup screen facility This finally allows for controlling the dropdown with a mouse! :D Scrolling, selecting, and accepting are all working! * Fix mouse hovering of dropdown controllers --------- Co-authored-by: isXander <xander@isxander.dev>
Diffstat (limited to 'src/main/java/dev/isxander/yacl3/gui/controllers/PopupControllerScreen.java')
-rw-r--r--src/main/java/dev/isxander/yacl3/gui/controllers/PopupControllerScreen.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/dev/isxander/yacl3/gui/controllers/PopupControllerScreen.java b/src/main/java/dev/isxander/yacl3/gui/controllers/PopupControllerScreen.java
index f6a5db3..bb860f0 100644
--- a/src/main/java/dev/isxander/yacl3/gui/controllers/PopupControllerScreen.java
+++ b/src/main/java/dev/isxander/yacl3/gui/controllers/PopupControllerScreen.java
@@ -47,11 +47,19 @@ public class PopupControllerScreen extends Screen {
@Override
public boolean mouseScrolled(double mouseX, double mouseY, /*? if >1.20.1 {*/ double scrollX, /*?}*/ double scrollY) {
+ if (controllerPopup.mouseScrolled(mouseX, mouseY, /*? if >1.20.1 {*/ scrollX, /*?}*/ scrollY)) {
+ return true;
+ }
backgroundYaclScreen.mouseScrolled(mouseX, mouseY, /*? if >1.20.1 {*/ scrollX, /*?}*/ scrollY); //mouseX & mouseY are needed here
return super.mouseScrolled(mouseX, mouseY, /*? if >1.20.1 {*/ scrollX, /*?}*/ scrollY);
}
@Override
+ public void mouseMoved(double mouseX, double mouseY) {
+ controllerPopup.mouseMoved(mouseX, mouseY);
+ }
+
+ @Override
public boolean charTyped(char codePoint, int modifiers) {
return controllerPopup.charTyped(codePoint, modifiers);
}