Compare commits

..

No commits in common. "2aaeb7b0393b394764f3c9c2d109b076251bf1a1" and "e96c2adb68a6e80956557b73701a79737d6c9a47" have entirely different histories.

3 changed files with 20 additions and 11 deletions

View File

@ -26,7 +26,7 @@ plugins {
}
group = "fr.username404"
version = "0.3.6"
version = "0.3.5"
val groupAndName = "${rootProject.group}.${rootProject.name.lowercase()}"
val javaVer: String = "21"

View File

@ -95,7 +95,11 @@ object Configuration {
val enabledFeatures = mutableMapOf<String, Boolean>().apply {
"enabledFeatures".let { obtained.run {
if (hasPath(it)) {
putAll(extract<Map<out String, Boolean>>(it))
putAll(extract<Map<out String, Boolean>>(it).filterKeys { keyName -> ClickGui.clickBoxes.any {
it.buttons.any { button ->
button.info.shouldSave() && button.title == keyName
}
}})
}
} }
}

View File

@ -17,20 +17,25 @@ sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
private fun addButtons(vararg buttons: ButtonImpl) {
buttons.groupBy { impl ->
ClickGui.clickBoxes.find { box ->
box.isCategory(impl.info.parent)
}
}.entries.forEach { entry -> entry.run {
key?.buttons?.clear()
value.forEach { if (!it.isDisabled) {
key?.buttons?.add(it.apply {
with(impl) {
if (info.shouldSave() && !info.parent.shouldHide) {
Configuration.enabledFeatures[title]?.let { bool ->
toggled = bool
}
}
})
} }
} }
box.isCategory(info.parent)
}
}
}.entries.forEach { entry ->
with(entry) {
key?.buttons?.clear()
value.forEach {
if (!it.isDisabled) {
key?.buttons?.add(it)
}
}
}
}
}
@JvmStatic
fun initButtons() = addButtons(