Now when positioning panels, exopack charge slots are considered into inventory frame height
This commit is contained in:
parent
aa93150f09
commit
d65b8df579
@ -203,6 +203,8 @@ abstract class MatteryScreen<T : MatteryMenu>(menu: T, inventory: Inventory, tit
|
||||
it.slotBackground = Widgets18.CHARGE_SLOT_BACKGROUND
|
||||
}
|
||||
}
|
||||
|
||||
frame.dockMargin = frame.dockMargin.copy(bottom = frame.dockMargin.bottom + 2f + AbstractSlotPanel.SIZE)
|
||||
}
|
||||
|
||||
init {
|
||||
@ -481,21 +483,21 @@ abstract class MatteryScreen<T : MatteryMenu>(menu: T, inventory: Inventory, tit
|
||||
val inventoryFrame = inventoryFrame
|
||||
|
||||
if (mainFrame != null) {
|
||||
top -= (mainFrame.height / 2).toInt()
|
||||
top -= ((mainFrame.height + mainFrame.dockMargin.vertical) / 2).toInt()
|
||||
}
|
||||
|
||||
if (inventoryFrame != null) {
|
||||
top -= (inventoryFrame.height / 2).toInt()
|
||||
top -= ((inventoryFrame.height + inventoryFrame.dockMargin.vertical) / 2).toInt()
|
||||
}
|
||||
|
||||
if (mainFrame != null) {
|
||||
mainFrame.setPos(width / 2 - mainFrame.width / 2, top.toFloat())
|
||||
top += mainFrame.height.toInt()
|
||||
mainFrame.setPos(width / 2 - (mainFrame.width + mainFrame.dockMargin.horizontal) / 2, top.toFloat() + mainFrame.dockMargin.top)
|
||||
top += (mainFrame.height + mainFrame.dockMargin.bottom).toInt()
|
||||
}
|
||||
|
||||
if (inventoryFrame != null) {
|
||||
inventoryFrame.setPos(width / 2 - inventoryFrame.width / 2, top.toFloat())
|
||||
top += inventoryFrame.height.toInt()
|
||||
inventoryFrame.setPos(width / 2 - (inventoryFrame.width + inventoryFrame.dockMargin.horizontal) / 2, top.toFloat() + inventoryFrame.dockMargin.top)
|
||||
top += (inventoryFrame.height + inventoryFrame.dockMargin.bottom).toInt()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user