Compare commits
2 Commits
e96c2adb68
...
2aaeb7b039
Author | SHA1 | Date | |
---|---|---|---|
2aaeb7b039 | |||
6416a03001 |
@ -26,7 +26,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "fr.username404"
|
group = "fr.username404"
|
||||||
version = "0.3.5"
|
version = "0.3.6"
|
||||||
val groupAndName = "${rootProject.group}.${rootProject.name.lowercase()}"
|
val groupAndName = "${rootProject.group}.${rootProject.name.lowercase()}"
|
||||||
|
|
||||||
val javaVer: String = "21"
|
val javaVer: String = "21"
|
||||||
|
@ -95,11 +95,7 @@ object Configuration {
|
|||||||
val enabledFeatures = mutableMapOf<String, Boolean>().apply {
|
val enabledFeatures = mutableMapOf<String, Boolean>().apply {
|
||||||
"enabledFeatures".let { obtained.run {
|
"enabledFeatures".let { obtained.run {
|
||||||
if (hasPath(it)) {
|
if (hasPath(it)) {
|
||||||
putAll(extract<Map<out String, Boolean>>(it).filterKeys { keyName -> ClickGui.clickBoxes.any {
|
putAll(extract<Map<out String, Boolean>>(it))
|
||||||
it.buttons.any { button ->
|
|
||||||
button.info.shouldSave() && button.title == keyName
|
|
||||||
}
|
|
||||||
}})
|
|
||||||
}
|
}
|
||||||
} }
|
} }
|
||||||
}
|
}
|
||||||
|
@ -17,25 +17,20 @@ sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
|
|||||||
private fun addButtons(vararg buttons: ButtonImpl) {
|
private fun addButtons(vararg buttons: ButtonImpl) {
|
||||||
buttons.groupBy { impl ->
|
buttons.groupBy { impl ->
|
||||||
ClickGui.clickBoxes.find { box ->
|
ClickGui.clickBoxes.find { box ->
|
||||||
with(impl) {
|
box.isCategory(impl.info.parent)
|
||||||
|
}
|
||||||
|
}.entries.forEach { entry -> entry.run {
|
||||||
|
key?.buttons?.clear()
|
||||||
|
value.forEach { if (!it.isDisabled) {
|
||||||
|
key?.buttons?.add(it.apply {
|
||||||
if (info.shouldSave() && !info.parent.shouldHide) {
|
if (info.shouldSave() && !info.parent.shouldHide) {
|
||||||
Configuration.enabledFeatures[title]?.let { bool ->
|
Configuration.enabledFeatures[title]?.let { bool ->
|
||||||
toggled = 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
|
@JvmStatic
|
||||||
fun initButtons() = addButtons(
|
fun initButtons() = addButtons(
|
||||||
|
Loading…
Reference in New Issue
Block a user