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 cb74257..954c8fd 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt @@ -20,13 +20,13 @@ import java.io.File import kotlin.reflect.KProperty object Configuration { - private val ModifiableValues: MutableMap ConfigValue> = mapOf( + private val ModifiableValues = mutableMapOf ConfigValue>( "enabledFeatures" to { ConfigValueFactory.fromMap(enabledFeatures) }, "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())) }, - ).toMutableMap() + ) private fun Config.withFullModifiableValues() = ModifiableValues.entries.fold(this) { previous, entry -> previous.withValue(entry.key, entry.value()) }