diff --git a/BadAnimatorFix/BadAnimatorFixManager.cs b/BadAnimatorFix/BadAnimatorFixManager.cs index df307e2..fea5268 100644 --- a/BadAnimatorFix/BadAnimatorFixManager.cs +++ b/BadAnimatorFix/BadAnimatorFixManager.cs @@ -6,9 +6,9 @@ namespace NAK.BadAnimatorFix; public static class BadAnimatorFixManager { - static List _animatorFixers = new List(); - static int _currentIndex = 0; - static float _checkInterval = 5f; + private static List _animatorFixers = new List(); + private static int _currentIndex = 0; + private static float _checkInterval = 5f; public static void Add(BadAnimatorFixer bad) { diff --git a/BadAnimatorFix/BadAnimatorFixer.cs b/BadAnimatorFix/BadAnimatorFixer.cs index 9b43036..c1b648f 100644 --- a/BadAnimatorFix/BadAnimatorFixer.cs +++ b/BadAnimatorFix/BadAnimatorFixer.cs @@ -9,13 +9,9 @@ public class BadAnimatorFixer : MonoBehaviour private Animator animator; - void Start() - { - animator = GetComponent(); - } - - void OnEnable() => BadAnimatorFixManager.Add(this); - void OnDisable() => BadAnimatorFixManager.Remove(this); + private void Start() => animator = GetComponent(); + private void OnEnable() => BadAnimatorFixManager.Add(this); + private void OnDisable() => BadAnimatorFixManager.Remove(this); public void AttemptRewindAnimator() { diff --git a/BadAnimatorFix/HarmonyPatches.cs b/BadAnimatorFix/HarmonyPatches.cs index bb3d645..c1de51c 100644 --- a/BadAnimatorFix/HarmonyPatches.cs +++ b/BadAnimatorFix/HarmonyPatches.cs @@ -6,7 +6,7 @@ using UnityEngine; namespace NAK.BadAnimatorFix.HarmonyPatches; -static class AnimatorPatches +internal static class AnimatorPatches { [HarmonyPostfix] [HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.Start))] @@ -31,24 +31,6 @@ static class AnimatorPatches AddBadAnimatorFixComponentIfAnimatorExists(__instance.gameObject); } - // Set QM stuff - [HarmonyPostfix] - [HarmonyPatch(typeof(CVR_MenuManager), nameof(CVR_MenuManager.Start))] - private static void Postfix_CVR_MenuManager_Start(ref CVR_MenuManager __instance) - { - if (!BadAnimatorFix.EntryMenus.Value) return; - AddBadAnimatorFixComponentIfAnimatorExists(__instance.gameObject); - } - - // Set MM stuff - [HarmonyPostfix] - [HarmonyPatch(typeof(ViewManager), nameof(ViewManager.Start))] - private static void Postfix_ViewManager_Start(ref ViewManager __instance) - { - if (!BadAnimatorFix.EntryMenus.Value) return; - AddBadAnimatorFixComponentIfAnimatorExists(__instance.gameObject); - } - private static void AddBadAnimatorFixComponentIfAnimatorExists(GameObject gameObject) { Animator[] animators = gameObject.GetComponentsInChildren(true); diff --git a/BadAnimatorFix/Main.cs b/BadAnimatorFix/Main.cs index 9c17481..f74567c 100644 --- a/BadAnimatorFix/Main.cs +++ b/BadAnimatorFix/Main.cs @@ -21,9 +21,6 @@ public class BadAnimatorFix : MelonMod public static readonly MelonPreferences_Entry EntryCVRWorld = Category.CreateEntry("Add to CVRWorld", true, description: "Should BadAnimatorFix run for CVRWorld? Requires world reload."); - public static readonly MelonPreferences_Entry EntryMenus = - Category.CreateEntry("Add to Menus", true, description: "Should BadAnimatorFix run for QM & MM? Requires game restart."); - public static readonly MelonPreferences_Entry EntryLogging = Category.CreateEntry("Debugging", false, description: "Toggle to log each rewind if successful. Only needed for debugging."); @@ -42,12 +39,12 @@ public class BadAnimatorFix : MelonMod BadAnimatorFixManager.OnSceneInitialized(sceneName); } - void OnEntryEnabledChanged(bool newValue, bool oldValue) + private void OnEntryEnabledChanged(bool newValue, bool oldValue) { BadAnimatorFixManager.ToggleJob(newValue); } - void ApplyPatches(Type type) + private void ApplyPatches(Type type) { try { diff --git a/BadAnimatorFix/Properties/AssemblyInfo.cs b/BadAnimatorFix/Properties/AssemblyInfo.cs index e441e76..6814221 100644 --- a/BadAnimatorFix/Properties/AssemblyInfo.cs +++ b/BadAnimatorFix/Properties/AssemblyInfo.cs @@ -20,11 +20,13 @@ using System.Reflection; [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] [assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] [assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)] +[assembly: MelonColor(255, 226, 83, 82)] +[assembly: MelonAuthorColor(255, 158, 21, 32)] [assembly: HarmonyDontPatchAll] namespace NAK.BadAnimatorFix.Properties; internal static class AssemblyInfoParams { - public const string Version = "1.0.1"; + public const string Version = "1.0.2"; public const string Author = "NotAKidoS"; } \ No newline at end of file diff --git a/BadAnimatorFix/format.json b/BadAnimatorFix/format.json index eb9222e..385b7e6 100644 --- a/BadAnimatorFix/format.json +++ b/BadAnimatorFix/format.json @@ -1,8 +1,8 @@ { "_id": 152, "name": "BadAnimatorFix", - "modversion": "1.0.1", - "gameversion": "2022r170p1", + "modversion": "1.0.2", + "gameversion": "2023r171", "loaderversion": "0.6.1", "modtype": "Mod", "author": "NotAKidoS", @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r11/BadAnimatorFix.dll", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r17/BadAnimatorFix.dll", "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/BadAnimatorFix/", - "changelog": "- Speculative fix for loading Login, Init, and HQ scenes.", - "embedcolor": "e25352" + "changelog": "- Fixes for 2023r171.\n- Removed speculative menu fix option. It is no longer needed as menu clips no longer loop.", + "embedcolor": "#e25352" } \ No newline at end of file