diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2024-10-05 18:50:42 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-05 10:50:42 +0200 |
commit | a517ef456bde52aa391e31198c0facc87edaa7cf (patch) | |
tree | adbacd4a8f61eef4ea10d683097b13ce390c8d24 | |
parent | e83d5b432a54d53253bcf6f2828fb41767ad17e1 (diff) | |
download | skyhanni-a517ef456bde52aa391e31198c0facc87edaa7cf.tar.gz skyhanni-a517ef456bde52aa391e31198c0facc87edaa7cf.tar.bz2 skyhanni-a517ef456bde52aa391e31198c0facc87edaa7cf.zip |
Fix: chroma disabling patchers font renderer for no reason (#2666)
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 + } } } } |