merge the two ifs
This commit is contained in:
parent
3d2b1fdaf9
commit
ac2567bf8e
|
|
@ -3373,17 +3373,20 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
|
||||||
link.click();
|
link.click();
|
||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
}
|
}
|
||||||
//mod: shift+8 to change cursor shape
|
//mod: shift+8 to change cursor shape, alt+8 to cycle backwards
|
||||||
if (e.keyCode == 56 && shiftDown == 1) {
|
if (e.keyCode == 56 && [1,2].includes(shiftDown)) {
|
||||||
var currentShapeIndex = shapeOrder.indexOf(currentShape);
|
var currentShapeIndex = shapeOrder.indexOf(currentShape);
|
||||||
currentShape = shapeOrder[(currentShapeIndex + 1) % shapeOrder.length];
|
var newIndex;
|
||||||
logMessage(`Current shape: ${currentShape}`)
|
switch(shiftDown) {
|
||||||
}
|
default:
|
||||||
//mod: alt+8 to change cursor shape
|
case 1:
|
||||||
if (e.keyCode == 56 && shiftDown == 2) {
|
newIndex = (currentShapeIndex + 1) % shapeOrder.length;
|
||||||
var currentShapeIndex = shapeOrder.indexOf(currentShape);
|
break
|
||||||
var newIndex = (currentShapeIndex - 1) % shapeOrder.length;
|
case 2:
|
||||||
if(newIndex < 0) { newIndex = shapeOrder.length - 1 };
|
newIndex = (currentShapeIndex - 1) % shapeOrder.length;
|
||||||
|
if(newIndex < 0) { newIndex = shapeOrder.length - 1 };
|
||||||
|
break
|
||||||
|
};
|
||||||
currentShape = shapeOrder[newIndex];
|
currentShape = shapeOrder[newIndex];
|
||||||
logMessage(`Current shape: ${currentShape}`)
|
logMessage(`Current shape: ${currentShape}`)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue