New: scroll on ItemQuantityField (#421)

This commit is contained in:
ghostflyby authored and GitHub committed 2023-09-24 13:18:11 +02:00
1 parent 1ed004e619
commit 95e9ac3c89
1 file changed
+16
@@ -52,4 +52,20 @@ public class ItemQuantityField extends TextField {
super.draw(mousex, mousey);
}
}
@Override
public boolean onMouseWheel(int i, int mx, int my) {
if (!contains(mx, my)) return false;
int multiplier = 1;
if (NEIClientUtils.shiftKey()) {
multiplier = 10;
} else if (NEIClientUtils.controlKey()) {
multiplier = 64;
}
int quantity = intValue() + i * multiplier;
setText(Integer.toString(quantity));
return true;
}
}