From 48df8f4ef2a45ba02fc0a8ecd69255cc9ada3be5 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Fri, 2 Sep 2022 18:13:27 +0700 Subject: [PATCH] 1% better item monitor menu --- .../mc/otm/client/screen/ItemMonitorScreen.kt | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ItemMonitorScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ItemMonitorScreen.kt index 70ee942a8..e299c52a9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ItemMonitorScreen.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ItemMonitorScreen.kt @@ -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.screen.panels.* 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.formatReadableNumber import ru.dbotthepony.mc.otm.core.formatSiComponent @@ -24,7 +25,7 @@ class ItemMonitorScreen(menu: ItemMonitorMenu, inventory: Inventory, title: Comp MatteryScreen(menu, inventory, title) { 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) topPanel.height = ITEM_GRID_HEIGHT * 18f @@ -35,7 +36,7 @@ class ItemMonitorScreen(menu: ItemMonitorMenu, inventory: Inventory, title: Comp bottomPanel.dock = Dock.TOP 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 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 } companion object { - const val FRAME_WIDTH = 240f - const val FRAME_HEIGHT = 210f - const val ITEM_GRID_WIDTH = 9 const val ITEM_GRID_HEIGHT = 5