Fix exosuit menu not drawing slots when leaving scroll not at zero

This commit is contained in:
DBotThePony 2022-08-31 01:13:42 +07:00
parent 1b039f416f
commit 1e4f33c1bc
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -91,15 +91,11 @@ class ExoSuitInventoryScreen(menu: ExoSuitInventoryMenu) : MatteryScreen<ExoSuit
val offhand = SlotPanel(this, toolbeltLine, menu.offhandSlot)
offhand.dock = Dock.RIGHT
getSlotsRow(0).also { it.parent = mainInventoryLine }
getSlotsRow(1).also {
it.parent = mainInventoryLine
it.y = AbstractSlotPanel.SIZE
}
getSlotsRow(2).also {
it.parent = mainInventoryLine
it.y = AbstractSlotPanel.SIZE * 2
for (i in scrollPanel.scroll .. scrollPanel.scroll + 2) {
getSlotsRow(i).also {
it.parent = mainInventoryLine
it.y = AbstractSlotPanel.SIZE * (i - scrollPanel.scroll)
}
}
val topLine = EditablePanel(this, frame, height = 18f * 4f)