diff options
3 files changed, 21 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/chroma/ChromaConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/chroma/ChromaConfig.java index 6a02e2ed3..b3f8577f0 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/chroma/ChromaConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/chroma/ChromaConfig.java @@ -20,7 +20,7 @@ public class ChromaConfig { public boolean chromaPreview = false; @Expose - @ConfigOption(name = "Enabled", desc = "Toggle SkyHanni's chroma. §e(Disables Patcher's Optimized Font Renderer while enabled)") + @ConfigOption(name = "Enabled", desc = "Toggle SkyHanni's chroma.") @ConfigEditorBoolean @FeatureToggle public Property<Boolean> enabled = Property.of(false); @@ -80,7 +80,7 @@ public class ChromaConfig { public Runnable resetSettings = ChromaManager::resetChromaSettings; @Expose - @ConfigOption(name = "Everything Chroma", desc = "Render §4§l§oALL §r§7text in chroma. §e(Some enchants may appear white with SBA enchant parsing)") + @ConfigOption(name = "Everything Chroma", desc = "Render §4§l§oALL §r§7text in chroma. §e(Disables Patcher's Optimized Font Renderer while enabled)") @ConfigEditorBoolean public boolean allChroma = false; 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 db9c1c07e..b52407b65 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt @@ -28,7 +28,7 @@ object FontRendererHook { private var currentDrawState: ChromaFontRenderer? = null private var previewChroma = false - private var chromaPreviewText: String + var chromaPreviewText: String var cameFromChat = false diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/MixinPatcherFontRendererHookHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/MixinPatcherFontRendererHookHook.kt index 25d415889..25697e0ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/MixinPatcherFontRendererHookHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/MixinPatcherFontRendererHookHook.kt @@ -11,9 +11,25 @@ class MixinPatcherFontRendererHookHook { fun overridePatcherFontRenderer(string: String, shadow: Boolean, cir: CallbackInfoReturnable<Boolean>) { if (!LorenzUtils.onHypixel) return - if (ChromaManager.config.enabled.get()) { - cir.cancel() + if (ChromaManager.config.allChroma) { cir.returnValue = false + return + } + + if (string == FontRendererHook.chromaPreviewText) { + cir.returnValue = false + return + } + + if (string.contains("§#§")) { + cir.returnValue = false + return + } + if (ChromaManager.config.enabled.get()) { + if (string.contains("§z") || string.contains("§Z")) { + cir.returnValue = false + return + } } } } |