forked from nikita/muzika-gromche
Refactor: Make State an internal class of JesterPatch class
This commit is contained in:
parent
b6f2ca355b
commit
76e9ca3595
|
@ -1772,14 +1772,21 @@ namespace MuzikaGromche
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
[HarmonyPatch(nameof(JesterAI.SetJesterInitialValues))]
|
[HarmonyPatch(nameof(JesterAI.SetJesterInitialValues))]
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
public static void AlmostInstantFollowTimerPostfix(JesterAI __instance)
|
static void AlmostInstantFollowTimerPostfix(JesterAI __instance)
|
||||||
{
|
{
|
||||||
__instance.beginCrankingTimer = 1f;
|
__instance.beginCrankingTimer = 1f;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class State
|
||||||
|
{
|
||||||
|
public required AudioSource farAudio;
|
||||||
|
public required int previousState;
|
||||||
|
}
|
||||||
|
|
||||||
[HarmonyPatch(nameof(JesterAI.Update))]
|
[HarmonyPatch(nameof(JesterAI.Update))]
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
public static void DoNotStopTheMusicPrefix(JesterAI __instance, out State __state)
|
static void DoNotStopTheMusicPrefix(JesterAI __instance, out State __state)
|
||||||
{
|
{
|
||||||
__state = new State
|
__state = new State
|
||||||
{
|
{
|
||||||
|
@ -1801,7 +1808,7 @@ namespace MuzikaGromche
|
||||||
|
|
||||||
[HarmonyPatch(nameof(JesterAI.Update))]
|
[HarmonyPatch(nameof(JesterAI.Update))]
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
public static void DoNotStopTheMusic(JesterAI __instance, State __state)
|
static void DoNotStopTheMusic(JesterAI __instance, State __state)
|
||||||
{
|
{
|
||||||
if (__instance.previousState == 1 && __state.previousState != 1)
|
if (__instance.previousState == 1 && __state.previousState != 1)
|
||||||
{
|
{
|
||||||
|
@ -1911,10 +1918,4 @@ namespace MuzikaGromche
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class State
|
|
||||||
{
|
|
||||||
public required AudioSource farAudio;
|
|
||||||
public required int previousState;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue