feat: Added scrolling to change slot
This commit is contained in:
parent
9e42e7ade8
commit
0f6d02a92e
@ -39,6 +39,23 @@ public class MouseHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void scroll(MouseEvent mouseEvent) {
|
private void scroll(MouseEvent mouseEvent) {
|
||||||
|
if (game.getWindow() == Window.WORLD) {
|
||||||
|
if (mouseEvent.getButton() == MouseEvent.Button.WheelUp) {
|
||||||
|
if (game.getInventory().getItemInhHandIndex() == 0) {
|
||||||
|
game.changeSlot(8, screenRenderer);
|
||||||
|
} else {
|
||||||
|
game.changeSlot(game.getInventory().getItemInhHandIndex() - 1, screenRenderer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mouseEvent.getButton() == MouseEvent.Button.WheelDown) {
|
||||||
|
if (game.getInventory().getItemInhHandIndex() == 8) {
|
||||||
|
game.changeSlot(0, screenRenderer);
|
||||||
|
} else {
|
||||||
|
game.changeSlot(game.getInventory().getItemInhHandIndex() + 1, screenRenderer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void leftClick(MouseEvent mouseEvent) {
|
private void leftClick(MouseEvent mouseEvent) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user