Remember inventory scroll in exosuit

This commit is contained in:
DBotThePony 2022-08-30 22:31:01 +07:00
parent 96b9a971f1
commit 144975e296
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 5 additions and 0 deletions

View File

@ -67,8 +67,12 @@ class ExoSuitInventoryScreen(menu: ExoSuitInventoryMenu) : MatteryScreen<ExoSuit
row.y = (i - new) * AbstractSlotPanel.SIZE
row.parent = mainInventoryLine
}
menu.lastScroll = new
})
scrollPanel.scroll = menu.lastScroll
mainInventoryLine = object : EditablePanel(this@ExoSuitInventoryScreen, frame, height = 18f * 3f) {
override fun mouseScrolledInner(x: Double, y: Double, scroll: Double): Boolean {
return scrollPanel.mouseScrolledInner(x, y, scroll)

View File

@ -16,6 +16,7 @@ import ru.dbotthepony.mc.otm.network.ExoSuitSlotPacket
import ru.dbotthepony.mc.otm.network.MatteryPlayerNetworkChannel
class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMenu(null, CONTAINER_ID, capability.ply.inventory) {
var lastScroll = 0
override val storageSlots: Collection<Slot> get() = listOf()
val hotbarSlots: List<InventorySlot>