From 76e9ca3595f26c9c67b3d9da6869f5b09389ce0b Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Sat, 2 Aug 2025 15:55:12 +0300 Subject: [PATCH] Refactor: Make State an internal class of JesterPatch class --- MuzikaGromche/Plugin.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/MuzikaGromche/Plugin.cs b/MuzikaGromche/Plugin.cs index 45a3c54..aa38040 100644 --- a/MuzikaGromche/Plugin.cs +++ b/MuzikaGromche/Plugin.cs @@ -1772,14 +1772,21 @@ namespace MuzikaGromche #if DEBUG [HarmonyPatch(nameof(JesterAI.SetJesterInitialValues))] [HarmonyPostfix] - public static void AlmostInstantFollowTimerPostfix(JesterAI __instance) + static void AlmostInstantFollowTimerPostfix(JesterAI __instance) { __instance.beginCrankingTimer = 1f; } #endif + + class State + { + public required AudioSource farAudio; + public required int previousState; + } + [HarmonyPatch(nameof(JesterAI.Update))] [HarmonyPrefix] - public static void DoNotStopTheMusicPrefix(JesterAI __instance, out State __state) + static void DoNotStopTheMusicPrefix(JesterAI __instance, out State __state) { __state = new State { @@ -1801,7 +1808,7 @@ namespace MuzikaGromche [HarmonyPatch(nameof(JesterAI.Update))] [HarmonyPostfix] - public static void DoNotStopTheMusic(JesterAI __instance, State __state) + static void DoNotStopTheMusic(JesterAI __instance, State __state) { if (__instance.previousState == 1 && __state.previousState != 1) { @@ -1911,10 +1918,4 @@ namespace MuzikaGromche } } } - - internal class State - { - public required AudioSource farAudio; - public required int previousState; - } }