Skip to content

Commit

Permalink
fix issue#2511
Browse files Browse the repository at this point in the history
  • Loading branch information
Petrificus-totalus committed Oct 18, 2023
1 parent 920f3d6 commit 2697d68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/ui/hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ export class Hotkeys {
this.ui.btnExit.triggerClick();
}
}
pressTab(event) {
if (event.shiftKey) {
this.ui.$brandlogo.addClass('hide');
}
}

pressArrowUp() {
this.ui.dashopen ? this.ui.gridSelectUp() : this.ui.game.grid.selectHexUp();
Expand Down Expand Up @@ -187,6 +192,11 @@ export function getHotKeys(hk) {
hk.pressX(event);
},
},
Tab: {
onkeydown(event) {
hk.pressTab(event);
},
},
ArrowUp: {
onkeydown() {
hk.pressArrowUp();
Expand Down
6 changes: 4 additions & 2 deletions src/ui/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ export class UI {
if (keydownAction !== undefined) {
keydownAction.call(this, e);

e.preventDefault();
if (!(e.code === 'Tab' && e.shiftKey)) {
e.preventDefault();
}
}
});

Expand Down Expand Up @@ -1471,7 +1473,7 @@ export class UI {
this.showRandomCreature();
} else if (!randomize) {
this.showCreature('--', game.activeCreature.team, '');
} else if (this.lastViewedCreature) {
} else if (this.lastViewedCreature) {
this.showCreature(this.lastViewedCreature, game.activeCreature.team, '');
} else {
this.showCreature(game.activeCreature.type, game.activeCreature.team, '');
Expand Down

0 comments on commit 2697d68

Please sign in to comment.