Rename ClickGui.clickboxes to clickBoxes

This commit is contained in:
Username404 2021-06-05 15:55:15 +02:00
parent 5a17cc3b60
commit 8c476be0b8
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
3 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ object ClickGui: SnowyScreen() {
private var GuiDragging: Boolean = false
override val components = mutableSetOf<Element>()
val clickboxes get() = components.filterIsInstance<ClickBox>()
val clickBoxes get() = components.filterIsInstance<ClickBox>()
inline fun boxContext(args: ClickBox.() -> Unit) = components.filterIsInstance<ClickBox>().forEach(args)
private inline fun buttonsContext(args: ColoredElement.() -> Unit) = boxContext { buttons.forEach(args) }
override fun mouseClicked(d: Double, e: Double, i: Int): Boolean { buttonsContext { this.mouseClicked(d, e, i) }; return false }

View File

@ -52,7 +52,7 @@ val SnowyConfigScreen: Screen get() {
}.setTooltip(Component.nullToEmpty("WARNING: Do not use this on servers or you might get banned.")).build()
).addEntry(startSubCategory(TranslatableComponent("$confPrefix.colors")).also { builder ->
builder.addAll(
ClickGui.clickboxes.map { box ->
ClickGui.clickBoxes.map { box ->
startColorField(box.name, box.color).setSaveConsumer {
box.color = it
}.setDefaultValue(Category.values().find {

View File

@ -25,7 +25,7 @@ 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 { box ->
"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