Skip to content

Commit

Permalink
merge the two ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
orbit-loona committed May 20, 2024
1 parent 3d2b1fd commit ac2567b
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions mods/a_mod_by_alice.js
Original file line number Diff line number Diff line change
Expand Up @@ -3373,17 +3373,20 @@ color1 and color2 spread through striped paint like dye does with itself. <u>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}`)
}
Expand Down

0 comments on commit ac2567b

Please sign in to comment.