1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Cycle backwards through the building variants

Use SHIFT+T to cycle backwards

Resolves #51
This commit is contained in:
Andifaind 2020-06-20 09:46:53 -03:00
parent d6c1cb15f6
commit 18388541d5
2 changed files with 10 additions and 1 deletions

View File

@ -329,7 +329,15 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
index >= 0,
"Current variant was invalid: " + this.currentVariant.get() + " out of " + availableVariants
);
const newIndex = (index + 1) % availableVariants.length;
// #51 Cycle backwards if SHIFT is pressed
let newIndex;
if (this.root.keyMapper.getBinding(KEYMAPPINGS.placement.cycleBuildingsInverseModifier).pressed) {
newIndex = (index - 1 + availableVariants.length) % availableVariants.length;
} else {
newIndex = (index + 1) % availableVariants.length;
}
const newVariant = availableVariants[newIndex];
this.currentVariant.set(newVariant);

View File

@ -61,6 +61,7 @@ export const KEYMAPPINGS = {
rotateInverseModifier: { keyCode: 16 }, // SHIFT
cycleBuildingVariants: { keyCode: key("T") },
cycleBuildings: { keyCode: 9 }, // TAB
cycleBuildingsInverseModifier: { keyCode: 16 }, // SHIFT
switchDirectionLockSide: { keyCode: key("R") },
},