diff --git a/JumpPatch/HarmonyPatches.cs b/JumpPatch/HarmonyPatches.cs new file mode 100644 index 0000000..747b2c3 --- /dev/null +++ b/JumpPatch/HarmonyPatches.cs @@ -0,0 +1,15 @@ +using ABI_RC.Core.Savior; +using ABI_RC.Systems.MovementSystem; +using HarmonyLib; + +namespace NAK.Melons.JumpPatch.HarmonyPatches; + +class MovementSystemPatches +{ + [HarmonyPrefix] + [HarmonyPatch(typeof(MovementSystem), "Update")] + private static void Prefix_MovementSystem_Update(ref bool ____isGrounded) + { + CVRInputManager.Instance.jump = CVRInputManager.Instance.jump && ____isGrounded; + } +} \ No newline at end of file diff --git a/JumpPatch/JumpPatch.csproj b/JumpPatch/JumpPatch.csproj new file mode 100644 index 0000000..b7fe17e --- /dev/null +++ b/JumpPatch/JumpPatch.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/JumpPatch/JumpPatch.sln b/JumpPatch/JumpPatch.sln new file mode 100644 index 0000000..1968644 --- /dev/null +++ b/JumpPatch/JumpPatch.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}") = "JumpPatch", "JumpPatch.csproj", "{E205C609-750F-4EF6-9180-09907A3D5EFA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E205C609-750F-4EF6-9180-09907A3D5EFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E205C609-750F-4EF6-9180-09907A3D5EFA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E205C609-750F-4EF6-9180-09907A3D5EFA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E205C609-750F-4EF6-9180-09907A3D5EFA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {75945C3C-368D-4A04-8EB7-F254473A946F} + EndGlobalSection +EndGlobal diff --git a/JumpPatch/Main.cs b/JumpPatch/Main.cs new file mode 100644 index 0000000..dd5534b --- /dev/null +++ b/JumpPatch/Main.cs @@ -0,0 +1,24 @@ +using MelonLoader; + +namespace NAK.Melons.JumpPatch; + +public class JumpPatchMod : MelonMod +{ + public override void OnInitializeMelon() + { + ApplyPatches(typeof(HarmonyPatches.MovementSystemPatches)); + } + + 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/JumpPatch/Properties/AssemblyInfo.cs b/JumpPatch/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..2a5f6f0 --- /dev/null +++ b/JumpPatch/Properties/AssemblyInfo.cs @@ -0,0 +1,30 @@ +using MelonLoader; +using NAK.Melons.JumpPatch.Properties; +using System.Reflection; + +[assembly: AssemblyVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyTitle(nameof(NAK.Melons.JumpPatch))] +[assembly: AssemblyCompany(AssemblyInfoParams.Author)] +[assembly: AssemblyProduct(nameof(NAK.Melons.JumpPatch))] + +[assembly: MelonInfo( + typeof(NAK.Melons.JumpPatch.JumpPatchMod), + nameof(NAK.Melons.JumpPatch), + AssemblyInfoParams.Version, + AssemblyInfoParams.Author, + downloadLink: "https://github.com/NotAKidOnSteam/JumpPatch" +)] + +[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] +[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] +[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)] +[assembly: HarmonyDontPatchAll] + +namespace NAK.Melons.JumpPatch.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/JumpPatch/format.json b/JumpPatch/format.json new file mode 100644 index 0000000..bedd17d --- /dev/null +++ b/JumpPatch/format.json @@ -0,0 +1,23 @@ +{ + "_id": -1, + "name": "JumpPatch", + "modversion": "1.0.0", + "gameversion": "2022r170", + "loaderversion": "0.5.7", + "modtype": "Mod", + "author": "NotAKidoS", + "description": "Prevents you from jumping until you've been grounded for a frame.\nThis ensures Grounded parameter fires when hitting the ground while holding jump.", + "searchtags": [ + "toes", + "vrik", + "ik", + "feet" + ], + "requirements": [ + "None" + ], + "downloadlink": "https://github.com/NotAKidOnSteam/JumpPatch/releases/download/v1.0.0/JumpPatch.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/JumpPatch/", + "changelog": "- Initial Release\n- I like my jump animations.", + "embedcolor": "#e56597" +} \ No newline at end of file