Skip to content

Commit

Permalink
Merge pull request #1346 from paezao/issue-1330
Browse files Browse the repository at this point in the history
MouseWheel event fixed, closes #1330
  • Loading branch information
DreadKnight authored Jun 10, 2018
2 parents 9ea4716 + b9b35cf commit 8e52335
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/ui/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,32 +383,33 @@ export class UI {
}
});
// TODO: Function to exit dash via Tab or Esc hotkeys

$j('#combatwrapper, #dash, #toppanel').bind('mousewheel', (e, delta, deltaX, deltaY) => {
$j('#combatwrapper, #dash, #toppanel').bind('wheel', (e) => {
if (game.freezedInput) {
return;
}

// Dash
if (this.dashopen) {
if (delta > 0) {
if (e.originalEvent.deltaY > 0) {
// Wheel up
this.gridSelectPrevious();
} else if (delta < 0) {
} else if (e.originalEvent.deltaY < 0) {
// Wheel down
this.gridSelectNext();
}
// Abilities
} else {
if (delta > 0) {
if (e.originalEvent.deltaY > 0) {
// Wheel up
this.selectNextAbility();
// TODO: Allow to cycle between the usable active abilities by pressing the passive one's icon
} else if (delta < 0) {
} else if (e.originalEvent.deltaY < 0) {
// Wheel down
this.selectPreviousAbility();
}
}

e.preventDefault();
});

for (let i = 0; i < 4; i++) {
Expand Down

0 comments on commit 8e52335

Please sign in to comment.