Skip to content

Commit

Permalink
New: scroll on ItemQuantityField (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostflyby authored Sep 24, 2023
1 parent 1ed004e commit 95e9ac3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/codechicken/nei/ItemQuantityField.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,20 @@ public void draw(int mousex, int mousey) {
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;
}

}

0 comments on commit 95e9ac3

Please sign in to comment.