From ac2567bf8e62376c4d3424ac3b479d1c281c064e Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 20 May 2024 11:33:49 -0400 Subject: [PATCH] merge the two ifs --- mods/a_mod_by_alice.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/mods/a_mod_by_alice.js b/mods/a_mod_by_alice.js index 9b6168c5..e7cae544 100644 --- a/mods/a_mod_by_alice.js +++ b/mods/a_mod_by_alice.js @@ -3373,17 +3373,20 @@ color1 and color2 spread through striped paint like dye does with itself. col link.click(); document.body.removeChild(link); } - //mod: shift+8 to change cursor shape - if (e.keyCode == 56 && shiftDown == 1) { + //mod: 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]; - logMessage(`Current shape: ${currentShape}`) - } - //mod: alt+8 to change cursor shape - if (e.keyCode == 56 && shiftDown == 2) { - var currentShapeIndex = shapeOrder.indexOf(currentShape); - var newIndex = (currentShapeIndex - 1) % shapeOrder.length; - if(newIndex < 0) { newIndex = shapeOrder.length - 1 }; + 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}`) }