Rename ClickGui.clickboxes to clickBoxes
This commit is contained in:
parent
5a17cc3b60
commit
8c476be0b8
|
@ -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 }
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue