Don't save default colors to the configuration file
This commit is contained in:
parent
d2bd1c4742
commit
5a17cc3b60
|
@ -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<String, Int>(*ClickGui.clickboxes.filter { it.name != null }.map { it.name!!.key to it.color }.toTypedArray())) },
|
||||
"box_colors" to { ConfigValueFactory.fromAnyRef(mapOf<String, Int>(*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())
|
||||
|
|
Loading…
Reference in New Issue