diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StoragePowerSupplierScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StoragePowerSupplierScreen.kt index f9eb3e7ce..f6cd39c54 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StoragePowerSupplierScreen.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StoragePowerSupplierScreen.kt @@ -2,13 +2,15 @@ package ru.dbotthepony.mc.otm.client.screen.storage import net.minecraft.network.chat.Component import net.minecraft.world.entity.player.Inventory +import ru.dbotthepony.mc.otm.client.ShiftPressedCond import ru.dbotthepony.mc.otm.client.screen.MatteryScreen import ru.dbotthepony.mc.otm.core.TranslatableComponent import ru.dbotthepony.mc.otm.client.screen.panels.* import ru.dbotthepony.mc.otm.client.screen.panels.button.makeDeviceControls import ru.dbotthepony.mc.otm.client.screen.panels.slot.AbstractSlotPanel import ru.dbotthepony.mc.otm.client.screen.panels.slot.BatterySlotPanel -import ru.dbotthepony.mc.otm.client.screen.widget.HorizontalPowerGaugePanel +import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel +import ru.dbotthepony.mc.otm.client.screen.widget.TallHorizontalPowerGaugePanel import ru.dbotthepony.mc.otm.core.util.formatPower import ru.dbotthepony.mc.otm.menu.storage.StoragePowerSupplierMenu @@ -16,29 +18,35 @@ import ru.dbotthepony.mc.otm.menu.storage.StoragePowerSupplierMenu class StoragePowerSupplierScreen(menu: StoragePowerSupplierMenu, inventory: Inventory, title: Component) : MatteryScreen(menu, inventory, title) { override fun makeMainFrame(): FramePanel> { - val frame = FramePanel(this, width = 200f, height = 60f, title) + val frame = FramePanel(this, width = 200f, height = 68f, title) frame.makeCloseButton() frame.onClose { onClose() } - HorizontalPowerGaugePanel(this, frame, menu.energyWidget).also { - it.dock = Dock.BOTTOM - it.dockResize = DockResizeMode.NONE - } + val strip = EditablePanel(this, frame, height = AbstractSlotPanel.SIZE) - val topStrip = EditablePanel(this, frame, height = AbstractSlotPanel.SIZE) + strip.dock = Dock.BOTTOM + strip.dockTop = 3f - topStrip.dock = Dock.TOP - topStrip.dockTop = 3f - - BatterySlotPanel(this, topStrip, menu.batterySlot).also { + BatterySlotPanel(this, strip, menu.batterySlot).also { it.dock = Dock.LEFT it.dockRight = 3f } - val labels = EditablePanel(this, topStrip) + SpritePanel(this, strip, ProgressGaugePanel.GAUGE_BACKGROUND).also { + it.dock = Dock.LEFT + it.dockRight = 3f + it.dockResize = DockResizeMode.NONE + } + TallHorizontalPowerGaugePanel(this, strip, menu.energyWidget).also { + it.dock = Dock.LEFT + it.dockResize = DockResizeMode.NONE + } + + val labels = EditablePanel(this, frame) labels.dock = Dock.FILL + labels.dockTop = 4f object : Label(this@StoragePowerSupplierScreen, labels) { init { @@ -50,7 +58,7 @@ class StoragePowerSupplierScreen(menu: StoragePowerSupplierMenu, inventory: Inve text = TranslatableComponent( "otm.item.power.passed", - menu.totalTransferred.formatPower() + menu.totalTransferred.formatPower(formatAsReadable = ShiftPressedCond) ) } }