Update mouse wheel handling to be more like other events

This commit is contained in:
Vortrex
2022-04-07 02:04:35 -05:00
parent b7eff5d03a
commit 6d2a8ee057
2 changed files with 13 additions and 17 deletions

View File

@@ -127,16 +127,24 @@ function updateChatBox() {
// =========================================================================== // ===========================================================================
function processMouseWheelForChatBox(up) { function processMouseWheelForChatBox(mouseId, deltaCoordinates, flipped) {
// There isn't a way to detect whether chat input is active, but mouse cursor is forced shown when typing so ¯\_(ツ)_/¯ // There isn't a way to detect whether chat input is active, but mouse cursor is forced shown when typing so ¯\_(ツ)_/¯
if(!gui.cursorEnabled) { if(!gui.cursorEnabled) {
return false; return false;
} }
if(up) { if(!flipped) {
chatBoxScrollUp(); if(deltaCoordinates.y > 0) {
chatBoxScrollUp();
} else {
chatBoxScrollDown();
}
} else { } else {
chatBoxScrollDown(); if(deltaCoordinates.y > 0) {
chatBoxScrollDown();
} else {
chatBoxScrollUp();
}
} }
} }

View File

@@ -232,19 +232,7 @@ function onCameraProcess(event) {
// =========================================================================== // ===========================================================================
function onMouseWheel(event, mouseId, deltaCoordinates, flipped) { function onMouseWheel(event, mouseId, deltaCoordinates, flipped) {
if(!flipped) { processMouseWheelForChatBox(mouseId, deltaCoordinates, flipped);
if(deltaCoordinates.y > 0) {
processMouseWheelForChatBox(true);
} else {
processMouseWheelForChatBox(false);
}
} else {
if(deltaCoordinates.y > 0) {
processMouseWheelForChatBox(false);
} else {
processMouseWheelForChatBox(true);
}
}
} }
// =========================================================================== // ===========================================================================