mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
item list only wheel-scrolls when you move whell on the navbar
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user