diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt index ad6232646..db9c1c07e 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.features.chroma.ChromaFontRenderer import at.hannibal2.skyhanni.features.chroma.ChromaManager import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RenderUtils +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption import net.minecraft.client.renderer.GlStateManager /** @@ -27,9 +28,17 @@ object FontRendererHook { private var currentDrawState: ChromaFontRenderer? = null private var previewChroma = false + private var chromaPreviewText: String var cameFromChat = false + init { + // Get the description text from the ConfigOption annotation from the chromaPreview field to check against + val fields = config::class.java.declaredFields + val previewField = fields.first { it.name == "chromaPreview" } // Pls no one change the config field name + chromaPreviewText = previewField.getAnnotation(ConfigOption::class.java).desc + } + /** * Setups the [ChromaFontRenderer][at.hannibal2.skyhanni.features.chroma.ChromaFontRenderer] for rendering text * in chroma. This should only be used when you don't have control over the color code a string uses, or it @@ -71,7 +80,7 @@ object FontRendererHook { return } - if (text == "§fPlease star the mod on GitHub!") { + if (text == chromaPreviewText) { previewChroma = true setupChromaFont() } |