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 917670f..8c2099f 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 @@ -14,17 +14,15 @@ import kotlin.reflect.full.findAnnotation sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) { internal companion object { private fun addButtons(vararg buttons: ButtonImpl) { - buttons.groupBy { + buttons.groupBy { impl -> ClickGui.clickBoxes.find { box -> - it.let { impl -> - with(impl) { - if (info.shouldSave && info.kind == Type.TOGGLE && !info.parent.shouldHide) { - Configuration.enabledFeatures[title]?.let { bool -> - toggled = bool - } + with(impl) { + if (info.shouldSave && info.kind == Type.TOGGLE && !info.parent.shouldHide) { + Configuration.enabledFeatures[title]?.let { bool -> + toggled = bool } } - box.isCategory(impl.info.parent) + box.isCategory(info.parent) } } }.entries.forEach { entry ->