mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
[AASDefaultProfileFix] Initial release
This commit is contained in:
parent
4ab4b3ed70
commit
9464995557
5 changed files with 107 additions and 0 deletions
6
AASDefaultProfileFix/AASDefaultProfileFix.csproj
Normal file
6
AASDefaultProfileFix/AASDefaultProfileFix.csproj
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<RootNamespace>LoadedObjectHack</RootNamespace>
|
||||
</PropertyGroup>
|
||||
</Project>
|
33
AASDefaultProfileFix/Main.cs
Normal file
33
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), // earliest callback (why the fuck are you public)
|
||||
prefix: new HarmonyMethod(typeof(AASDefaultProfileFix).GetMethod(nameof(OnAttemptLoadAASProfile),
|
||||
BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
}
|
||||
|
||||
// when default profile is selected the defaultProfileName string is empty
|
||||
// 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;
|
||||
}
|
||||
}
|
30
AASDefaultProfileFix/Properties/AssemblyInfo.cs
Normal file
30
AASDefaultProfileFix/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using MelonLoader;
|
||||
using NAK.AASDefaultProfileFix.Properties;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyTitle(nameof(NAK.AASDefaultProfileFix))]
|
||||
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
|
||||
[assembly: AssemblyProduct(nameof(NAK.AASDefaultProfileFix))]
|
||||
|
||||
[assembly: MelonInfo(
|
||||
typeof(NAK.AASDefaultProfileFix.AASDefaultProfileFix),
|
||||
nameof(NAK.AASDefaultProfileFix),
|
||||
AssemblyInfoParams.Version,
|
||||
AssemblyInfoParams.Author,
|
||||
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/AASDefaultProfileFix"
|
||||
)]
|
||||
|
||||
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
|
||||
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
||||
[assembly: HarmonyDontPatchAll]
|
||||
|
||||
namespace NAK.AASDefaultProfileFix.Properties;
|
||||
internal static class AssemblyInfoParams
|
||||
{
|
||||
public const string Version = "1.0.0";
|
||||
public const string Author = "NotAKidoS";
|
||||
}
|
14
AASDefaultProfileFix/README.md
Normal file
14
AASDefaultProfileFix/README.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
# AASDefaultProfileFix
|
||||
|
||||
Fixes the Default AAS profile not being applied when loading into an avatar without a profile selected.
|
||||
|
||||
---
|
||||
|
||||
Here is the block of text where I tell you this mod is not affiliated with or endorsed by ABI.
|
||||
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
|
||||
|
||||
> This mod is an independent creation not affiliated with, supported by, or approved by Alpha Blend Interactive.
|
||||
|
||||
> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use.
|
||||
|
||||
> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive.
|
24
AASDefaultProfileFix/format.json
Normal file
24
AASDefaultProfileFix/format.json
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"_id": -1,
|
||||
"name": "AASDefaultProfileFix",
|
||||
"modversion": "1.0.0",
|
||||
"gameversion": "2024r175",
|
||||
"loaderversion": "0.6.1",
|
||||
"modtype": "Mod",
|
||||
"author": "NotAKidoS",
|
||||
"description": "Fixes the Default AAS profile not being applied when loading into an avatar without a profile selected.\n\nBy default, the game will not apply anything and the avatar will default to the state found within the Controller parameters.",
|
||||
"searchtags": [
|
||||
"aas",
|
||||
"profile",
|
||||
"default",
|
||||
"fix",
|
||||
"meow"
|
||||
],
|
||||
"requirements": [
|
||||
"None"
|
||||
],
|
||||
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r33/AASDefaultProfileFix.dll",
|
||||
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/AASDefaultProfileFix/",
|
||||
"changelog": "- Initial release",
|
||||
"embedcolor": "#1c75f1"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue