Directly define the color in ButtonImpl.kt
This commit is contained in:
parent
c11e0a8187
commit
f43f5569b2
|
@ -16,6 +16,7 @@ import kotlin.reflect.full.findAnnotation
|
||||||
@ApiStatus.Internal
|
@ApiStatus.Internal
|
||||||
abstract class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
|
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")
|
private val info = this::class.findAnnotation<ButtonInfo>() ?: throw Exception("Missing @Button annotaton")
|
||||||
|
override var color = info.parent.categoryColor
|
||||||
val title = this@ButtonImpl::class.simpleName
|
val title = this@ButtonImpl::class.simpleName
|
||||||
protected open fun execAction() = Unit
|
protected open fun execAction() = Unit
|
||||||
private var wasWithinBounds: Boolean = false
|
private var wasWithinBounds: Boolean = false
|
||||||
|
@ -59,7 +60,6 @@ abstract class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ClickGui.components.filterIsInstance<ClickBox>().find {
|
ClickGui.components.filterIsInstance<ClickBox>().find {
|
||||||
this.color = info.parent.categoryColor
|
|
||||||
it.name!!.key == info.parent.translationKey
|
it.name!!.key == info.parent.translationKey
|
||||||
}?.buttons!!.add(this)
|
}?.buttons!!.add(this)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue