mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
[BadAnimatorFix] Fixes for 2023r171
This commit is contained in:
parent
d3db894acf
commit
b20928c2b1
6 changed files with 17 additions and 40 deletions
|
@ -6,9 +6,9 @@ namespace NAK.BadAnimatorFix;
|
|||
|
||||
public static class BadAnimatorFixManager
|
||||
{
|
||||
static List<BadAnimatorFixer> _animatorFixers = new List<BadAnimatorFixer>();
|
||||
static int _currentIndex = 0;
|
||||
static float _checkInterval = 5f;
|
||||
private static List<BadAnimatorFixer> _animatorFixers = new List<BadAnimatorFixer>();
|
||||
private static int _currentIndex = 0;
|
||||
private static float _checkInterval = 5f;
|
||||
|
||||
public static void Add(BadAnimatorFixer bad)
|
||||
{
|
||||
|
|
|
@ -9,13 +9,9 @@ public class BadAnimatorFixer : MonoBehaviour
|
|||
|
||||
private Animator animator;
|
||||
|
||||
void Start()
|
||||
{
|
||||
animator = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
void OnEnable() => BadAnimatorFixManager.Add(this);
|
||||
void OnDisable() => BadAnimatorFixManager.Remove(this);
|
||||
private void Start() => animator = GetComponent<Animator>();
|
||||
private void OnEnable() => BadAnimatorFixManager.Add(this);
|
||||
private void OnDisable() => BadAnimatorFixManager.Remove(this);
|
||||
|
||||
public void AttemptRewindAnimator()
|
||||
{
|
||||
|
|
|
@ -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<Animator>(true);
|
||||
|
|
|
@ -21,9 +21,6 @@ public class BadAnimatorFix : MelonMod
|
|||
public static readonly MelonPreferences_Entry<bool> EntryCVRWorld =
|
||||
Category.CreateEntry("Add to CVRWorld", true, description: "Should BadAnimatorFix run for CVRWorld? Requires world reload.");
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryMenus =
|
||||
Category.CreateEntry("Add to Menus", true, description: "Should BadAnimatorFix run for QM & MM? Requires game restart.");
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> 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
|
||||
{
|
||||
|
|
|
@ -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";
|
||||
}
|
|
@ -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"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue