From 682c1fc23ee900f8515d4914c9945b72c0d3d6ab Mon Sep 17 00:00:00 2001 From: Joshua Thome Date: Wed, 2 Oct 2024 22:47:00 -0500 Subject: [PATCH] Add postfix patch to disable orphaned signalscope reticles (Fixes #925) --- .../SignalscopeReticleControllerPatches.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 NewHorizons/Patches/SignalPatches/SignalscopeReticleControllerPatches.cs diff --git a/NewHorizons/Patches/SignalPatches/SignalscopeReticleControllerPatches.cs b/NewHorizons/Patches/SignalPatches/SignalscopeReticleControllerPatches.cs new file mode 100644 index 00000000..c9ec099a --- /dev/null +++ b/NewHorizons/Patches/SignalPatches/SignalscopeReticleControllerPatches.cs @@ -0,0 +1,20 @@ +using HarmonyLib; + +namespace NewHorizons.Patches.SignalPatches +{ + [HarmonyPatch(typeof(SignalscopeReticleController))] + public static class SignalScopeReticleControllerPatches + { + [HarmonyPostfix] + [HarmonyPatch(nameof(SignalscopeReticleController.UpdateBrackets))] + public static void SignalscopeReticleController_UpdateBrackets(SignalscopeReticleController __instance) + { + var listSignals = Locator.GetAudioSignals(); + for (int i = listSignals.Count; i < __instance._clonedLeftBrackets.Count; i++) + { + __instance._clonedLeftBrackets[i].enabled = false; + __instance._clonedRightBrackets[i].enabled = false; + } + } + } +}