diff --git a/common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt b/common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt index 801c11d..beab8d9 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt @@ -9,7 +9,7 @@ object ClickGui: SnowyScreen() { private var GuiDragging: Boolean = false override val components = mutableSetOf() - val clickboxes get() = components.filterIsInstance() + val clickBoxes get() = components.filterIsInstance() inline fun boxContext(args: ClickBox.() -> Unit) = components.filterIsInstance().forEach(args) private inline fun buttonsContext(args: ColoredElement.() -> Unit) = boxContext { buttons.forEach(args) } override fun mouseClicked(d: Double, e: Double, i: Int): Boolean { buttonsContext { this.mouseClicked(d, e, i) }; return false } diff --git a/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt b/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt index 38581d2..7a1edfc 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt @@ -52,7 +52,7 @@ val SnowyConfigScreen: Screen get() { }.setTooltip(Component.nullToEmpty("WARNING: Do not use this on servers or you might get banned.")).build() ).addEntry(startSubCategory(TranslatableComponent("$confPrefix.colors")).also { builder -> builder.addAll( - ClickGui.clickboxes.map { box -> + ClickGui.clickBoxes.map { box -> startColorField(box.name, box.color).setSaveConsumer { box.color = it }.setDefaultValue(Category.values().find { diff --git a/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt b/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt index 790020a..25ae41f 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt @@ -25,7 +25,7 @@ object Configuration { "macros" to { ConfigValueFactory.fromIterable((ClickGui.components.find { it is ClickBox && it.isCategory(Category.MACROS) } as ClickBox).buttons.map { Json.encodeToString(it as Macro) }) }, - "box_colors" to { ConfigValueFactory.fromAnyRef(mapOf(*ClickGui.clickboxes.filter { box -> + "box_colors" to { ConfigValueFactory.fromAnyRef(mapOf(*ClickGui.clickBoxes.filter { box -> box.name != null && Category.values().find { category -> box.name.key == category.translationKey }?.categoryColor != box.color }.map { it.name!!.key to it.color