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:
parent
40b94aeb5d
commit
e665df3a6c
@ -152,7 +152,7 @@ export class InputDistributor {
|
|||||||
|
|
||||||
window.addEventListener("blur", this.handleBlur.bind(this));
|
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) {
|
forwardToReceiver(eventId, payload = null) {
|
||||||
@ -179,7 +179,7 @@ export class InputDistributor {
|
|||||||
|
|
||||||
processGamepadInputs() {
|
processGamepadInputs() {
|
||||||
if (this.connectedGamepadIndex === null) {
|
if (this.connectedGamepadIndex === null) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gamepad = navigator.getGamepads()[this.connectedGamepadIndex];
|
const gamepad = navigator.getGamepads()[this.connectedGamepadIndex];
|
||||||
@ -189,7 +189,7 @@ export class InputDistributor {
|
|||||||
const isInitial = !this.keysDown.has(keyCode);
|
const isInitial = !this.keysDown.has(keyCode);
|
||||||
|
|
||||||
if (button.pressed) {
|
if (button.pressed) {
|
||||||
logger.debug(`gamepad button [${index}]: ${button.pressed ? 'pressed' : ''}`)
|
logger.debug(`gamepad button [${index}]: ${button.pressed ? "pressed" : ""}`);
|
||||||
this.keysDown.add(keyCode);
|
this.keysDown.add(keyCode);
|
||||||
|
|
||||||
this.forwardToReceiver("keydown", {
|
this.forwardToReceiver("keydown", {
|
||||||
@ -197,7 +197,7 @@ export class InputDistributor {
|
|||||||
shift: 0,
|
shift: 0,
|
||||||
alt: 0,
|
alt: 0,
|
||||||
initial: isInitial,
|
initial: isInitial,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
if (!button.pressed && !isInitial) {
|
if (!button.pressed && !isInitial) {
|
||||||
this.keysDown.delete(keyCode);
|
this.keysDown.delete(keyCode);
|
||||||
@ -211,7 +211,6 @@ export class InputDistributor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Event} event
|
* @param {Event} event
|
||||||
*/
|
*/
|
||||||
|
@ -151,7 +151,7 @@ export class HUDBaseToolbar extends BaseHUDPart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isBuildingSelected() {
|
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 newBuildingFound = false;
|
||||||
let newIndex = this.lastSelectedIndex;
|
let newIndex = this.lastSelectedIndex;
|
||||||
if (this.isBuildingSelected()) {
|
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
|
||||||
: 1;
|
: 1;
|
||||||
|
|
||||||
|
@ -117,7 +117,9 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
|
|||||||
keyActionMapper.getBinding(KEYMAPPINGS.general.back).add(this.abortPlacement, this);
|
keyActionMapper.getBinding(KEYMAPPINGS.general.back).add(this.abortPlacement, this);
|
||||||
keyActionMapper.getBinding(KEYMAPPINGS.placement.pipette).add(this.startPipette, this);
|
keyActionMapper.getBinding(KEYMAPPINGS.placement.pipette).add(this.startPipette, this);
|
||||||
this.root.gameState.inputReciever.keyup.add(this.checkForDirectionLockSwitch, 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);
|
keyActionMapper.getBinding(KEYMAPPINGS.placement.delete).add(this.tryDeleteBelowCursor, this);
|
||||||
|
|
||||||
// BINDINGS TO GAME EVENTS
|
// BINDINGS TO GAME EVENTS
|
||||||
|
Loading…
Reference in New Issue
Block a user