package ru.dbotthepony.mc.otm.client.screen.panels.button

import net.minecraft.client.gui.screens.Screen
import net.minecraft.network.chat.Component
import ru.dbotthepony.mc.otm.client.screen.panels.Dock
import ru.dbotthepony.mc.otm.client.screen.panels.EditablePanel
import ru.dbotthepony.mc.otm.client.screen.panels.Label
import ru.dbotthepony.mc.otm.menu.input.BooleanInputWithFeedback
import ru.dbotthepony.mc.otm.menu.input.IPlayerInputWithFeedback
import kotlin.math.roundToInt

open class CheckBoxLabelInputPanel<out S : Screen>(
	screen: S,
	parent: EditablePanel<*>?,
	val widget: IPlayerInputWithFeedback<Boolean>,
	text: Component,
	x: Float = 0f,
	y: Float = 0f,
	width: Float = CheckBoxPanel.REGULAR_DIMENSIONS + 120f,
	height: Float = CheckBoxPanel.REGULAR_DIMENSIONS
) : AbstractCheckBoxLabelPanel<S>(screen, parent, x, y, width, height) {
	override val checkbox = CheckBoxInputPanel(screen = screen, parent = this, widget = widget, x = 0f, y = 0f, width = CheckBoxPanel.REGULAR_DIMENSIONS, height = CheckBoxPanel.REGULAR_DIMENSIONS)
	override val label = Label(screen, this, CheckBoxPanel.REGULAR_DIMENSIONS + 4f, 4f, text = text)
}
