This commit is contained in:
NotAKidoS 2023-03-24 17:17:53 -05:00
parent 83c101f5ee
commit 1acf58d161
5 changed files with 88 additions and 38 deletions

View file

@ -1,4 +1,6 @@
using MelonLoader;
using System.Collections;
using ABI_RC.Core.Player;
namespace NAK.Melons.BadAnimatorFix;
@ -29,7 +31,21 @@ public class BadAnimatorFixMod : MelonMod
public override void OnInitializeMelon()
{
Logger = LoggerInstance;
EntryEnabled.OnEntryValueChangedUntyped.Subscribe(OnEnabled);
ApplyPatches(typeof(HarmonyPatches.AnimatorPatches));
MelonCoroutines.Start(WaitForLocalPlayer());
}
private IEnumerator WaitForLocalPlayer()
{
while (PlayerSetup.Instance == null)
yield return null;
BadAnimatorFixManager.ToggleJob(EntryEnabled.Value);
}
private void OnEnabled(object arg1, object arg2)
{
BadAnimatorFixManager.ToggleJob(EntryEnabled.Value);
}
private void ApplyPatches(Type type)