mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-16 03:31:52 +00:00
applied requested changes
This commit is contained in:
parent
ff3b25c609
commit
bb781a67b2
@ -400,13 +400,12 @@ export class HUDBuildingPlacer extends BaseHUDPart {
|
|||||||
if (
|
if (
|
||||||
this.root.keyMapper.getBinding(KEYMAPPINGS.placementModifiers.cycleInverse).isCurrentlyPressed()
|
this.root.keyMapper.getBinding(KEYMAPPINGS.placementModifiers.cycleInverse).isCurrentlyPressed()
|
||||||
) {
|
) {
|
||||||
if (index - 1 < 0) indexModifier = availableVariantsLength - 1;
|
indexModifier -= 1;
|
||||||
else indexModifier -= 1;
|
|
||||||
} else {
|
} else {
|
||||||
indexModifier += 1;
|
indexModifier += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (index + indexModifier) % availableVariantsLength;
|
return (index + indexModifier + availableVariantsLength) % availableVariantsLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -114,9 +114,7 @@ export class HUDBuildingsToolbar extends BaseHUDPart {
|
|||||||
|
|
||||||
if (actionMapper.getBinding(KEYMAPPINGS.placementModifiers.cycleInverse).isCurrentlyPressed()) {
|
if (actionMapper.getBinding(KEYMAPPINGS.placementModifiers.cycleInverse).isCurrentlyPressed()) {
|
||||||
for (let i = 0; i < toolbarBuildings.length; --i, --newIndex) {
|
for (let i = 0; i < toolbarBuildings.length; --i, --newIndex) {
|
||||||
if (newIndex < 0) newIndex = newIndex + toolbarBuildings.length;
|
newIndex = (newIndex + toolbarBuildings.length) % toolbarBuildings.length;
|
||||||
newIndex %= toolbarBuildings.length;
|
|
||||||
|
|
||||||
if (this.isCycledBuildingSelectable(newIndex)) {
|
if (this.isCycledBuildingSelectable(newIndex)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user