Skip to content

Commit

Permalink
Merge 1.7 and 1.12 debug scren crosshair into one dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Dec 24, 2023
1 parent b703e94 commit 186925a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class GuiIngameMixin extends Gui {

@Inject(method = "showCrosshair", at = @At("HEAD"), cancellable = true)
public void renderCrosshair(CallbackInfoReturnable<Boolean> cir) {
if (OldAnimationsSettings.oldDebugCrosshair && OldAnimationsSettings.INSTANCE.enabled && mc.gameSettings.showDebugInfo) {
if (OldAnimationsSettings.INSTANCE.debugCrosshairMode == 0 && OldAnimationsSettings.INSTANCE.enabled && mc.gameSettings.showDebugInfo) {
cir.setReturnValue(true);
}
}
Expand Down

0 comments on commit 186925a

Please sign in to comment.