Add profiled gauge widget to item monitor menu

This commit is contained in:
DBotThePony 2023-08-21 11:23:06 +07:00
parent 4a606e78b0
commit 4e17c00099
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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 })