diff --git a/client/app.js b/client/app.js index 38cd101..951bbb9 100644 --- a/client/app.js +++ b/client/app.js @@ -238,6 +238,19 @@ export class App extends decorate(class {}) { case 'e': this.isMenuOpened = !this.isMenuOpened; break; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '0': + const slotIndex = (parseInt(key) + 9) % 10; + this.setActiveSlotIndex(slotIndex); + break; } } @@ -342,10 +355,10 @@ export class App extends decorate(class {}) { } const activeSlotIndex = this.selfEntity.activeSlotIndex; if (event.deltaY > 0) { - this.selfEntity.activeSlotIndex = (activeSlotIndex + 1) % 10; + this.setActiveSlotIndex((activeSlotIndex + 1) % 10); } else if (event.deltaY < 0) { - this.selfEntity.activeSlotIndex = (activeSlotIndex + 9) % 10; + this.setActiveSlotIndex((activeSlotIndex + 9) % 10); } } @@ -435,6 +448,12 @@ export class App extends decorate(class {}) { ReactDOM.render(DebugUiComponent, this.debugUiNode); } + setActiveSlotIndex(slotIndex) { + if (this.selfEntity) { + this.selfEntity.activeSlotIndex = slotIndex; + } + } + startProcessingInput() { const config = this.readConfig(); // Pointer input.