diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt index 8e38947..ed45d33 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt @@ -20,28 +20,31 @@ annotation class ButtonInfo( TOGGLE, CLICK } - } -}; enum class Category(val translationKey: String, val categoryColor: Int, val shouldHide: Boolean = false) { - MISC("snowy.clickbox.misc", Colors.BLUE), - RISKY("snowy.clickbox.risky", Colors.RED, !riskyCheats), - MACROS("snowy.clickbox.macros", Colors.GREEN); - companion object { - fun fromBox(box: ClickBox): Category? = values().find { - box.isCategory(it) + enum class Category(val translationKey: String, val categoryColor: Int, val shouldHide: Boolean = false) { + MISC("snowy.clickbox.misc", Colors.BLUE), + RISKY("snowy.clickbox.risky", Colors.RED, !riskyCheats), + MACROS("snowy.clickbox.macros", Colors.GREEN); + companion object { + fun fromBox(box: ClickBox): Category? = values().find { + box.isCategory(it) + } + } + var box: ClickBox = ClickBox( + x = 4.0 + (ordinal - ClickGui.clickBoxes.count { category -> + category.hidden + }) * 86, y = 4.0, + name = TranslatableComponent(translationKey), + color = categoryColor + ); private set + constructor( + translationKey: String, categoryColor: Colors, condition: Boolean = false + ): this(translationKey, categoryColor.hexValue, condition) + constructor(box: ClickBox): this(translationKey = box.name.key, categoryColor = box.color) { this.box = box } + init { + ClickGui.components.add(box.apply { if (shouldHide) hidden = true }) + } } } - var box: ClickBox = ClickBox( - x = 4.0 + (ordinal - ClickGui.clickBoxes.count { category -> - category.hidden - }) * 86, y = 4.0, - name = TranslatableComponent(translationKey), - color = categoryColor - ); private set - constructor( - translationKey: String, categoryColor: Colors, condition: Boolean = false - ): this(translationKey, categoryColor.hexValue, condition) - constructor(box: ClickBox): this(translationKey = box.name.key, categoryColor = box.color) { this.box = box } - init { - ClickGui.components.add(box.apply { if (shouldHide) hidden = true }) - } } + +typealias Category = ButtonInfo.Companion.Category \ No newline at end of file