diff --git a/FuckToes/FuckToes.cs b/FuckToes/FuckToes.cs new file mode 100644 index 0000000..d960d3c --- /dev/null +++ b/FuckToes/FuckToes.cs @@ -0,0 +1,25 @@ +using ABI_RC.Core.Savior; +using HarmonyLib; +using RootMotion.FinalIK; + + +namespace NAK.Melons.FuckToes.HarmonyPatches; + +//yes im patching VRIK directly, cvr does not force calibration or mess with references, and leaves it to vrik to handle +class VRIKPatches +{ + [HarmonyPostfix] + [HarmonyPatch(typeof(VRIK), "AutoDetectReferences")] + private static void Postfix_VRIK_AutoDetectReferences(ref VRIK __instance) + { + //only run for PlayerLocal VRIK + if (__instance.gameObject.layer != 8) return; + + if (FuckToesMod.m_entryEnabledVR.Value && MetaPort.Instance.isUsingVr) + { + if (!FuckToesMod.m_entryEnabledFBT.Value && MetaPort.Instance.isUsingFullbody) return; + __instance.references.leftToes = null; + __instance.references.rightToes = null; + } + } +} \ No newline at end of file diff --git a/FuckToes/FuckToes.csproj b/FuckToes/FuckToes.csproj new file mode 100644 index 0000000..b7fe17e --- /dev/null +++ b/FuckToes/FuckToes.csproj @@ -0,0 +1,37 @@ + + + + + net472 + enable + latest + false + + + + + C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\MelonLoader\0Harmony.dll + + + C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Assembly-CSharp.dll + + + C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Assembly-CSharp-firstpass.dll + + + C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\MelonLoader\MelonLoader.dll + + + C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.CoreModule.dll + + + C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.InputLegacyModule.dll + + + + + + + + + diff --git a/FuckToes/FuckToes.sln b/FuckToes/FuckToes.sln new file mode 100644 index 0000000..4fb6ac2 --- /dev/null +++ b/FuckToes/FuckToes.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32630.192 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FuckToes", "FuckToes.csproj", "{7A4864FE-17AD-4D6D-B2CD-4111C05754D8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7A4864FE-17AD-4D6D-B2CD-4111C05754D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A4864FE-17AD-4D6D-B2CD-4111C05754D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A4864FE-17AD-4D6D-B2CD-4111C05754D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A4864FE-17AD-4D6D-B2CD-4111C05754D8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C0D6DAF4-5963-47A0-8D33-5E0E22061DAF} + EndGlobalSection +EndGlobal diff --git a/FuckToes/Main.cs b/FuckToes/Main.cs new file mode 100644 index 0000000..2c7a6f3 --- /dev/null +++ b/FuckToes/Main.cs @@ -0,0 +1,32 @@ +using MelonLoader; + +namespace NAK.Melons.FuckToes; + +public class FuckToesMod : MelonMod +{ + internal const string SettingsCategory = "FuckToes"; + internal static MelonPreferences_Category m_categoryFuckToes; + internal static MelonPreferences_Entry m_entryEnabledVR, m_entryEnabledFBT; + public override void OnInitializeMelon() + { + m_categoryFuckToes = MelonPreferences.CreateCategory(SettingsCategory); + m_entryEnabledVR = m_categoryFuckToes.CreateEntry("Enabled", true, description: "Nuke VRIK toes when in Halfbody."); + m_entryEnabledFBT = m_categoryFuckToes.CreateEntry("Enabled in FBT", false, description: "Nuke VRIK toes when in FBT."); + + //Apply patches (i stole) + ApplyPatches(typeof(HarmonyPatches.VRIKPatches)); + } + + private void ApplyPatches(Type type) + { + try + { + HarmonyInstance.PatchAll(type); + } + catch (Exception e) + { + LoggerInstance.Msg($"Failed while patching {type.Name}!"); + LoggerInstance.Error(e); + } + } +} \ No newline at end of file diff --git a/FuckToes/Properties/AssemblyInfo.cs b/FuckToes/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..974265c --- /dev/null +++ b/FuckToes/Properties/AssemblyInfo.cs @@ -0,0 +1,32 @@ +using FuckToes.Properties; +using MelonLoader; +using System.Reflection; + + +[assembly: AssemblyVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyTitle(nameof(NAK.Melons.FuckToes))] +[assembly: AssemblyCompany(AssemblyInfoParams.Author)] +[assembly: AssemblyProduct(nameof(NAK.Melons.FuckToes))] + +[assembly: MelonInfo( + typeof(NAK.Melons.FuckToes.FuckToesMod), + nameof(NAK.Melons.FuckToes), + AssemblyInfoParams.Version, + AssemblyInfoParams.Author, + downloadLink: "https://github.com/NotAKidOnSteam/FuckToes" +)] + +[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] +[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] +[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)] +[assembly: MelonOptionalDependencies("BTKUILib")] +[assembly: HarmonyDontPatchAll] + +namespace FuckToes.Properties; +internal static class AssemblyInfoParams +{ + public const string Version = "1.0.1"; + public const string Author = "NotAKidoS"; +} \ No newline at end of file diff --git a/FuckToes/format.json b/FuckToes/format.json new file mode 100644 index 0000000..3d0f8e0 --- /dev/null +++ b/FuckToes/format.json @@ -0,0 +1,23 @@ +{ + "_id": 129, + "name": "FuckToes", + "modversion": "1.0.1", + "gameversion": "2022r170", + "loaderversion": "0.5.7", + "modtype": "Mod", + "author": "NotAKidoS", + "description": "Prevents VRIK from using toe bones in VR & optionaly FBT.\n\nVRIK calculates weird center of mass when toes are mapped, so it is sometimes desired to unmap toes to prevent an avatars feet from resting far back.\n\nPlease see the README for relevant imagery detailing the problem.", + "searchtags": [ + "toes", + "vrik", + "ik", + "feet" + ], + "requirements": [ + "None" + ], + "downloadlink": "https://github.com/NotAKidOnSteam/FuckToes/releases/download/v1.0.1/FuckToes.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/FuckToes/", + "changelog": "- Initial Release\n- No double patching. Bad. Stinky. Dont do it.", + "embedcolor": "#ffc700" +} \ No newline at end of file diff --git a/README.md b/README.md index 1d3c32e..8fcccae 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,12 @@ While this mod is not directly fixing the performance hit while unmuted, it is l ## Relevant Feedback Posts: https://feedback.abinteractive.net/p/fps-drop-while-unmuted +# FuckToes +Prevents VRIK from autodetecting toes in HalfbodyIK. + +Optionally can be applied in FBT, but toes in FBT are nice so you are a monster if so. + +![fuckthetoes](https://user-images.githubusercontent.com/37721153/216518012-ae3b1dde-17ea-419a-a875-48d57e13f3dd.png) --- @@ -129,8 +135,4 @@ https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games > 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. -<<<<<<< HEAD -======= - ->>>>>>> FuckMetrics/main +> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive. \ No newline at end of file