1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Fix prettier

This commit is contained in:
Lukáš Doležal 2020-12-26 22:14:04 +00:00
parent 40b94aeb5d
commit e665df3a6c
5 changed files with 12 additions and 10 deletions

View File

@ -152,7 +152,7 @@ export class InputDistributor {
window.addEventListener("blur", this.handleBlur.bind(this));
window.addEventListener("gamepadconnected", this.handleGamepadConnected.bind(this))
window.addEventListener("gamepadconnected", this.handleGamepadConnected.bind(this));
}
forwardToReceiver(eventId, payload = null) {
@ -179,7 +179,7 @@ export class InputDistributor {
processGamepadInputs() {
if (this.connectedGamepadIndex === null) {
return
return;
}
const gamepad = navigator.getGamepads()[this.connectedGamepadIndex];
@ -189,7 +189,7 @@ export class InputDistributor {
const isInitial = !this.keysDown.has(keyCode);
if (button.pressed) {
logger.debug(`gamepad button [${index}]: ${button.pressed ? 'pressed' : ''}`)
logger.debug(`gamepad button [${index}]: ${button.pressed ? "pressed" : ""}`);
this.keysDown.add(keyCode);
this.forwardToReceiver("keydown", {
@ -197,7 +197,7 @@ export class InputDistributor {
shift: 0,
alt: 0,
initial: isInitial,
})
});
}
if (!button.pressed && !isInitial) {
this.keysDown.delete(keyCode);
@ -211,7 +211,6 @@ export class InputDistributor {
}
}
/**
* @param {Event} event
*/

View File

@ -151,7 +151,7 @@ export class HUDBaseToolbar extends BaseHUDPart {
}
isBuildingSelected() {
return Object.entries(this.buildingHandles).some(([_, handle]) => handle.selected)
return Object.entries(this.buildingHandles).some(([_, handle]) => handle.selected);
}
/**
@ -166,7 +166,8 @@ export class HUDBaseToolbar extends BaseHUDPart {
let newBuildingFound = false;
let newIndex = this.lastSelectedIndex;
if (this.isBuildingSelected()) {
const direction = this.root.keyMapper.getBinding(KEYMAPPINGS.placement.rotateInverseModifier).pressed
const direction = this.root.keyMapper.getBinding(KEYMAPPINGS.placement.rotateInverseModifier)
.pressed
? -1
: 1;

View File

@ -117,7 +117,9 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
keyActionMapper.getBinding(KEYMAPPINGS.general.back).add(this.abortPlacement, this);
keyActionMapper.getBinding(KEYMAPPINGS.placement.pipette).add(this.startPipette, this);
this.root.gameState.inputReciever.keyup.add(this.checkForDirectionLockSwitch, this);
keyActionMapper.getBinding(KEYMAPPINGS.placement.placeBuilding).add(this.tryPlaceCurrentBuildingAtCursor, this);
keyActionMapper
.getBinding(KEYMAPPINGS.placement.placeBuilding)
.add(this.tryPlaceCurrentBuildingAtCursor, this);
keyActionMapper.getBinding(KEYMAPPINGS.placement.delete).add(this.tryDeleteBelowCursor, this);
// BINDINGS TO GAME EVENTS