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 954c8fd..790020a 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,11 @@ 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 { it.name != null }.map { it.name!!.key to it.color }.toTypedArray())) }, + "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 + }.toTypedArray())) }, ) private fun Config.withFullModifiableValues() = ModifiableValues.entries.fold(this) { previous, entry -> previous.withValue(entry.key, entry.value())