Inventory UI on ingame

This commit is contained in:
Song Minjae
2017-04-09 03:35:18 +09:00
parent c5367f8f1c
commit 671048e1e1
20 changed files with 245 additions and 267 deletions

View File

@@ -13,7 +13,7 @@ import org.newdawn.slick.Input
class UIQuickBar : UICanvas, MouseControlled {
private val gutter = 8
override var width: Int = (ItemSlotImageBuilder.slotImageSize + gutter) * SLOT_COUNT
override var height: Int = ItemSlotImageBuilder.slotImageSize + 4 + Terrarum.fontGame!!.lineHeight
override var height: Int = ItemSlotImageBuilder.slotImageSize + 4 + Terrarum.fontGame.lineHeight
/**
* In milliseconds
*/
@@ -84,7 +84,7 @@ class UIQuickBar : UICanvas, MouseControlled {
}
override fun mouseWheelMoved(change: Int) {
selection = selection.plus(if (change > 1) 1 else if (change < -1) -1 else 0).mod(SLOT_COUNT)
selection = selection.plus(if (change > 1) 1 else if (change < -1) -1 else 0).rem(SLOT_COUNT)
if (selection < 0) selection += SLOT_COUNT
}