1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-16 11:41:50 +00:00

applied requested changes

This commit is contained in:
SStrippel 2020-06-12 12:38:38 +02:00
parent ff3b25c609
commit bb781a67b2
2 changed files with 3 additions and 6 deletions

View File

@ -400,13 +400,12 @@ export class HUDBuildingPlacer extends BaseHUDPart {
if (
this.root.keyMapper.getBinding(KEYMAPPINGS.placementModifiers.cycleInverse).isCurrentlyPressed()
) {
if (index - 1 < 0) indexModifier = availableVariantsLength - 1;
else indexModifier -= 1;
indexModifier -= 1;
} else {
indexModifier += 1;
}
return (index + indexModifier) % availableVariantsLength;
return (index + indexModifier + availableVariantsLength) % availableVariantsLength;
}
/**

View File

@ -114,9 +114,7 @@ export class HUDBuildingsToolbar extends BaseHUDPart {
if (actionMapper.getBinding(KEYMAPPINGS.placementModifiers.cycleInverse).isCurrentlyPressed()) {
for (let i = 0; i < toolbarBuildings.length; --i, --newIndex) {
if (newIndex < 0) newIndex = newIndex + toolbarBuildings.length;
newIndex %= toolbarBuildings.length;
newIndex = (newIndex + toolbarBuildings.length) % toolbarBuildings.length;
if (this.isCycledBuildingSelectable(newIndex)) {
break;
}