textselector/spinner/quickslot(!) selection change using scroll wheel

This commit is contained in:
minjaesong
2021-10-23 22:57:17 +09:00
parent 3be5ac96f2
commit a1bad044fd
4 changed files with 68 additions and 20 deletions

View File

@@ -68,11 +68,11 @@ class UIQuickslotBar : UICanvas() {
override fun doOpening(delta: Float) {
handler.opacity = handler.openCloseCounter.toFloat() / openCloseTime
handler.opacity = handler.openCloseCounter / openCloseTime
}
override fun doClosing(delta: Float) {
handler.opacity = (openCloseTime - handler.openCloseCounter.toFloat()) / openCloseTime
handler.opacity = (openCloseTime - handler.openCloseCounter) / openCloseTime
}
override fun endOpening(delta: Float) {
@@ -83,14 +83,6 @@ class UIQuickslotBar : UICanvas() {
handler.opacity = 0f
}
override fun scrolled(amountX: Float, amountY: Float): Boolean {
// super.scrolled(amount) // no UIItems here
selection = selection.plus(if (amountY > 1) 1 else if (amountY < -1) -1 else 0).fmod(SLOT_COUNT)
return true
}
override fun dispose() {
}