Only show ClickBoxes when they have buttons
This commit is contained in:
parent
d33622b850
commit
a973d8c001
|
@ -40,7 +40,7 @@ abstract class Element(
|
|||
}
|
||||
}
|
||||
}
|
||||
fun display(stack: PoseStack? = null) {
|
||||
open fun display(stack: PoseStack? = null) {
|
||||
if (!hidden && !caughtError) try {
|
||||
render(stack)
|
||||
} catch (t: Throwable) {
|
||||
|
|
|
@ -22,6 +22,10 @@ class ClickBox(
|
|||
val name: TranslatableComponent? = null
|
||||
): ColoredElement(x, y, 80, 10, color, 0.5F) {
|
||||
val buttons = mutableSetOf<ColoredElement>()
|
||||
override fun display(stack: PoseStack?) {
|
||||
hidden = buttons.isEmpty() || hidden
|
||||
super.display(stack)
|
||||
}
|
||||
@JvmField
|
||||
val buttonsProgressBar: ColoredElement = object: ColoredElement(
|
||||
(x + width), y + height + 3,
|
||||
|
|
Loading…
Reference in New Issue