Skip to content

Commit

Permalink
Add compatibility with BONELAB Patch 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Evanaellio committed Aug 7, 2023
1 parent 727673f commit 91488e1
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions HyperJump/BonelabUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public class BonelabUtils : IBoneUtils
public ControllerRig ControllerRig => Player.controllerRig;
public PhysGrounder PhysGrounder => Player.physicsRig.physG;

public MethodInfo GetControllerRigMethod(string methodName)
public MethodInfo GetJumpChargeMethod()
{
return typeof(ControllerRig).GetMethod(methodName);
return typeof(RemapRig).GetMethod("JumpCharge");
}

public Vector3 GetPelvisVelocity()
Expand Down
4 changes: 2 additions & 2 deletions HyperJump/BoneworksUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public class BoneworksUtils : IBoneUtils
public ControllerRig ControllerRig => UnityObject.FindObjectOfType<ControllerRig>();
public PhysGrounder PhysGrounder => UnityObject.FindObjectOfType<PhysGrounder>();

public MethodInfo GetControllerRigMethod(string methodName)
public MethodInfo GetJumpChargeMethod()
{
return typeof(ControllerRig).GetMethod(methodName);
return typeof(ControllerRig).GetMethod("JumpCharge");
}

public Vector3 GetPelvisVelocity()
Expand Down
5 changes: 2 additions & 3 deletions HyperJump/HyperJump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ public static class BuildInfo
public const string Name = "Hyper Jump";
public const string Author = "Evanaellio";
public const string Company = null;
public const string Version = "3.0.0";
public const string Version = "3.1.0";
public const string DownloadLink = "https://bonelab.thunderstore.io/package/Evanaellio/HyperJump/";
}

public class HyperJump : MelonMod
{
private const string HyperJumpCategory = nameof(HyperJump);
private const string CustomProfileCategory = "HyperJumpCustomProfile";

private static readonly string[] CustomProfileCategories =
{
Expand Down Expand Up @@ -145,7 +144,7 @@ public override void OnInitializeMelon()
BoneUtils.SetupMenu(profileSetting, customProfileSettings);

HarmonyMethod jumpChargePostfix = new HarmonyMethod(typeof(HyperJump).GetMethod(nameof(JumpChargePostfix)));
MethodInfo jumpChargeMethod = BoneUtils.GetControllerRigMethod("JumpCharge");
MethodInfo jumpChargeMethod = BoneUtils.GetJumpChargeMethod();
HarmonyInstance.Patch(jumpChargeMethod, null, jumpChargePostfix);
}

Expand Down
2 changes: 1 addition & 1 deletion HyperJump/IBoneUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class CustomProfileSetting

public interface IBoneUtils
{
MethodInfo GetControllerRigMethod(string methodName);
MethodInfo GetJumpChargeMethod();
Vector3 GetPelvisVelocity();
Vector3 GetHeadDirection();
void ApplyForceToPelvis(Vector3 force, ForceMode velocityChange);
Expand Down
5 changes: 4 additions & 1 deletion HyperJump/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@
// If no MelonModGameAttribute is found or any of the Values for any MelonModGame on the Mod is null or empty it will be assumed the Mod is Universal.
// Values for MelonModGame can be found in the Game's app.info file or printed at the top of every log directly beneath the Unity version.
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: MelonGame("Stress Level Zero", "BONEWORKS")]
[assembly: MelonGame("Stress Level Zero", "BONEWORKS")]

// Mark as optional so that MelonLoader doesn't complain but ModThatIsNotMod is required for BONEWORKS and BoneLib is required for BONELAB
[assembly: MelonOptionalDependencies("ModThatIsNotMod", "BoneLib")]
6 changes: 6 additions & 0 deletions ThunderstorePackage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Jump higher and leap further.

To install the mod, copy the Mods folder inside the zip into your BONEWORKS or BONELAB directory.

⚠ Use versions 3.0.x for BONELAB Patch 2 and versions 3.1.x for BONELAB Patch 3, and any of versions 3.x for BONEWORKS

Hyper jumps and leaps are best used in exterior environments (unless you like fracturing your skull on the ceiling or smashing your face against a wall).

Hyper leaps only apply when walking/running, and will propel you towards where you are looking.
Expand All @@ -29,6 +31,10 @@ ActiveProfile can take the following values :

## Changelogs

#### v3.1.0

- Add compatibility with BONELAB Patch 3

#### v3.0.1

- Fix dependency to BoneLib for compatibility with Patch 2
Expand Down
4 changes: 2 additions & 2 deletions ThunderstorePackage/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "HyperJump",
"version_number": "3.0.1",
"version_number": "3.1.0",
"description": "Jump higher and leap further",
"website_url": "https://github.com/Evanaellio/HyperJump",
"dependencies": ["gnonme-ModThatIsNotMod-0.3.6", "gnonme-BoneLib-2.2.0"]
"dependencies": ["LavaGang-MelonLoader-0.5.7", "gnonme-ModThatIsNotMod-0.3.6", "gnonme-BoneLib-2.2.1"]
}

0 comments on commit 91488e1

Please sign in to comment.