Remove a useless init block in ClickBox.kt

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2023-04-28 20:56:30 +02:00
parent 76b28db14b
commit 4df3066134
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 2 additions and 7 deletions

View File

@ -24,8 +24,8 @@ import kotlin.collections.LinkedHashSet
@ApiStatus.Internal @ApiStatus.Internal
class ClickBox( class ClickBox(
x: Double, y: Double, x: Double, y: Double,
override var color: Int = Colors.BLUE.hexValue, val name: Component = MissingComponent,
val name: Component = MissingComponent override var color: Int = savedColors?.get(name.string) ?: Colors.BLUE.hexValue,
): ColoredElement(x, y, 80, 10, color, 0.5F) { ): ColoredElement(x, y, 80, 10, color, 0.5F) {
fun isCategory(c: Category): Boolean = (name.string == c.box.name.string) fun isCategory(c: Category): Boolean = (name.string == c.box.name.string)
val buttons: MutableSet<ButtonImpl> = val buttons: MutableSet<ButtonImpl> =
@ -119,9 +119,4 @@ class ClickBox(
Minecraft.getInstance().font.draw(poseStack, name.string, x.toFloat() + 5, y.toFloat() + 1.5F, Colors.TRANSPARENT.hexValue) Minecraft.getInstance().font.draw(poseStack, name.string, x.toFloat() + 5, y.toFloat() + 1.5F, Colors.TRANSPARENT.hexValue)
} }
} }
init {
savedColors?.get(name.string)?.let {
this.color = it
}
}
} }