FuckToes: fixes for r176

This commit is contained in:
NotAKidoS 2024-09-06 01:08:37 -05:00
parent 16a1a35a91
commit 51f29106c3
3 changed files with 38 additions and 24 deletions

View file

@ -6,46 +6,58 @@ using System.Reflection;
namespace NAK.FuckToes;
public class FuckToes : MelonMod
public class FuckToesMod : MelonMod
{
internal static MelonLogger.Instance Logger;
private static MelonLogger.Instance Logger;
public static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(FuckToes));
#region Melon Preferences
public static readonly MelonPreferences_Entry<bool> EntryEnabledVR =
private static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(FuckToesMod));
private static readonly MelonPreferences_Entry<bool> EntryEnabledVR =
Category.CreateEntry("Enabled in HalfBody", true, description: "Nuke VRIK toes when in Halfbody.");
public static readonly MelonPreferences_Entry<bool> EntryEnabledFBT =
private static readonly MelonPreferences_Entry<bool> EntryEnabledFBT =
Category.CreateEntry("Enabled in FBT", true, description: "Nuke VRIK toes when in FBT.");
#endregion Melon Preferences
#region Melon Events
public override void OnInitializeMelon()
{
Logger = LoggerInstance;
HarmonyInstance.Patch(
typeof(VRIK).GetMethod(nameof(VRIK.AutoDetectReferences)),
prefix: new HarmonyLib.HarmonyMethod(typeof(FuckToes).GetMethod(nameof(OnVRIKAutoDetectReferences_Prefix), BindingFlags.NonPublic | BindingFlags.Static))
prefix: new HarmonyLib.HarmonyMethod(typeof(FuckToesMod).GetMethod(nameof(OnVRIKAutoDetectReferences_Prefix), BindingFlags.NonPublic | BindingFlags.Static))
);
}
#endregion Melon Events
#region Harmony Patches
private static void OnVRIKAutoDetectReferences_Prefix(ref VRIK __instance)
{
try
{
// Must be PlayerLocal layer and in VR
if (__instance.gameObject.layer != 8 || !MetaPort.Instance.isUsingVr)
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;
switch (IKSystem.Instance.BodySystem.FullBodyActive)
{
case false when !EntryEnabledVR.Value: // Not in FBT, and not enabled, perish
case true when !EntryEnabledFBT.Value: // In FBT, and not enabled in fbt, perish
return;
default:
__instance.references.leftToes = null;
__instance.references.rightToes = null;
break;
}
}
catch (Exception e)
{
@ -53,4 +65,6 @@ public class FuckToes : MelonMod
Logger.Error(e);
}
}
#endregion Harmony Patches
}

View file

@ -10,7 +10,7 @@ using System.Reflection;
[assembly: AssemblyProduct(nameof(NAK.FuckToes))]
[assembly: MelonInfo(
typeof(NAK.FuckToes.FuckToes),
typeof(NAK.FuckToes.FuckToesMod),
nameof(NAK.FuckToes),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
@ -20,13 +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, 255, 200, 0)]
[assembly: MelonAuthorColor(255, 158, 21, 32)]
[assembly: MelonColor(255, 246, 25, 99)] // red-pink
[assembly: MelonAuthorColor(255, 158, 21, 32)] // red
[assembly: HarmonyDontPatchAll]
namespace NAK.FuckToes.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.2";
public const string Version = "1.0.3";
public const string Author = "NotAKidoS";
}

View file

@ -1,7 +1,7 @@
{
"_id": 129,
"name": "FuckToes",
"modversion": "1.0.2",
"modversion": "1.0.3",
"gameversion": "2023r171",
"loaderversion": "0.6.1",
"modtype": "Mod",
@ -19,5 +19,5 @@
"downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r14/FuckToes.dll",
"sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/FuckToes/",
"changelog": "- Fixes for 2023r171.",
"embedcolor": "#ffc800"
"embedcolor": "#f61963"
}