diff --git a/DoubleTapJumpToExitSeat/Main.cs b/DoubleTapJumpToExitSeat/Main.cs index c3b5a6f..91c268e 100644 --- a/DoubleTapJumpToExitSeat/Main.cs +++ b/DoubleTapJumpToExitSeat/Main.cs @@ -1,5 +1,6 @@ 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; @@ -10,6 +11,16 @@ 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() @@ -43,8 +54,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) { @@ -52,18 +63,18 @@ public class DoubleTapJumpToExitSeatMod : MelonMod // Crazy? bool jumped = CVRInputManager.Instance.jump; - bool justJumped = jumped && !_wasJumping; - _wasJumping = jumped; - if (justJumped) + bool justJumped = jumped && !wasJumping; + wasJumping = jumped; + if (justJumped && (!EntryOnlyInVR.Value || MetaPort.Instance.isUsingVr)) { 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 c154674..df6f722 100644 --- a/DoubleTapJumpToExitSeat/README.md +++ b/DoubleTapJumpToExitSeat/README.md @@ -1,6 +1,6 @@ # DoubleTapJumpToExitSeat -Replaces seat exit controls with a double-tap of the jump button, avoiding accidental exits from joystick drift or opening the menu. +Literally the mod name. --- diff --git a/DoubleTapJumpToExitSeat/format.json b/DoubleTapJumpToExitSeat/format.json index ab8e14e..b7fa28e 100644 --- a/DoubleTapJumpToExitSeat/format.json +++ b/DoubleTapJumpToExitSeat/format.json @@ -6,7 +6,7 @@ "loaderversion": "0.6.1", "modtype": "Mod", "author": "NotAKidoS", - "description": "Replaces seat exit controls with a double-tap of the jump button, avoiding accidental exits from joystick drift or opening the menu.", + "description": "Literally the mod name.", "searchtags": [ "double", "jump", @@ -18,6 +18,6 @@ ], "downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r46/DoubleTapJumpToExitSeat.dll", "sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/DoubleTapJumpToExitSeat/", - "changelog": "- Initial release", - "embedcolor": "#f61963" + "changelog": "- Initial Release", + "embedcolor": "#00FFFF" } \ No newline at end of file diff --git a/FuckToes/Main.cs b/FuckToes/Main.cs index 7fc6892..7e6a936 100644 --- a/FuckToes/Main.cs +++ b/FuckToes/Main.cs @@ -3,22 +3,23 @@ using ABI_RC.Systems.IK; using MelonLoader; using RootMotion.FinalIK; using System.Reflection; -using ABI_RC.Core; namespace NAK.FuckToes; public class FuckToesMod : MelonMod { + private static MelonLogger.Instance Logger; + #region Melon Preferences private static readonly MelonPreferences_Category Category = - MelonPreferences.CreateCategory(nameof(FuckToes)); + MelonPreferences.CreateCategory(nameof(FuckToesMod)); private static readonly MelonPreferences_Entry EntryEnabledVR = - Category.CreateEntry("use_in_halfbody", true, display_name:"No Toes in Halfbody", description: "Nuke VRIK toes when in Halfbody."); + Category.CreateEntry("Enabled in HalfBody", true, description: "Nuke VRIK toes when in Halfbody."); private static readonly MelonPreferences_Entry EntryEnabledFBT = - Category.CreateEntry("use_in_fbt", true, display_name:"No Toes in Fullbody", description: "Nuke VRIK toes when in FBT."); + Category.CreateEntry("Enabled in FBT", true, description: "Nuke VRIK toes when in FBT."); #endregion Melon Preferences @@ -26,10 +27,10 @@ public class FuckToesMod : MelonMod public override void OnInitializeMelon() { + Logger = LoggerInstance; HarmonyInstance.Patch( typeof(VRIK).GetMethod(nameof(VRIK.AutoDetectReferences)), - prefix: new HarmonyLib.HarmonyMethod(typeof(FuckToesMod).GetMethod(nameof(OnVRIKAutoDetectReferences_Prefix), - BindingFlags.NonPublic | BindingFlags.Static)) + prefix: new HarmonyLib.HarmonyMethod(typeof(FuckToesMod).GetMethod(nameof(OnVRIKAutoDetectReferences_Prefix), BindingFlags.NonPublic | BindingFlags.Static)) ); } @@ -42,12 +43,13 @@ public class FuckToesMod : MelonMod try { // Must be PlayerLocal layer and in VR - if (__instance.gameObject.layer != CVRLayers.PlayerLocal + if (__instance.gameObject.layer != 8 || !MetaPort.Instance.isUsingVr) return; switch (IKSystem.Instance.BodySystem.FullBodyActive) { + case false when !EntryEnabledVR.Value: // Not in FBT, and not enabled, perish case true when !EntryEnabledFBT.Value: // In FBT, and not enabled in fbt, perish return; @@ -59,8 +61,8 @@ public class FuckToesMod : MelonMod } catch (Exception e) { - MelonLogger.Error($"Error during the patched method {nameof(OnVRIKAutoDetectReferences_Prefix)}"); - MelonLogger.Error(e); + Logger.Error($"Error during the patched method {nameof(OnVRIKAutoDetectReferences_Prefix)}"); + Logger.Error(e); } } diff --git a/FuckToes/Properties/AssemblyInfo.cs b/FuckToes/Properties/AssemblyInfo.cs index c308a51..c26d688 100644 --- a/FuckToes/Properties/AssemblyInfo.cs +++ b/FuckToes/Properties/AssemblyInfo.cs @@ -27,6 +27,6 @@ using System.Reflection; namespace NAK.FuckToes.Properties; internal static class AssemblyInfoParams { - public const string Version = "1.0.4"; + public const string Version = "1.0.3"; public const string Author = "NotAKidoS"; } \ No newline at end of file diff --git a/FuckToes/README.md b/FuckToes/README.md index 6caf1f4..e9b9e4d 100644 --- a/FuckToes/README.md +++ b/FuckToes/README.md @@ -1,6 +1,7 @@ # FuckToes +Prevents VRIK from autodetecting toes in HalfbodyIK. -Prevents VRIK from autodetecting toes in Halfbody or Fullbody. +Optionally can be applied in FBT, but toes in FBT are nice so you are a monster if so. ![fuckthetoes](https://user-images.githubusercontent.com/37721153/216518012-ae3b1dde-17ea-419a-a875-48d57e13f3dd.png) @@ -13,4 +14,5 @@ https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games > 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. \ No newline at end of file +> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive. + diff --git a/FuckToes/format.json b/FuckToes/format.json index c7c42ee..c02103b 100644 --- a/FuckToes/format.json +++ b/FuckToes/format.json @@ -1,12 +1,12 @@ { "_id": 129, "name": "FuckToes", - "modversion": "1.0.4", - "gameversion": "2025r179", + "modversion": "1.0.3", + "gameversion": "2023r171", "loaderversion": "0.6.1", "modtype": "Mod", "author": "NotAKidoS", - "description": "Prevents VRIK from using toe bones in HalfBody or FBT.\n\nVRIK calculates weird center of mass when toes are mapped, so it is sometimes desired to unmap toes to prevent an avatars feet from resting far back.\n\nPlease see the [README](https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/FuckToes/README.md) for relevant imagery detailing the problem.", + "description": "Prevents VRIK from using toe bones in HalfBody or FBT.\n\nVRIK calculates weird center of mass when toes are mapped, so it is sometimes desired to unmap toes to prevent an avatars feet from resting far back.\n\nPlease see the README for relevant imagery detailing the problem.", "searchtags": [ "toes", "vrik", @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r46/FuckToes.dll", + "downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r14/FuckToes.dll", "sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/FuckToes/", - "changelog": "- Recompiled for 2025r179", + "changelog": "- Fixes for 2023r171.", "embedcolor": "#f61963" } \ No newline at end of file diff --git a/NAK_CVR_Mods.sln b/NAK_CVR_Mods.sln index eb7c1a3..26deacd 100644 --- a/NAK_CVR_Mods.sln +++ b/NAK_CVR_Mods.sln @@ -56,10 +56,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RCCVirtualSteeringWheel", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YouAreMyPropNowWeAreHavingSoftTacosLater", "YouAreMyPropNowWeAreHavingSoftTacosLater\YouAreMyPropNowWeAreHavingSoftTacosLater.csproj", "{8DA821CC-F911-4FCB-8C29-5EF3D76A5F76}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoubleTapJumpToExitSeat", "DoubleTapJumpToExitSeat\DoubleTapJumpToExitSeat.csproj", "{36BF2B8B-F444-4886-AA4C-0EDF7540F1CE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FuckToes", "FuckToes\FuckToes.csproj", "{751E4140-2F4D-4550-A4A9-65ABA9F7893A}" -EndProject EndProject EndProject EndProject @@ -299,14 +295,6 @@ Global {8DA821CC-F911-4FCB-8C29-5EF3D76A5F76}.Debug|Any CPU.Build.0 = Debug|Any CPU {8DA821CC-F911-4FCB-8C29-5EF3D76A5F76}.Release|Any CPU.ActiveCfg = Release|Any CPU {8DA821CC-F911-4FCB-8C29-5EF3D76A5F76}.Release|Any CPU.Build.0 = Release|Any CPU - {36BF2B8B-F444-4886-AA4C-0EDF7540F1CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36BF2B8B-F444-4886-AA4C-0EDF7540F1CE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36BF2B8B-F444-4886-AA4C-0EDF7540F1CE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36BF2B8B-F444-4886-AA4C-0EDF7540F1CE}.Release|Any CPU.Build.0 = Release|Any CPU - {751E4140-2F4D-4550-A4A9-65ABA9F7893A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {751E4140-2F4D-4550-A4A9-65ABA9F7893A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {751E4140-2F4D-4550-A4A9-65ABA9F7893A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {751E4140-2F4D-4550-A4A9-65ABA9F7893A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/README.md b/README.md index e3217d1..56402aa 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ | [ASTExtension](ASTExtension/README.md) | Extension mod for [Avatar Scale Tool](https://github.com/NotAKidoS/AvatarScaleTool): | [Download](https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r46/ASTExtension.dll) | | [AvatarQueueSystemTweaks](AvatarQueueSystemTweaks/README.md) | Small tweaks to the Avatar Queue System. | [Download](https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r46/AvatarQueueSystemTweaks.dll) | | [CustomSpawnPoint](CustomSpawnPoint/README.md) | Replaces the unused Images button in the World Details page with a button to set a custom spawn point. | [Download](https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r46/CustomSpawnPoint.dll) | -| [DoubleTapJumpToExitSeat](DoubleTapJumpToExitSeat/README.md) | Replaces seat exit controls with a double-tap of the jump button, avoiding accidental exits from joystick drift or opening the menu. | [Download](https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r46/DoubleTapJumpToExitSeat.dll) | -| [FuckToes](FuckToes/README.md) | Prevents VRIK from autodetecting toes in Halfbody or Fullbody. | No Download | +| [DoubleTapJumpToExitSeat](DoubleTapJumpToExitSeat/README.md) | Literally the mod name. | No Download | +| [FuckToes](FuckToes/README.md) | Prevents VRIK from autodetecting toes in HalfbodyIK. | No Download | | [KeepVelocityOnExitFlight](KeepVelocityOnExitFlight/README.md) | Keeps the player's velocity when exiting flight mode. Makes it possible to fling yourself like in Garry's Mod. | [Download](https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r46/KeepVelocityOnExitFlight.dll) | | [LazyPrune](LazyPrune/README.md) | Prevents loaded objects from immediately unloading on destruction. Should prevent needlessly unloading & reloading all avatars/props on world rejoin or GS reconnection. | [Download](https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r46/LazyPrune.dll) | | [PropLoadingHexagon](PropLoadingHexagon/README.md) | https://github.com/NotAKidoS/NAK_CVR_Mods/assets/37721153/a892c765-71c1-47f3-a781-bdb9b60ba117 | [Download](https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r46/PropLoadingHexagon.dll) | diff --git a/RelativeSync/RelativeSync/Components/RelativeSyncMarker.cs b/RelativeSync/RelativeSync/Components/RelativeSyncMarker.cs index 9627146..0669d81 100644 --- a/RelativeSync/RelativeSync/Components/RelativeSyncMarker.cs +++ b/RelativeSync/RelativeSync/Components/RelativeSyncMarker.cs @@ -12,35 +12,18 @@ public class RelativeSyncMarker : MonoBehaviour public bool IsComponentActive => _component.isActiveAndEnabled; - + public bool ApplyRelativePosition = true; public bool ApplyRelativeRotation = true; public bool OnlyApplyRelativeHeading; - + private MonoBehaviour _component; - + private void Start() { - RegisterWithManager(); - ConfigureForPotentialMovementParent(); - } - - private void OnDestroy() - { - RelativeSyncManager.RelativeSyncTransforms.Remove(pathHash); - } - - public void OnHavingSoftTacosNow() - => RegisterWithManager(); - - private void RegisterWithManager() - { - // Remove old hash in case this is a re-registration - RelativeSyncManager.RelativeSyncTransforms.Remove(pathHash); - string path = GetGameObjectPath(transform); int hash = path.GetHashCode(); - + // check if it already exists (this **should** only matter in worlds) if (RelativeSyncManager.RelativeSyncTransforms.ContainsKey(hash)) { @@ -51,11 +34,18 @@ public class RelativeSyncMarker : MonoBehaviour return; } } - + pathHash = hash; RelativeSyncManager.RelativeSyncTransforms.Add(hash, this); + + ConfigureForPotentialMovementParent(); } + private void OnDestroy() + { + RelativeSyncManager.RelativeSyncTransforms.Remove(pathHash); + } + private void ConfigureForPotentialMovementParent() { if (!gameObject.TryGetComponent(out CVRMovementParent movementParent)) @@ -64,20 +54,20 @@ public class RelativeSyncMarker : MonoBehaviour return; } _component = movementParent; - + // TODO: a refactor may be needed to handle the orientation mode being animated - + // respect orientation mode & gravity zone ApplyRelativeRotation = movementParent.orientationMode == CVRMovementParent.OrientationMode.RotateWithParent; OnlyApplyRelativeHeading = movementParent.GetComponent() == null; } - + private static string GetGameObjectPath(Transform transform) { // props already have a unique instance identifier at root // worlds uhhhh, dont duplicate the same thing over and over thx // avatars on remote/local client have diff path, we need to account for it -_- - + string path = transform.name; while (transform.parent != null) { @@ -89,22 +79,22 @@ public class RelativeSyncMarker : MonoBehaviour path = MetaPort.Instance.ownerId + "/" + path; break; } // remote player object root is already player guid - + path = transform.name + "/" + path; } - + return path; } - - private static bool FindAvailableHash(ref int hash) + + private bool FindAvailableHash(ref int hash) { for (int i = 0; i < 16; i++) { hash += 1; if (!RelativeSyncManager.RelativeSyncTransforms.ContainsKey(hash)) return true; } - + // failed to find a hash in 16 tries, dont care return false; } -} +} \ No newline at end of file diff --git a/YouAreMyPropNowWeAreHavingSoftTacosLater/Main.cs b/YouAreMyPropNowWeAreHavingSoftTacosLater/Main.cs index 02e39c0..b4f22de 100644 --- a/YouAreMyPropNowWeAreHavingSoftTacosLater/Main.cs +++ b/YouAreMyPropNowWeAreHavingSoftTacosLater/Main.cs @@ -23,19 +23,19 @@ public class YouAreMyPropNowWeAreHavingSoftTacosLaterMod : MelonMod { #region Melon Preferences - private static readonly MelonPreferences_Category Category = - MelonPreferences.CreateCategory(nameof(YouAreMyPropNowWeAreHavingSoftTacosLater)); + public static readonly MelonPreferences_Category Category = + MelonPreferences.CreateCategory(nameof(YouAreMyPropNowWeAreHavingSoftTacosLaterMod)); - private static readonly MelonPreferences_Entry EntryTrackPickups = + public static readonly MelonPreferences_Entry EntryTrackPickups = Category.CreateEntry("track_pickups", true, display_name: "Track Pickups", description: "Should pickups be tracked?"); - private static readonly MelonPreferences_Entry EntryTrackAttachments = + public static readonly MelonPreferences_Entry EntryTrackAttachments = Category.CreateEntry("track_attachments", true, display_name: "Track Attachments", description: "Should attachments be tracked?"); - private static readonly MelonPreferences_Entry EntryTrackSeats = + public static readonly MelonPreferences_Entry EntryTrackSeats = Category.CreateEntry("track_seats", true, display_name: "Track Seats", description: "Should seats be tracked?"); - private static readonly MelonPreferences_Entry EntryOnlySpawnedByMe = + public static readonly MelonPreferences_Entry EntryOnlySpawnedByMe = Category.CreateEntry("only_spawned_by_me", true, display_name: "Only Spawned By Me", description: "Should only props spawned by me be tracked?"); #endregion Melon Preferences @@ -231,7 +231,6 @@ public class YouAreMyPropNowWeAreHavingSoftTacosLaterMod : MelonMod // Apply new prop data to the spawnable newPropData.Spawnable = originalPropData.Spawnable; newPropData.Wrapper = originalPropData.Wrapper; - newPropData.Wrapper.BroadcastMessage("OnHavingSoftTacosNow", SendMessageOptions.DontRequireReceiver); // support with RelativeSync newPropData.Wrapper.name = $"p+{newPropData.ObjectId}~{newPropData.InstanceId}"; // Copy sync values