alt+8 cycles backwards

This commit is contained in:
An Orbit 2024-05-20 11:34:18 -04:00 committed by GitHub
parent ac2567bf8e
commit 6a57b0463a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 3 deletions

View File

@ -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}`)
}
})