Skip to content

Commit eb4b632

Browse files
committed
changing active inv with digits
1 parent 391e233 commit eb4b632

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/client/scripts/EventHandler.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ class EventHandler {
3838
//Keydown
3939
$(document).on("keydown", function (z) {
4040
_this.keys[z.code] = true;
41+
//Digits
42+
for (var i = 1; i < 10; i++) {
43+
if (z.code === `Digit${i}` && _this.gameState === "gameLock") {
44+
_this.game.inv_bar.setFocus(i - 1);
45+
focus = i - 1;
46+
}
47+
}
4148
//Klawisz Escape
4249
if (z.code === "Escape" && _this.gameState === "inventory") {
4350
_this.setState("menu");

0 commit comments

Comments
 (0)