From 21b791083b0624b01837ec9cb55b1f8f41e7f67d Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidoS@users.noreply.github.com> Date: Sat, 12 Apr 2025 16:20:22 -0500 Subject: [PATCH] [DoubleTapJumpToExitSeat] bump for release --- DoubleTapJumpToExitSeat/Main.cs | 27 ++++++++------------------- DoubleTapJumpToExitSeat/README.md | 2 +- DoubleTapJumpToExitSeat/format.json | 2 +- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/DoubleTapJumpToExitSeat/Main.cs b/DoubleTapJumpToExitSeat/Main.cs index 91c268e..c3b5a6f 100644 --- a/DoubleTapJumpToExitSeat/Main.cs +++ b/DoubleTapJumpToExitSeat/Main.cs @@ -1,6 +1,5 @@ using System.Reflection; using ABI_RC.Core.InteractionSystem; -using ABI_RC.Core.Savior; using ABI_RC.Systems.InputManagement; using ABI_RC.Systems.Movement; using HarmonyLib; @@ -11,16 +10,6 @@ namespace NAK.DoubleTapJumpToExitSeat; public class DoubleTapJumpToExitSeatMod : MelonMod { - #region Melon Preferences - - public static readonly MelonPreferences_Category Category = - MelonPreferences.CreateCategory(nameof(DoubleTapJumpToExitSeatMod)); - - public static readonly MelonPreferences_Entry 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 public override void OnInitializeMelon() @@ -54,8 +43,8 @@ public class DoubleTapJumpToExitSeatMod : MelonMod #region Harmony Patches - private static float lastJumpTime = -1f; - private static bool wasJumping; + private static float _lastJumpTime = -1f; + private static bool _wasJumping; private static bool OnPreCVRSeatUpdate(CVRSeat __instance) { @@ -63,18 +52,18 @@ public class DoubleTapJumpToExitSeatMod : MelonMod // Crazy? bool jumped = CVRInputManager.Instance.jump; - bool justJumped = jumped && !wasJumping; - wasJumping = jumped; - if (justJumped && (!EntryOnlyInVR.Value || MetaPort.Instance.isUsingVr)) + bool justJumped = jumped && !_wasJumping; + _wasJumping = jumped; + if (justJumped) { float t = Time.time; - if (t - lastJumpTime <= BetterBetterCharacterController.DoubleJumpFlightTimeOut) + if (t - _lastJumpTime <= BetterBetterCharacterController.DoubleJumpFlightTimeOut) { - lastJumpTime = -1f; + _lastJumpTime = -1f; __instance.ExitSeat(); return false; } - lastJumpTime = t; + _lastJumpTime = t; } // Double update this frame (this ensures Extrapolate / Every Frame Updated objects are seated correctly) diff --git a/DoubleTapJumpToExitSeat/README.md b/DoubleTapJumpToExitSeat/README.md index df6f722..c154674 100644 --- a/DoubleTapJumpToExitSeat/README.md +++ b/DoubleTapJumpToExitSeat/README.md @@ -1,6 +1,6 @@ # 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. --- diff --git a/DoubleTapJumpToExitSeat/format.json b/DoubleTapJumpToExitSeat/format.json index b7fa28e..f09cc1f 100644 --- a/DoubleTapJumpToExitSeat/format.json +++ b/DoubleTapJumpToExitSeat/format.json @@ -6,7 +6,7 @@ "loaderversion": "0.6.1", "modtype": "Mod", "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": [ "double", "jump",