mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Removed logic from application_settings
This commit is contained in:
parent
7552d23f40
commit
5de2c2de94
@ -901,9 +901,9 @@ export class Camera extends BasicSerializableObject {
|
|||||||
forceX += 1;
|
forceX += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
let movementSpeed = this.root.app.settings.getMovementSpeed(
|
let movementSpeed =
|
||||||
actionMapper.getBinding(KEYMAPPINGS.navigation.mapMoveFaster).isCurrentlyPressed()
|
this.root.app.settings.getMovementSpeed() *
|
||||||
);
|
(actionMapper.getBinding(KEYMAPPINGS.navigation.mapMoveFaster).isCurrentlyPressed() ? 2 : 1);
|
||||||
|
|
||||||
this.center.x += moveAmount * forceX * movementSpeed;
|
this.center.x += moveAmount * forceX * movementSpeed;
|
||||||
this.center.y += moveAmount * forceY * movementSpeed;
|
this.center.y += moveAmount * forceY * movementSpeed;
|
||||||
|
@ -302,14 +302,11 @@ export class ApplicationSettings extends ReadWriteProxy {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
getMovementSpeed() {
|
||||||
* @param {boolean} moveFaster
|
|
||||||
*/
|
|
||||||
getMovementSpeed(moveFaster = false) {
|
|
||||||
const id = this.getAllSettings().movementSpeed;
|
const id = this.getAllSettings().movementSpeed;
|
||||||
for (let i = 0; i < movementSpeeds.length; ++i) {
|
for (let i = 0; i < movementSpeeds.length; ++i) {
|
||||||
if (movementSpeeds[i].id === id) {
|
if (movementSpeeds[i].id === id) {
|
||||||
return movementSpeeds[i].multiplier * (moveFaster ? 2 : 1);
|
return movementSpeeds[i].multiplier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.error("Unknown movement speed id:", id);
|
logger.error("Unknown movement speed id:", id);
|
||||||
|
Loading…
Reference in New Issue
Block a user