Access the MACROS box directly in Configuration.kt

This commit is contained in:
Username404 2021-06-26 17:33:24 +02:00
parent d315737321
commit a5b1c45a86
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 2 deletions

View File

@ -11,7 +11,6 @@ import com.typesafe.config.ConfigValueFactory
import fr.username404.snowygui.ClickGui
import fr.username404.snowygui.Snowy
import fr.username404.snowygui.Snowy.Companion.MissingComponent
import fr.username404.snowygui.gui.elements.ClickBox
import fr.username404.snowygui.gui.feature.Category
import fr.username404.snowygui.gui.feature.Macro
import io.github.config4k.extract
@ -36,7 +35,7 @@ object Configuration {
mutableMapOf(
"enabledFeatures" to enabledFeatures,
"macros" to lazy {
(ClickGui.components.find { it is ClickBox && it.isCategory(Category.MACROS) } as ClickBox).buttons.map {
Category.MACROS.box.buttons.map {
Json.encodeToString(it as Macro)
}
},