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

import net.minecraft.network.chat.Component
import ru.dbotthepony.mc.otm.menu.storage.DriveRackMenu
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.slot.SlotPanel
import ru.dbotthepony.mc.otm.client.screen.widget.WidePowerGaugePanel

class DriveRackScreen(menu: DriveRackMenu, inventory: Inventory, title: Component) :
	MatteryScreen<DriveRackMenu>(menu, inventory, title) {

	override fun makeMainFrame(): FramePanel<MatteryScreen<*>> {
		val frame = super.makeMainFrame()!!

		WidePowerGaugePanel(this, frame, menu.energyWidget, LEFT_MARGIN, GAUGE_TOP_WITH_SLOT)
		BatterySlotPanel(this, frame, menu.batterySlot, LEFT_MARGIN, SLOT_TOP_UNDER_GAUGE)

		SlotPanel(this, frame, menu.storageSlots[0], 71f, 32f)
		SlotPanel(this, frame, menu.storageSlots[1], 71f + 18f, 32f)

		SlotPanel(this, frame, menu.storageSlots[2], 71f, 32f + 18f)
		SlotPanel(this, frame, menu.storageSlots[3], 71f + 18f, 32f + 18f)

		return frame
	}
}
