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

import net.minecraft.client.gui.screens.Screen
import net.minecraft.network.chat.Component
import java.util.function.Supplier

open class DynamicLabel<out S : Screen>(
	screen: S,
	parent: EditablePanel<*>?,
	x: Float = 0f,
	y: Float = 0f,
	width: Float = 100f,
	height: Float = 10f,
	val textSupplier: Supplier<Component>,
	shadow: Boolean = false
) : Label<S>(screen, parent, x, y, width, height, textSupplier.get(), shadow) {
	override fun tickInner() {
		super.tickInner()
		text = textSupplier.get()
	}
}
