From e77959a8a946efef4e8f79080a3a801c4d602aa0 Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidoS@users.noreply.github.com> Date: Wed, 3 Jul 2024 00:13:17 -0500 Subject: [PATCH] HeadLookLockingInputFix: Initial release --- .../HeadLookLockingInputFix.csproj | 6 ++++ HeadLookLockingInputFix/Main.cs | 23 +++++++++++++ .../Properties/AssemblyInfo.cs | 32 +++++++++++++++++++ HeadLookLockingInputFix/README.md | 14 ++++++++ HeadLookLockingInputFix/format.json | 24 ++++++++++++++ 5 files changed, 99 insertions(+) create mode 100644 HeadLookLockingInputFix/HeadLookLockingInputFix.csproj create mode 100644 HeadLookLockingInputFix/Main.cs create mode 100644 HeadLookLockingInputFix/Properties/AssemblyInfo.cs create mode 100644 HeadLookLockingInputFix/README.md create mode 100644 HeadLookLockingInputFix/format.json diff --git a/HeadLookLockingInputFix/HeadLookLockingInputFix.csproj b/HeadLookLockingInputFix/HeadLookLockingInputFix.csproj new file mode 100644 index 0000000..bec5b03 --- /dev/null +++ b/HeadLookLockingInputFix/HeadLookLockingInputFix.csproj @@ -0,0 +1,6 @@ + + + + LoadedObjectHack + + diff --git a/HeadLookLockingInputFix/Main.cs b/HeadLookLockingInputFix/Main.cs new file mode 100644 index 0000000..8e8e2bd --- /dev/null +++ b/HeadLookLockingInputFix/Main.cs @@ -0,0 +1,23 @@ +using System.Reflection; +using ABI_RC.Core.Player; +using ABI_RC.Core.Savior; +using HarmonyLib; +using MelonLoader; + +namespace NAK.HeadLookLockingInputFix; + +public class HeadLookLockingInputFixMod : MelonMod +{ + public override void OnInitializeMelon() + { + HarmonyInstance.Patch( + typeof(InputManager).GetMethod(nameof(InputManager.HandleMenuHeadLook), + BindingFlags.NonPublic | BindingFlags.Instance), + prefix: new HarmonyMethod(typeof(HeadLookLockingInputFixMod).GetMethod(nameof(OnPreHandleMenuHeadLook), + BindingFlags.NonPublic | BindingFlags.Static)) + ); + } + + private static bool OnPreHandleMenuHeadLook() + => !MetaPort.Instance.isUsingVr; // only execute in Desktop +} \ No newline at end of file diff --git a/HeadLookLockingInputFix/Properties/AssemblyInfo.cs b/HeadLookLockingInputFix/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7ade330 --- /dev/null +++ b/HeadLookLockingInputFix/Properties/AssemblyInfo.cs @@ -0,0 +1,32 @@ +using MelonLoader; +using NAK.HeadLookLockingInputFix.Properties; +using System.Reflection; + +[assembly: AssemblyVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyTitle(nameof(NAK.HeadLookLockingInputFix))] +[assembly: AssemblyCompany(AssemblyInfoParams.Author)] +[assembly: AssemblyProduct(nameof(NAK.HeadLookLockingInputFix))] + +[assembly: MelonInfo( + typeof(NAK.HeadLookLockingInputFix.HeadLookLockingInputFixMod), + nameof(NAK.HeadLookLockingInputFix), + AssemblyInfoParams.Version, + AssemblyInfoParams.Author, + downloadLink: "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/HeadLookLockingInputFix" +)] + +[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] +[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] +[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)] +[assembly: MelonColor(255, 125, 126, 129)] +[assembly: MelonAuthorColor(255, 158, 21, 32)] +[assembly: HarmonyDontPatchAll] + +namespace NAK.HeadLookLockingInputFix.Properties; +internal static class AssemblyInfoParams +{ + public const string Version = "1.0.0"; + public const string Author = "NotAKidoS"; +} \ No newline at end of file diff --git a/HeadLookLockingInputFix/README.md b/HeadLookLockingInputFix/README.md new file mode 100644 index 0000000..8a46af2 --- /dev/null +++ b/HeadLookLockingInputFix/README.md @@ -0,0 +1,14 @@ +# IKSimulatedRootAngleFix + +Fixes a small issue with Desktop & HalfBody root angle being incorrectly calculated while on rotating Movement Parents. If you've ever noticed your body/feet insisting on facing opposite of the direction you are rotating, this fixes that. + +--- + +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. diff --git a/HeadLookLockingInputFix/format.json b/HeadLookLockingInputFix/format.json new file mode 100644 index 0000000..cd1c36b --- /dev/null +++ b/HeadLookLockingInputFix/format.json @@ -0,0 +1,24 @@ +{ + "_id": -1, + "name": "HeadLookLockingInputFix", + "modversion": "1.0.0", + "gameversion": "2024r175", + "loaderversion": "0.6.1", + "modtype": "Mod", + "author": "NotAKidoS", + "description": "Fixes a bug where pressing the head look locking key (ALT) while in VR with the game window focused would disable input and soft-lock you.", + "searchtags": [ + "input", + "locked", + "vr", + "fix", + "meow" + ], + "requirements": [ + "None" + ], + "downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r34/HeadLookLockingInputFix.dll", + "sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/HeadLookLockingInputFix/", + "changelog": "- Initial release", + "embedcolor": "#f61963" +} \ No newline at end of file