package ru.dbotthepony.mc.otm.client.screen.tech

import net.minecraft.network.chat.Component
import net.minecraft.world.entity.player.Inventory
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen
import ru.dbotthepony.mc.otm.client.screen.panels.slot.BatterySlotPanel
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
import ru.dbotthepony.mc.otm.client.screen.panels.button.makeDeviceControls
import ru.dbotthepony.mc.otm.client.screen.panels.slot.SlotPanel
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
import ru.dbotthepony.mc.otm.client.screen.widget.WideProfiledPowerGaugePanel
import ru.dbotthepony.mc.otm.menu.tech.PoweredFurnaceMenu
import ru.dbotthepony.mc.otm.menu.tech.TwinPlatePressMenu

class PoweredFurnaceScreen(menu: PoweredFurnaceMenu, inventory: Inventory, title: Component) :
	MatteryScreen<PoweredFurnaceMenu>(menu, inventory, title) {
	override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
		val frame = super.makeMainFrame()!!

		WideProfiledPowerGaugePanel(this, frame, menu.profiledEnergy, LEFT_MARGIN, GAUGE_TOP_WITH_SLOT)
		BatterySlotPanel(this, frame, menu.batterySlot, LEFT_MARGIN, SLOT_TOP_UNDER_GAUGE)

		SlotPanel(this, frame, menu.inputSlots[0], 56f, PROGRESS_SLOT_TOP - 10f)
		ProgressGaugePanel(this, frame, menu.progressGauge[0], 78f, PROGRESS_ARROW_TOP - 10f)
		SlotPanel(this, frame, menu.outputSlots[0], 104f, PROGRESS_SLOT_TOP - 10f)

		SlotPanel(this, frame, menu.inputSlots[1], 56f, PROGRESS_SLOT_TOP + 10f)
		ProgressGaugePanel(this, frame, menu.progressGauge[1], 78f, PROGRESS_ARROW_TOP + 10f)
		SlotPanel(this, frame, menu.outputSlots[1], 104f, PROGRESS_SLOT_TOP + 10f)

		makeDeviceControls(this, frame, redstoneConfig = menu.redstoneConfig, energyConfig = menu.energyConfig, itemConfig = menu.itemConfig, balanceInputs = menu.balanceInputs, upgrades = menu.upgrades)

		return frame
	}
}
