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

import net.minecraft.client.gui.screens.Screen
import net.minecraft.world.entity.player.Player
import ru.dbotthepony.mc.otm.client.minecraft
import ru.dbotthepony.mc.otm.client.screen.panels.EditablePanel
import ru.dbotthepony.mc.otm.core.GetterSetter
import ru.dbotthepony.mc.otm.core.value
import ru.dbotthepony.mc.otm.menu.input.IPlayerInputWithFeedback

open class CheckBoxInputPanel<out S : Screen>(
	screen: S,
	parent: EditablePanel<*>?,
	val widget: IPlayerInputWithFeedback<Boolean>,
	x: Float = 0f,
	y: Float = 0f,
	width: Float = REGULAR_DIMENSIONS + 120f,
	height: Float = REGULAR_DIMENSIONS
) : CheckBoxPanel<S>(screen, parent, x, y, width, height, isChecked = widget) {
	override var isDisabled: Boolean
		get() = !widget.test(minecraft.player)
		set(value) {}
}
