diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickBox.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickBox.kt index 0fefb27..6a51e95 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickBox.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickBox.kt @@ -15,9 +15,9 @@ import org.lwjgl.opengl.GL20 class ClickBox( x: Double, y: Double, - private val name: TranslatableComponent? = null, - val buttons: MutableCollection = mutableSetOf() + private val name: TranslatableComponent? = null ): ColoredElement(x, y, 80, 10, 0x6C9E9D, 0.5F) { + val buttons = mutableMapOf() @JvmField val scrollBar: ColoredElement = object: ColoredElement( (x + width), y + height + 3, @@ -70,7 +70,7 @@ class ClickBox( x = this@ClickBox.x + this@ClickBox.width - 3 y = this@ClickBox.y + this@ClickBox.height + 3 }.display(poseStack) - buttons.forEachIndexed { num, it -> + buttons.values.forEachIndexed { num, it -> it.apply { it.x = this@ClickBox.x + 3 it.y = this@ClickBox.y + 5 + height + (num * 9)