From 4e17c000995ac9c926306c21672ccb2688dd42e1 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 21 Aug 2023 11:23:06 +0700 Subject: [PATCH] Add profiled gauge widget to item monitor menu --- .../mc/otm/client/screen/storage/ItemMonitorScreen.kt | 3 ++- .../ru/dbotthepony/mc/otm/menu/storage/ItemMonitorMenu.kt | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/ItemMonitorScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/ItemMonitorScreen.kt index d1cfbde67..028c70702 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/ItemMonitorScreen.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/ItemMonitorScreen.kt @@ -25,6 +25,7 @@ import ru.dbotthepony.mc.otm.client.screen.panels.util.DiscreteScrollBarPanel import ru.dbotthepony.mc.otm.client.screen.panels.util.GridPanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.WidePowerGaugePanel +import ru.dbotthepony.mc.otm.client.screen.widget.WideProfiledPowerGaugePanel import ru.dbotthepony.mc.otm.core.TranslatableComponent import ru.dbotthepony.mc.otm.core.asGetterSetter import ru.dbotthepony.mc.otm.core.util.ItemStorageStackSorter @@ -156,7 +157,7 @@ class ItemMonitorScreen(menu: ItemMonitorMenu, inventory: Inventory, title: Comp leftStrip.height += it.height } - WidePowerGaugePanel(this, leftStrip, menu.energyWidget).also { + WideProfiledPowerGaugePanel(this, leftStrip, menu.profiledEnergy).also { it.dock = Dock.FILL it.dockResize = DockResizeMode.NONE leftStrip.height += it.height diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/ItemMonitorMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/ItemMonitorMenu.kt index 0145d626b..512424acd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/ItemMonitorMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/ItemMonitorMenu.kt @@ -20,6 +20,7 @@ import ru.dbotthepony.mc.otm.menu.data.NetworkedItemView import ru.dbotthepony.mc.otm.menu.input.BooleanInputWithFeedback import ru.dbotthepony.mc.otm.menu.input.EnumInputWithFeedback import ru.dbotthepony.mc.otm.menu.makeSlots +import ru.dbotthepony.mc.otm.menu.widget.ProfiledLevelGaugeWidget import ru.dbotthepony.mc.otm.registry.MMenus import ru.dbotthepony.mc.otm.storage.* import java.util.* @@ -84,6 +85,7 @@ class ItemMonitorMenu( tile: ItemMonitorBlockEntity? = null ) : MatteryPoweredMenu(MMenus.ITEM_MONITOR, containerId, inventory, tile), INetworkedItemViewProvider { override val networkedItemView = NetworkedItemView(inventory.player, this, tile == null) + val profiledEnergy = ProfiledLevelGaugeWidget(this, tile?.energy, energyWidget) val settings = object : IItemMonitorPlayerSettings { override var ingredientPriority by EnumInputWithFeedback(this@ItemMonitorMenu, true, tile?.let { it.getSettings(player as ServerPlayer)::ingredientPriority })