mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Disable automatic orientation when using belt lock
This commit is contained in:
parent
215e35166a
commit
46ceefd0d8
@ -154,13 +154,13 @@ export class HUDBuildingPlacer extends BaseHUDPart {
|
|||||||
const oldPos = this.lastDragTile;
|
const oldPos = this.lastDragTile;
|
||||||
let newPos = this.root.camera.screenToWorld(pos).toTileSpace();
|
let newPos = this.root.camera.screenToWorld(pos).toTileSpace();
|
||||||
|
|
||||||
|
// Check if camera is moving, since then we do nothing
|
||||||
if (this.root.camera.desiredCenter) {
|
if (this.root.camera.desiredCenter) {
|
||||||
// Camera is moving
|
|
||||||
this.lastDragTile = newPos;
|
this.lastDragTile = newPos;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Direction lock
|
// Check for direction lock
|
||||||
if (
|
if (
|
||||||
this.root.keyMapper.getBinding(KEYMAPPINGS.placement.lockBeltDirection).isCurrentlyPressed()
|
this.root.keyMapper.getBinding(KEYMAPPINGS.placement.lockBeltDirection).isCurrentlyPressed()
|
||||||
) {
|
) {
|
||||||
@ -171,10 +171,15 @@ export class HUDBuildingPlacer extends BaseHUDPart {
|
|||||||
newPos = oldPos.add(delta);
|
newPos = oldPos.add(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if anything changed
|
||||||
if (!oldPos.equals(newPos)) {
|
if (!oldPos.equals(newPos)) {
|
||||||
|
// Automatic Direction
|
||||||
if (
|
if (
|
||||||
metaBuilding &&
|
metaBuilding &&
|
||||||
metaBuilding.getRotateAutomaticallyWhilePlacing(this.currentVariant.get()) &&
|
metaBuilding.getRotateAutomaticallyWhilePlacing(this.currentVariant.get()) &&
|
||||||
|
!this.root.keyMapper
|
||||||
|
.getBinding(KEYMAPPINGS.placement.lockBeltDirection)
|
||||||
|
.isCurrentlyPressed() &&
|
||||||
!this.root.keyMapper
|
!this.root.keyMapper
|
||||||
.getBinding(KEYMAPPINGS.placementModifiers.placementDisableAutoOrientation)
|
.getBinding(KEYMAPPINGS.placementModifiers.placementDisableAutoOrientation)
|
||||||
.isCurrentlyPressed()
|
.isCurrentlyPressed()
|
||||||
|
Loading…
Reference in New Issue
Block a user