Update mouse wheel handling to be more like other events
This commit is contained in:
@@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
Reference in New Issue
Block a user