mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
[FuckToes] Update for 2023r171
Fixed a few setting issues too.
This commit is contained in:
parent
ba4bb02a6d
commit
e61f119f32
4 changed files with 45 additions and 47 deletions
|
@ -1,25 +0,0 @@
|
||||||
using ABI_RC.Core.Savior;
|
|
||||||
using HarmonyLib;
|
|
||||||
using RootMotion.FinalIK;
|
|
||||||
|
|
||||||
|
|
||||||
namespace NAK.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 (FuckToes.EntryEnabledVR.Value && MetaPort.Instance.isUsingVr)
|
|
||||||
{
|
|
||||||
if (!FuckToes.EntryEnabledFBT.Value && MetaPort.Instance.isUsingFullbody) return;
|
|
||||||
__instance.references.leftToes = null;
|
|
||||||
__instance.references.rightToes = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,34 +1,56 @@
|
||||||
using MelonLoader;
|
using ABI_RC.Core.Savior;
|
||||||
|
using ABI_RC.Systems.IK;
|
||||||
|
using MelonLoader;
|
||||||
|
using RootMotion.FinalIK;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace NAK.FuckToes;
|
namespace NAK.FuckToes;
|
||||||
|
|
||||||
public class FuckToes : MelonMod
|
public class FuckToes : MelonMod
|
||||||
{
|
{
|
||||||
|
internal static MelonLogger.Instance Logger;
|
||||||
|
|
||||||
public static readonly MelonPreferences_Category Category =
|
public static readonly MelonPreferences_Category Category =
|
||||||
MelonPreferences.CreateCategory(nameof(FuckToes));
|
MelonPreferences.CreateCategory(nameof(FuckToes));
|
||||||
|
|
||||||
public static readonly MelonPreferences_Entry<bool> EntryEnabledVR =
|
public static readonly MelonPreferences_Entry<bool> EntryEnabledVR =
|
||||||
Category.CreateEntry("Enabled", true, description: "Nuke VRIK toes when in Halfbody.");
|
Category.CreateEntry("Enabled in HalfBody", true, description: "Nuke VRIK toes when in Halfbody.");
|
||||||
|
|
||||||
public static readonly MelonPreferences_Entry<bool> EntryEnabledFBT =
|
public static readonly MelonPreferences_Entry<bool> EntryEnabledFBT =
|
||||||
Category.CreateEntry("Enabled in FBT", false, description: "Nuke VRIK toes when in FBT.");
|
Category.CreateEntry("Enabled in FBT", true, description: "Nuke VRIK toes when in FBT.");
|
||||||
|
|
||||||
public override void OnInitializeMelon()
|
public override void OnInitializeMelon()
|
||||||
{
|
{
|
||||||
//Apply patches (i stole)
|
Logger = LoggerInstance;
|
||||||
ApplyPatches(typeof(HarmonyPatches.VRIKPatches));
|
HarmonyInstance.Patch(
|
||||||
|
typeof(VRIK).GetMethod(nameof(VRIK.AutoDetectReferences)),
|
||||||
|
prefix: new HarmonyLib.HarmonyMethod(typeof(FuckToes).GetMethod(nameof(OnVRIKAutoDetectReferences_Prefix), BindingFlags.NonPublic | BindingFlags.Static))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ApplyPatches(Type type)
|
private static void OnVRIKAutoDetectReferences_Prefix(ref VRIK __instance)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
HarmonyInstance.PatchAll(type);
|
// Must be PlayerLocal layer and in VR
|
||||||
|
if (__instance.gameObject.layer != 8 || !MetaPort.Instance.isUsingVr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Not in FBT, and not enabled, perish
|
||||||
|
if (!IKSystem.Instance.BodySystem.FBTActive() && !EntryEnabledVR.Value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// In FBT, and not enabled in fbt, perish
|
||||||
|
if (IKSystem.Instance.BodySystem.FBTActive() && !EntryEnabledFBT.Value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
__instance.references.leftToes = null;
|
||||||
|
__instance.references.rightToes = null;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LoggerInstance.Msg($"Failed while patching {type.Name}!");
|
Logger.Error($"Error during the patched method {nameof(OnVRIKAutoDetectReferences_Prefix)}");
|
||||||
LoggerInstance.Error(e);
|
Logger.Error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
using FuckToes.Properties;
|
using NAK.FuckToes.Properties;
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
|
@ -20,12 +20,13 @@ using System.Reflection;
|
||||||
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
|
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
|
||||||
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||||
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
||||||
[assembly: MelonOptionalDependencies("BTKUILib")]
|
[assembly: MelonColor(255, 255, 200, 0)]
|
||||||
|
[assembly: MelonAuthorColor(255, 158, 21, 32)]
|
||||||
[assembly: HarmonyDontPatchAll]
|
[assembly: HarmonyDontPatchAll]
|
||||||
|
|
||||||
namespace FuckToes.Properties;
|
namespace NAK.FuckToes.Properties;
|
||||||
internal static class AssemblyInfoParams
|
internal static class AssemblyInfoParams
|
||||||
{
|
{
|
||||||
public const string Version = "1.0.1";
|
public const string Version = "1.0.2";
|
||||||
public const string Author = "NotAKidoS";
|
public const string Author = "NotAKidoS";
|
||||||
}
|
}
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"_id": 129,
|
"_id": 129,
|
||||||
"name": "FuckToes",
|
"name": "FuckToes",
|
||||||
"modversion": "1.0.1",
|
"modversion": "1.0.2",
|
||||||
"gameversion": "2022r170p1",
|
"gameversion": "2023r171",
|
||||||
"loaderversion": "0.6.1",
|
"loaderversion": "0.6.1",
|
||||||
"modtype": "Mod",
|
"modtype": "Mod",
|
||||||
"author": "NotAKidoS",
|
"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.",
|
"description": "Prevents VRIK from using toe bones in HalfBody or 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": [
|
"searchtags": [
|
||||||
"toes",
|
"toes",
|
||||||
"vrik",
|
"vrik",
|
||||||
|
@ -16,8 +16,8 @@
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"None"
|
"None"
|
||||||
],
|
],
|
||||||
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/FuckToes.dll",
|
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r14/FuckToes.dll",
|
||||||
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/FuckToes/",
|
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/FuckToes/",
|
||||||
"changelog": "- Initial Release\n- No double patching. Bad. Stinky. Dont do it.",
|
"changelog": "- Fixes for 2023r171.",
|
||||||
"embedcolor": "#ffc700"
|
"embedcolor": "#ffc800"
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue