mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
Move many mods to Deprecated folder, fix spelling
This commit is contained in:
parent
5e822cec8d
commit
0042590aa6
539 changed files with 7475 additions and 3120 deletions
33
.Deprecated/AASDefaultProfileFix/Main.cs
Normal file
33
.Deprecated/AASDefaultProfileFix/Main.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System.Reflection;
|
||||
using ABI_RC.Core.Util.AnimatorManager;
|
||||
using ABI.CCK.Scripts;
|
||||
using HarmonyLib;
|
||||
using MelonLoader;
|
||||
|
||||
namespace NAK.AASDefaultProfileFix;
|
||||
|
||||
public class AASDefaultProfileFix : MelonMod
|
||||
{
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
HarmonyInstance.Patch(
|
||||
typeof(CVRAdvancedAvatarSettings).GetMethod(nameof(CVRAdvancedAvatarSettings.LoadProfile),
|
||||
BindingFlags.Public | BindingFlags.Instance),
|
||||
prefix: new HarmonyMethod(typeof(AASDefaultProfileFix).GetMethod(nameof(OnAttemptLoadAASProfile),
|
||||
BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
}
|
||||
|
||||
// when default profile is selected the defaultProfileName string is emptydepends
|
||||
// so it does not load/apply anything- we will fix by forcing LoadDefault when this is detected
|
||||
private static bool OnAttemptLoadAASProfile(string profileName, AvatarAnimatorManager animatorManager,
|
||||
ref CVRAdvancedAvatarSettings __instance)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(profileName) // LoadDefault sets defaultProfileName as ""
|
||||
&& profileName != "default") // CVRAdvancedSettingsFile defines initial default as "default"
|
||||
return true;
|
||||
|
||||
__instance.LoadDefault(animatorManager);
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue