From 186925a4667142712a44933715b94cd25c8add04 Mon Sep 17 00:00:00 2001 From: Wyvest Date: Sun, 24 Dec 2023 17:09:20 +0900 Subject: [PATCH] Merge 1.7 and 1.12 debug scren crosshair into one dropdown --- .../config/OldAnimationsSettings.java | 18 ++++++------------ .../mixin/EntityRendererMixin.java | 2 +- .../mixin/GuiIngameForgeMixin.java | 2 +- .../mixin/GuiIngameMixin.java | 2 +- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/polyfrost/overflowanimations/config/OldAnimationsSettings.java b/src/main/java/org/polyfrost/overflowanimations/config/OldAnimationsSettings.java index 232ad16..bd6913b 100644 --- a/src/main/java/org/polyfrost/overflowanimations/config/OldAnimationsSettings.java +++ b/src/main/java/org/polyfrost/overflowanimations/config/OldAnimationsSettings.java @@ -195,19 +195,13 @@ public class OldAnimationsSettings extends Config { ) public static boolean oldHealth = true; - @Switch( - name = "1.7 Debug Screen Crosshair", - description = "Disables the RGB cross-hair in the debug menu.", - subcategory = "HUD" - ) - public static boolean oldDebugCrosshair = false; - - @Switch( - name = "1.12+ Debug Screen Crosshair", - description = "Revamps the RGB cross-hair in the debug menu.", - subcategory = "HUD" + @Dropdown( + name = "Debug Menu Crosshair Style", + description = "Allows you to choose between the 1.7, the vanilla 1.8, and the 1.12+ debug screen crosshair. 1.12+ Debug Screen Crosshair fixes Patcher's Parallax Fix Feature!", + subcategory = "HUD", + options = {"1.7", "1.8", "1.12+"} ) - public static boolean newDebugCrosshair = true; + public int debugCrosshairMode = 2; @Dropdown( name = "Debug Menu Style", diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/EntityRendererMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/EntityRendererMixin.java index cdf5f6b..4dcbe32 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/EntityRendererMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/EntityRendererMixin.java @@ -48,7 +48,7 @@ private void interpolateHeight(CallbackInfo ci) { @Inject(method = "renderWorldDirections", at = {@At("HEAD")}, cancellable = true) public void renderCrosshair(float partialTicks, CallbackInfo ci) { - if ((OldAnimationsSettings.newDebugCrosshair || OldAnimationsSettings.oldDebugCrosshair) && OldAnimationsSettings.INSTANCE.enabled) + if ((OldAnimationsSettings.INSTANCE.debugCrosshairMode != 1) && OldAnimationsSettings.INSTANCE.enabled) ci.cancel(); } diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/GuiIngameForgeMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/GuiIngameForgeMixin.java index 9601b6d..5e2033f 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/GuiIngameForgeMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/GuiIngameForgeMixin.java @@ -46,7 +46,7 @@ private boolean cancelFlash(boolean original) { @Inject(method = "renderGameOverlay", at = @At(value = "FIELD", target = "Lnet/minecraftforge/client/GuiIngameForge;renderCrosshairs:Z")) public void renderRGBCrosshair(float partialTicks, CallbackInfo ci) { - if (OldAnimationsSettings.newDebugCrosshair && !OldAnimationsSettings.oldDebugCrosshair && + if (OldAnimationsSettings.INSTANCE.debugCrosshairMode == 2 && OldAnimationsSettings.INSTANCE.enabled && mc.gameSettings.showDebugInfo && !mc.thePlayer.hasReducedDebug() && !mc.gameSettings.reducedDebugInfo) { DebugCrosshairHook.renderDirections(partialTicks, zLevel, res, mc); diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/GuiIngameMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/GuiIngameMixin.java index 587d334..02b6ea5 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/GuiIngameMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/GuiIngameMixin.java @@ -18,7 +18,7 @@ public class GuiIngameMixin extends Gui { @Inject(method = "showCrosshair", at = @At("HEAD"), cancellable = true) public void renderCrosshair(CallbackInfoReturnable cir) { - if (OldAnimationsSettings.oldDebugCrosshair && OldAnimationsSettings.INSTANCE.enabled && mc.gameSettings.showDebugInfo) { + if (OldAnimationsSettings.INSTANCE.debugCrosshairMode == 0 && OldAnimationsSettings.INSTANCE.enabled && mc.gameSettings.showDebugInfo) { cir.setReturnValue(true); } }