Make ClickBox.buttons a map
This commit is contained in:
parent
8a65839816
commit
9dc097d32f
|
@ -15,9 +15,9 @@ import org.lwjgl.opengl.GL20
|
|||
|
||||
class ClickBox(
|
||||
x: Double, y: Double,
|
||||
private val name: TranslatableComponent? = null,
|
||||
val buttons: MutableCollection<ClickButton> = mutableSetOf()
|
||||
private val name: TranslatableComponent? = null
|
||||
): ColoredElement(x, y, 80, 10, 0x6C9E9D, 0.5F) {
|
||||
val buttons = mutableMapOf<String, ClickButton>()
|
||||
@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)
|
||||
|
|
Loading…
Reference in New Issue