Use the category colors in buttons
This commit is contained in:
parent
9530100ca3
commit
c11e0a8187
|
@ -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<ButtonInfo>() ?: 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<ClickBox>().find {
|
||||
this.color = info.parent.categoryColor
|
||||
it.name!!.key == info.parent.translationKey
|
||||
}?.buttons!!.add(this)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue