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(
|
class ClickBox(
|
||||||
x: Double, y: Double,
|
x: Double, y: Double,
|
||||||
private val name: TranslatableComponent? = null,
|
private val name: TranslatableComponent? = null
|
||||||
val buttons: MutableCollection<ClickButton> = mutableSetOf()
|
|
||||||
): ColoredElement(x, y, 80, 10, 0x6C9E9D, 0.5F) {
|
): ColoredElement(x, y, 80, 10, 0x6C9E9D, 0.5F) {
|
||||||
|
val buttons = mutableMapOf<String, ClickButton>()
|
||||||
@JvmField
|
@JvmField
|
||||||
val scrollBar: ColoredElement = object: ColoredElement(
|
val scrollBar: ColoredElement = object: ColoredElement(
|
||||||
(x + width), y + height + 3,
|
(x + width), y + height + 3,
|
||||||
@ -70,7 +70,7 @@ class ClickBox(
|
|||||||
x = this@ClickBox.x + this@ClickBox.width - 3
|
x = this@ClickBox.x + this@ClickBox.width - 3
|
||||||
y = this@ClickBox.y + this@ClickBox.height + 3
|
y = this@ClickBox.y + this@ClickBox.height + 3
|
||||||
}.display(poseStack)
|
}.display(poseStack)
|
||||||
buttons.forEachIndexed { num, it ->
|
buttons.values.forEachIndexed { num, it ->
|
||||||
it.apply {
|
it.apply {
|
||||||
it.x = this@ClickBox.x + 3
|
it.x = this@ClickBox.x + 3
|
||||||
it.y = this@ClickBox.y + 5 + height + (num * 9)
|
it.y = this@ClickBox.y + 5 + height + (num * 9)
|
||||||
|
Loading…
Reference in New Issue
Block a user