item list only wheel-scrolls when you move whell on the navbar

This commit is contained in:
minjaesong
2024-01-31 16:40:05 +09:00
parent 3c6e7665fa
commit a839cc9f49
2 changed files with 18 additions and 3 deletions

View File

@@ -603,11 +603,13 @@ open class UIItemInventoryItemGrid(
super.scrolled(amountX, amountY)
items.forEach { if (it.mouseUp) it.scrolled(amountX, amountY) }
navRemoCon.scrolled(amountX, amountY)
// scroll the item list (for now)
if (mouseUp) {
scrollItemPage(amountY.toInt())
}
// commented out -- this clashes with the wheelFun
// if (mouseUp) {
// scrollItemPage(amountY.toInt())
// }
return true
}

View File

@@ -177,6 +177,19 @@ class UIItemListNavBarVertical(
return super.touchDown(screenX, screenY, pointer, button)
}
override fun scrolled(amountX: Float, amountY: Float): Boolean {
if (mouseUp && amountY > 0f) {
scrollDownListener.invoke(this, scrollDownButton)
return true
}
else if (mouseUp && amountY < 0f) {
scrollUpListener.invoke(this, scrollUpButton)
return true
}
return false
}
override fun dispose() {
}