[DoubleTapJumpToExitSeat] bump for release

This commit is contained in:
NotAKidoS 2025-04-12 16:20:22 -05:00
parent 8ad74b5ef6
commit 21b791083b
3 changed files with 10 additions and 21 deletions

View file

@ -1,6 +1,5 @@
using System.Reflection; using System.Reflection;
using ABI_RC.Core.InteractionSystem; using ABI_RC.Core.InteractionSystem;
using ABI_RC.Core.Savior;
using ABI_RC.Systems.InputManagement; using ABI_RC.Systems.InputManagement;
using ABI_RC.Systems.Movement; using ABI_RC.Systems.Movement;
using HarmonyLib; using HarmonyLib;
@ -11,16 +10,6 @@ namespace NAK.DoubleTapJumpToExitSeat;
public class DoubleTapJumpToExitSeatMod : MelonMod public class DoubleTapJumpToExitSeatMod : MelonMod
{ {
#region Melon Preferences
public static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(DoubleTapJumpToExitSeatMod));
public static readonly MelonPreferences_Entry<bool> EntryOnlyInVR =
Category.CreateEntry("only_in_vr", false, display_name: "Only In VR", description: "Should this behaviour only be active in VR?");
#endregion Melon Preferences
#region Melon Events #region Melon Events
public override void OnInitializeMelon() public override void OnInitializeMelon()
@ -54,8 +43,8 @@ public class DoubleTapJumpToExitSeatMod : MelonMod
#region Harmony Patches #region Harmony Patches
private static float lastJumpTime = -1f; private static float _lastJumpTime = -1f;
private static bool wasJumping; private static bool _wasJumping;
private static bool OnPreCVRSeatUpdate(CVRSeat __instance) private static bool OnPreCVRSeatUpdate(CVRSeat __instance)
{ {
@ -63,18 +52,18 @@ public class DoubleTapJumpToExitSeatMod : MelonMod
// Crazy? // Crazy?
bool jumped = CVRInputManager.Instance.jump; bool jumped = CVRInputManager.Instance.jump;
bool justJumped = jumped && !wasJumping; bool justJumped = jumped && !_wasJumping;
wasJumping = jumped; _wasJumping = jumped;
if (justJumped && (!EntryOnlyInVR.Value || MetaPort.Instance.isUsingVr)) if (justJumped)
{ {
float t = Time.time; float t = Time.time;
if (t - lastJumpTime <= BetterBetterCharacterController.DoubleJumpFlightTimeOut) if (t - _lastJumpTime <= BetterBetterCharacterController.DoubleJumpFlightTimeOut)
{ {
lastJumpTime = -1f; _lastJumpTime = -1f;
__instance.ExitSeat(); __instance.ExitSeat();
return false; return false;
} }
lastJumpTime = t; _lastJumpTime = t;
} }
// Double update this frame (this ensures Extrapolate / Every Frame Updated objects are seated correctly) // Double update this frame (this ensures Extrapolate / Every Frame Updated objects are seated correctly)

View file

@ -1,6 +1,6 @@
# DoubleTapJumpToExitSeat # DoubleTapJumpToExitSeat
Literally the mod name. Replaces seat exit controls with a double-tap of the jump button, avoiding accidental exits from joystick drift or opening the menu.
--- ---

View file

@ -6,7 +6,7 @@
"loaderversion": "0.6.1", "loaderversion": "0.6.1",
"modtype": "Mod", "modtype": "Mod",
"author": "NotAKidoS", "author": "NotAKidoS",
"description": "Literally the mod name.", "description": "Replaces seat exit controls with a double-tap of the jump button, avoiding accidental exits from joystick drift or opening the menu.",
"searchtags": [ "searchtags": [
"double", "double",
"jump", "jump",