Skip to content

Commit

Permalink
fix issue#2511
Browse files Browse the repository at this point in the history
  • Loading branch information
Petrificus-totalus authored and u7486259 committed Oct 22, 2023
1 parent 881ce1f commit 9712541
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 @@ -1480,7 +1482,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 9712541

Please sign in to comment.