1% better item monitor menu

This commit is contained in:
DBotThePony 2022-09-02 18:13:27 +07:00
parent bc68b9b9ef
commit 48df8f4ef2
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -14,6 +14,7 @@ import ru.dbotthepony.mc.otm.client.render.UVWindingOrder
import ru.dbotthepony.mc.otm.client.render.Widgets8 import ru.dbotthepony.mc.otm.client.render.Widgets8
import ru.dbotthepony.mc.otm.client.screen.panels.* import ru.dbotthepony.mc.otm.client.screen.panels.*
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
import ru.dbotthepony.mc.otm.client.screen.widget.TallHorizontalPowerGaugePanel
import ru.dbotthepony.mc.otm.core.equalDownDivision import ru.dbotthepony.mc.otm.core.equalDownDivision
import ru.dbotthepony.mc.otm.core.formatReadableNumber import ru.dbotthepony.mc.otm.core.formatReadableNumber
import ru.dbotthepony.mc.otm.core.formatSiComponent import ru.dbotthepony.mc.otm.core.formatSiComponent
@ -24,7 +25,7 @@ class ItemMonitorScreen(menu: ItemMonitorMenu, inventory: Inventory, title: Comp
MatteryScreen<ItemMonitorMenu>(menu, inventory, title) { MatteryScreen<ItemMonitorMenu>(menu, inventory, title) {
override fun makeMainFrame(): FramePanel { override fun makeMainFrame(): FramePanel {
val frame = FramePanel(this@ItemMonitorScreen, null, 0f, 0f, FRAME_WIDTH, FRAME_HEIGHT, getTitle()) val frame = FramePanel(this@ItemMonitorScreen, null, 0f, 0f, 1f, 1f, getTitle())
val topPanel = EditablePanel(this, frame) val topPanel = EditablePanel(this, frame)
topPanel.height = ITEM_GRID_HEIGHT * 18f topPanel.height = ITEM_GRID_HEIGHT * 18f
@ -35,7 +36,7 @@ class ItemMonitorScreen(menu: ItemMonitorMenu, inventory: Inventory, title: Comp
bottomPanel.dock = Dock.TOP bottomPanel.dock = Dock.TOP
bottomPanel.setDockMargin(top = 6f) bottomPanel.setDockMargin(top = 6f)
frame.height = topPanel.height + bottomPanel.height + frame.dockPadding.top + frame.dockPadding.bottom + 6f frame.height = topPanel.height + bottomPanel.height + frame.dockPadding.top + frame.dockPadding.bottom + 26f
frame.width = 178f + frame.dockPadding.left + frame.dockPadding.right frame.width = 178f + frame.dockPadding.left + frame.dockPadding.right
val viewScrollBar = ContinuousScrollBarPanel(this, topPanel, 28f + ITEM_GRID_WIDTH * 18f + 2f, 16f, ITEM_GRID_HEIGHT * 18f) val viewScrollBar = ContinuousScrollBarPanel(this, topPanel, 28f + ITEM_GRID_WIDTH * 18f + 2f, 16f, ITEM_GRID_HEIGHT * 18f)
@ -184,13 +185,23 @@ class ItemMonitorScreen(menu: ItemMonitorMenu, inventory: Inventory, title: Comp
} }
} }
val bottomStrip = EditablePanel(this, frame, height = AbstractSlotPanel.SIZE)
bottomStrip.dock = Dock.BOTTOM
BatterySlotPanel(this, bottomStrip, menu.batterySlot).also {
it.dock = Dock.LEFT
it.dockRight = 3f
}
TallHorizontalPowerGaugePanel(this, bottomStrip, menu.powerWidget).also {
it.dock = Dock.FILL
it.dockResize = DockResizeMode.NONE
}
return frame return frame
} }
companion object { companion object {
const val FRAME_WIDTH = 240f
const val FRAME_HEIGHT = 210f
const val ITEM_GRID_WIDTH = 9 const val ITEM_GRID_WIDTH = 9
const val ITEM_GRID_HEIGHT = 5 const val ITEM_GRID_HEIGHT = 5