Update mouse wheel handling to be more like other events
This commit is contained in:
@@ -127,17 +127,25 @@ 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 ¯\_(ツ)_/¯
|
||||
if(!gui.cursorEnabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(up) {
|
||||
if(!flipped) {
|
||||
if(deltaCoordinates.y > 0) {
|
||||
chatBoxScrollUp();
|
||||
} else {
|
||||
chatBoxScrollDown();
|
||||
}
|
||||
} else {
|
||||
if(deltaCoordinates.y > 0) {
|
||||
chatBoxScrollDown();
|
||||
} else {
|
||||
chatBoxScrollUp();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -232,19 +232,7 @@ function onCameraProcess(event) {
|
||||
// ===========================================================================
|
||||
|
||||
function onMouseWheel(event, mouseId, deltaCoordinates, flipped) {
|
||||
if(!flipped) {
|
||||
if(deltaCoordinates.y > 0) {
|
||||
processMouseWheelForChatBox(true);
|
||||
} else {
|
||||
processMouseWheelForChatBox(false);
|
||||
}
|
||||
} else {
|
||||
if(deltaCoordinates.y > 0) {
|
||||
processMouseWheelForChatBox(false);
|
||||
} else {
|
||||
processMouseWheelForChatBox(true);
|
||||
}
|
||||
}
|
||||
processMouseWheelForChatBox(mouseId, deltaCoordinates, flipped);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user