diff --git a/common/src/main/kotlin/fr/username404/snowygui/Snowy.kt b/common/src/main/kotlin/fr/username404/snowygui/Snowy.kt index 1b2318b..4546c3a 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/Snowy.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/Snowy.kt @@ -3,7 +3,7 @@ package fr.username404.snowygui import fr.username404.snowygui.EventSnowy.Companion.useKey import fr.username404.snowygui.config.Configuration import fr.username404.snowygui.gui.feature.ButtonImpl -import fr.username404.snowygui.gui.feature.Ignored +import fr.username404.snowygui.gui.feature.ButtonInfo import fr.username404.snowygui.misc.AddKeyMaps import net.minecraft.network.chat.TranslatableComponent import org.apache.logging.log4j.LogManager @@ -11,7 +11,7 @@ import org.apache.logging.log4j.Logger import java.lang.reflect.Modifier abstract class Snowy { - protected fun Class<*>.isValidForButtonCollection(): Boolean = (!((Modifier.isAbstract(javaClass.modifiers)) || javaClass.isAnnotationPresent(Ignored::class.java))) + protected fun Class<*>.isValidForButtonCollection(): Boolean = (!((Modifier.isAbstract(javaClass.modifiers)) || javaClass.isAnnotationPresent(ButtonInfo.Ignored::class.java))) private val displayInitMessage: Boolean by Configuration companion object { val MissingComponent: TranslatableComponent = object: TranslatableComponent(null) { override fun getString(): String = "MISSING_COMPONENT" } diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonAnnotations.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt similarity index 94% rename from common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonAnnotations.kt rename to common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt index 1e58266..09a477f 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonAnnotations.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt @@ -13,6 +13,11 @@ annotation class ButtonInfo( val parent: Category, val kind: Type = Type.TOGGLE ) { + /** + * Excludes a class from button collection + */ + annotation class Ignored + companion object { internal var lightningFactor: Float = 0.33F enum class Type { @@ -42,8 +47,3 @@ annotation class ButtonInfo( ClickGui.components.add(box) } } - -/** - * Excludes a class from button collection - */ -annotation class Ignored \ No newline at end of file diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Macro.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Macro.kt index 6c1fc80..46081c7 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Macro.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Macro.kt @@ -5,6 +5,7 @@ import kotlinx.serialization.Serializable import net.minecraft.client.Minecraft @Serializable +@ButtonInfo.Ignored @ButtonInfo(Category.MACROS, kind = Type.CLICK) data class Macro( @JvmField var command: String,