diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt index 5c83069..a9b8f81 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt @@ -16,7 +16,6 @@ import kotlin.reflect.full.findAnnotation @ApiStatus.Internal abstract class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) { private val info = this::class.findAnnotation() ?: throw Exception("Missing @Button annotaton") - override var color: Colors = info.color val title = this@ButtonImpl::class.simpleName protected open fun execAction() = Unit private var wasWithinBounds: Boolean = false @@ -60,7 +59,8 @@ abstract class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) { } } ClickGui.components.filterIsInstance().find { + this.color = info.parent.categoryColor it.name!!.key == info.parent.translationKey }?.buttons!!.add(this) } -} +} \ No newline at end of file