mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
ternary statement
This commit is contained in:
parent
2bc54cdaf3
commit
e8bc5bc1ec
@ -160,8 +160,10 @@ export class HUDBaseToolbar extends BaseHUDPart {
|
||||
}
|
||||
|
||||
let newBuildingFound = false;
|
||||
let direction =
|
||||
!this.root.keyMapper.getBinding(KEYMAPPINGS.placement.rotateInverseModifier).pressed * 2 + 1;
|
||||
const direction = this.root.keyMapper.getBinding(KEYMAPPINGS.placement.rotateInverseModifier)
|
||||
.pressed
|
||||
? -1
|
||||
: 1;
|
||||
let newIndex = this.lastSelectedIndex;
|
||||
for (let i = 0; i < this.primaryBuildings.length; ++i, newIndex += direction) {
|
||||
newIndex %= this.primaryBuildings.length;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user