From 6a57b0463afa9c800c058638c4c217d5801dfabe Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 20 May 2024 11:34:18 -0400 Subject: [PATCH] alt+8 cycles backwards --- mods/cursor_shapes.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/mods/cursor_shapes.js b/mods/cursor_shapes.js index bb0f74b9..2f5b920a 100644 --- a/mods/cursor_shapes.js +++ b/mods/cursor_shapes.js @@ -117,10 +117,21 @@ if(enabledMods.includes("mods/a_mod_by_alice.js")) { }; document.addEventListener("keydown", function(e) { - //shift+8 to change cursor shape - if (e.keyCode == 56 && shiftDown) { + //shift+8 to change cursor shape, alt+8 to cycle backwards + if (e.keyCode == 56 && [1,2].includes(shiftDown)) { var currentShapeIndex = shapeOrder.indexOf(currentShape); - currentShape = shapeOrder[(currentShapeIndex + 1) % shapeOrder.length]; + var newIndex; + switch(shiftDown) { + default: + case 1: + newIndex = (currentShapeIndex + 1) % shapeOrder.length; + break + case 2: + newIndex = (currentShapeIndex - 1) % shapeOrder.length; + if(newIndex < 0) { newIndex = shapeOrder.length - 1 }; + break + }; + currentShape = shapeOrder[newIndex]; logMessage(`Current shape: ${currentShape}`) } })