From e5242f76c717fcdaf1563110af57ad395b29402a Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidOnSteam@users.noreply.github.com> Date: Wed, 26 Apr 2023 15:32:02 -0500 Subject: [PATCH] major cleanup --- AASBufferFix/Properties/AssemblyInfo.cs | 2 +- AASBufferFix/format.json | 6 +- BadAnimatorFix/BadAnimatorFixManager.cs | 14 +-- ...{BadAnimatorFix.cs => BadAnimatorFixer.cs} | 8 +- BadAnimatorFix/HarmonyPatches.cs | 12 +-- BadAnimatorFix/Main.cs | 7 +- BadAnimatorFix/Properties/AssemblyInfo.cs | 4 +- BadAnimatorFix/format.json | 4 +- Blackout/AssetHandler.cs | 6 +- Blackout/BlackoutController.cs | 6 +- Blackout/HarmonyPatches.cs | 3 +- Blackout/Integrations/BTKUIAddon.cs | 18 ++-- Blackout/Integrations/UIExpansionKitAddon.cs | 1 - Blackout/Main.cs | 95 ++++++++++-------- Blackout/Properties/AssemblyInfo.cs | 6 +- Blackout/format.json | 4 +- CVRGizmos/CVRGizmoManager.cs | 2 +- CVRGizmos/GizmoTypes/CVRDistanceConstrain.cs | 82 ++++++++-------- CVRGizmos/Main.cs | 26 ++--- CVRGizmos/Properties/AssemblyInfo.cs | 3 +- CVRGizmos/format.json | 4 +- .../Integrations/ChilloutVRBase.cs | 1 - ChatBoxExtensions/Integrations/Commands.cs | 27 +++-- ChatBoxExtensions/Properties/AssemblyInfo.cs | 2 +- ChatBoxExtensions/format.json | 6 +- .../Properties/AssemblyInfo.cs | 6 +- ClearHudNotifications/format.json | 4 +- DesktopVRIK/DesktopVRIKSystem.cs | 2 +- DesktopVRIK/HarmonyPatches.cs | 1 - DesktopVRIK/Integrations/BTKUIAddon.cs | 32 +++--- DesktopVRIK/Main.cs | 10 +- DesktopVRIK/Properties/AssemblyInfo.cs | 4 +- DesktopVRIK/format.json | 4 +- ...esktopVRSwitch.cs => DesktopVRSwitcher.cs} | 8 +- DesktopVRSwitch/HarmonyPatches.cs | 6 +- DesktopVRSwitch/Main.cs | 14 ++- DesktopVRSwitch/Patches/IKSystemTracker.cs | 2 +- .../Patches/ReferenceCameraPatch.cs | 2 +- .../Patches/VRModeSwitchTracker.cs | 6 +- DesktopVRSwitch/Properties/AssemblyInfo.cs | 4 +- DesktopVRSwitch/TryCatchHell.cs | 32 +++--- DesktopVRSwitch/format.json | 4 +- FuckMetrics/FuckMetrics.cs | 92 ----------------- FuckMetrics/Main.cs | 98 ++++++++++++++++++- FuckMetrics/Properties/AssemblyInfo.cs | 5 +- FuckMetrics/format.json | 4 +- FuckToes/{FuckToes.cs => HarmonyPatches.cs} | 4 +- FuckToes/Main.cs | 18 ++-- FuckToes/Properties/AssemblyInfo.cs | 5 +- FuckToes/format.json | 4 +- GestureLock/HarmonyPatches.cs | 58 +++++++++++ GestureLock/Main.cs | 78 +++------------ GestureLock/Properties/AssemblyInfo.cs | 4 +- GestureLock/format.json | 4 +- IKFixes/Main.cs | 4 +- IKFixes/Properties/AssemblyInfo.cs | 2 +- IKFixes/format.json | 4 +- JumpPatch/Main.cs | 2 +- JumpPatch/Properties/AssemblyInfo.cs | 4 +- JumpPatch/format.json | 4 +- MenuScalePatch/Main.cs | 7 +- MenuScalePatch/Properties/AssemblyInfo.cs | 2 +- MenuScalePatch/format.json | 4 +- .../Components/NAKPointerTracker.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- NAK.CustomComponents/format.json | 4 +- PathCamDisabler/Main.cs | 70 ++++++------- PathCamDisabler/Properties/AssemblyInfo.cs | 6 +- PathCamDisabler/format.json | 4 +- PickupPushPull/HarmonyPatches.cs | 4 +- .../InputModules/PickupPushPull_Module.cs | 31 +++--- PickupPushPull/Main.cs | 70 +++++++------ PickupPushPull/Properties/AssemblyInfo.cs | 7 +- PickupPushPull/format.json | 4 +- .../Properties/AssemblyInfo.cs | 3 +- PortableCameraAdditions/format.json | 4 +- PropUndoButton/Main.cs | 20 ++-- PropUndoButton/Properties/AssemblyInfo.cs | 6 +- PropUndoButton/format.json | 4 +- ThirdPerson/ThirdPerson.cs | 1 - TrackedControllerFix/HarmonyPatches.cs | 4 +- TrackedControllerFix/Main.cs | 2 +- .../Properties/AssemblyInfo.cs | 4 +- TrackedControllerFix/TrackedControllerFix.cs | 2 +- TrackedControllerFix/format.json | 4 +- 85 files changed, 584 insertions(+), 571 deletions(-) rename BadAnimatorFix/{BadAnimatorFix.cs => BadAnimatorFixer.cs} (91%) rename DesktopVRSwitch/{DesktopVRSwitch.cs => DesktopVRSwitcher.cs} (92%) delete mode 100644 FuckMetrics/FuckMetrics.cs rename FuckToes/{FuckToes.cs => HarmonyPatches.cs} (78%) create mode 100644 GestureLock/HarmonyPatches.cs diff --git a/AASBufferFix/Properties/AssemblyInfo.cs b/AASBufferFix/Properties/AssemblyInfo.cs index 627a405..b1f98c3 100644 --- a/AASBufferFix/Properties/AssemblyInfo.cs +++ b/AASBufferFix/Properties/AssemblyInfo.cs @@ -15,7 +15,7 @@ using System.Reflection; nameof(NAK.AASBufferFix), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/AASBufferFix" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/AASBufferFix" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/AASBufferFix/format.json b/AASBufferFix/format.json index 15cec8d..1311380 100644 --- a/AASBufferFix/format.json +++ b/AASBufferFix/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/AASBufferFix/releases/download/v1.0.5/AASBufferFix.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/AASBufferFix/", - "changelog": "- Don't send AAS while switching avatar.\n\nPlease read the changelog for [v1.0.5](https://github.com/NotAKidOnSteam/AASBufferFix/releases/tag/v1.0.5) for better understanding of why syncing nothing may be worse than syncing garbage AAS.", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/AASBufferFix.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/AASBufferFix/", + "changelog": "", "embedcolor": "9b59b6" } \ No newline at end of file diff --git a/BadAnimatorFix/BadAnimatorFixManager.cs b/BadAnimatorFix/BadAnimatorFixManager.cs index c5ddedf..41bc8bf 100644 --- a/BadAnimatorFix/BadAnimatorFixManager.cs +++ b/BadAnimatorFix/BadAnimatorFixManager.cs @@ -6,17 +6,17 @@ namespace NAK.BadAnimatorFix; public static class BadAnimatorFixManager { - private static List badAnimatorFixes = new List(); + private static List badAnimatorFixes = new List(); private static int currentIndex = 0; private static float checkInterval = 5f; - public static void Add(BadAnimatorFix bad) + public static void Add(BadAnimatorFixer bad) { if (!badAnimatorFixes.Contains(bad)) badAnimatorFixes.Add(bad); } - public static void Remove(BadAnimatorFix bad) + public static void Remove(BadAnimatorFixer bad) { if (badAnimatorFixes.Contains(bad)) badAnimatorFixes.Remove(bad); @@ -24,7 +24,7 @@ public static class BadAnimatorFixManager public static void OnPlayerLoaded() { - ToggleJob(BadAnimatorFixMod.EntryEnabled.Value); + ToggleJob(BadAnimatorFix.EntryEnabled.Value); } public static void OnSceneInitialized(string sceneName) @@ -36,9 +36,9 @@ public static class BadAnimatorFixManager foreach (var animator in allAnimators) { // Ignore objects that have our "fix", this shouldn't be needed but eh - if (!animator.TryGetComponent(out _)) + if (!animator.TryGetComponent(out _)) { - animator.gameObject.AddComponent(); + animator.gameObject.AddComponent(); } } } @@ -48,7 +48,7 @@ public static class BadAnimatorFixManager if (badAnimatorFixes.Count == 0) return; currentIndex = (currentIndex + 1) % badAnimatorFixes.Count; - BadAnimatorFix currentAnimatorFix = badAnimatorFixes[currentIndex]; + BadAnimatorFixer currentAnimatorFix = badAnimatorFixes[currentIndex]; currentAnimatorFix.AttemptRewindAnimator(); } diff --git a/BadAnimatorFix/BadAnimatorFix.cs b/BadAnimatorFix/BadAnimatorFixer.cs similarity index 91% rename from BadAnimatorFix/BadAnimatorFix.cs rename to BadAnimatorFix/BadAnimatorFixer.cs index 3ad9d91..4bcbe7e 100644 --- a/BadAnimatorFix/BadAnimatorFix.cs +++ b/BadAnimatorFix/BadAnimatorFixer.cs @@ -3,7 +3,7 @@ using UnityEngine.Playables; namespace NAK.BadAnimatorFix; -public class BadAnimatorFix : MonoBehaviour +public class BadAnimatorFixer : MonoBehaviour { private const float StateLimit = 20f; @@ -42,11 +42,11 @@ public class BadAnimatorFix : MonoBehaviour PlayableExtensions.SetTime(animator.playableGraph.GetRootPlayable(0), 0); } } - - if (BadAnimatorFixMod.EntryLogging.Value) + + if (BadAnimatorFix.EntryLogging.Value) { string message = rewound ? $"Rewound animator and playable {animator}." : $"Animator did not meet criteria to rewind {animator}."; - BadAnimatorFixMod.Logger.Msg(message); + BadAnimatorFix.Logger.Msg(message); } } } \ No newline at end of file diff --git a/BadAnimatorFix/HarmonyPatches.cs b/BadAnimatorFix/HarmonyPatches.cs index 0940365..3d620cf 100644 --- a/BadAnimatorFix/HarmonyPatches.cs +++ b/BadAnimatorFix/HarmonyPatches.cs @@ -19,7 +19,7 @@ internal static class AnimatorPatches [HarmonyPatch(typeof(CVRAvatar), "Start")] private static void Postfix_CVRAvatar_Start(CVRAvatar __instance) { - if (!BadAnimatorFixMod.EntryCVRAvatar.Value) return; + if (!BadAnimatorFix.EntryCVRAvatar.Value) return; AddBadAnimatorFixComponentIfAnimatorExists(__instance.gameObject); } @@ -27,7 +27,7 @@ internal static class AnimatorPatches [HarmonyPatch(typeof(CVRSpawnable), "Start")] private static void Postfix_CVRSpawnable_Start(CVRSpawnable __instance) { - if (!BadAnimatorFixMod.EntryCVRSpawnable.Value) return; + if (!BadAnimatorFix.EntryCVRSpawnable.Value) return; AddBadAnimatorFixComponentIfAnimatorExists(__instance.gameObject); } @@ -36,7 +36,7 @@ internal static class AnimatorPatches [HarmonyPatch(typeof(CVR_MenuManager), "Start")] private static void Postfix_CVR_MenuManager_Start(ref CVR_MenuManager __instance) { - if (!BadAnimatorFixMod.EntryMenus.Value) return; + if (!BadAnimatorFix.EntryMenus.Value) return; AddBadAnimatorFixComponentIfAnimatorExists(__instance.gameObject); } @@ -45,7 +45,7 @@ internal static class AnimatorPatches [HarmonyPatch(typeof(ViewManager), "Start")] private static void Postfix_ViewManager_Start(ref ViewManager __instance) { - if (!BadAnimatorFixMod.EntryMenus.Value) return; + if (!BadAnimatorFix.EntryMenus.Value) return; AddBadAnimatorFixComponentIfAnimatorExists(__instance.gameObject); } @@ -54,9 +54,9 @@ internal static class AnimatorPatches Animator[] animators = gameObject.GetComponentsInChildren(true); foreach (Animator animator in animators) { - if (!animator.TryGetComponent(out _)) + if (!animator.TryGetComponent(out _)) { - animator.gameObject.AddComponent(); + animator.gameObject.AddComponent(); } } } diff --git a/BadAnimatorFix/Main.cs b/BadAnimatorFix/Main.cs index 623bbae..bb70438 100644 --- a/BadAnimatorFix/Main.cs +++ b/BadAnimatorFix/Main.cs @@ -2,11 +2,12 @@ namespace NAK.BadAnimatorFix; -public class BadAnimatorFixMod : MelonMod +public class BadAnimatorFix : MelonMod { internal static MelonLogger.Instance Logger; - public const string SettingsCategory = "BadAnimatorFix"; - public static readonly MelonPreferences_Category CategoryBadAnimatorFix = MelonPreferences.CreateCategory(SettingsCategory); + + public static readonly MelonPreferences_Category CategoryBadAnimatorFix = + MelonPreferences.CreateCategory(nameof(BadAnimatorFix)); public static readonly MelonPreferences_Entry EntryEnabled = CategoryBadAnimatorFix.CreateEntry("Enabled", true, description: "Toggle BadAnimatorFix entirely. Requires avatar/spawnable/world reload."); diff --git a/BadAnimatorFix/Properties/AssemblyInfo.cs b/BadAnimatorFix/Properties/AssemblyInfo.cs index 9cab0f4..080e016 100644 --- a/BadAnimatorFix/Properties/AssemblyInfo.cs +++ b/BadAnimatorFix/Properties/AssemblyInfo.cs @@ -10,11 +10,11 @@ using System.Reflection; [assembly: AssemblyProduct(nameof(NAK.BadAnimatorFix))] [assembly: MelonInfo( - typeof(NAK.BadAnimatorFix.BadAnimatorFixMod), + typeof(NAK.BadAnimatorFix.BadAnimatorFixer), nameof(NAK.BadAnimatorFix), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/BadAnimatorFix" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/BadAnimatorFix" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/BadAnimatorFix/format.json b/BadAnimatorFix/format.json index df8fd08..bb18a39 100644 --- a/BadAnimatorFix/format.json +++ b/BadAnimatorFix/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/BadAnimatorFix/releases/download/v1.0.0/BadAnimatorFix.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/BadAnimatorFix/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/BadAnimatorFix.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/BadAnimatorFix/", "changelog": "Initial Release", "embedcolor": "7F3F99" } \ No newline at end of file diff --git a/Blackout/AssetHandler.cs b/Blackout/AssetHandler.cs index 729ccf6..e3bce0d 100644 --- a/Blackout/AssetHandler.cs +++ b/Blackout/AssetHandler.cs @@ -44,14 +44,14 @@ static class AssetsHandler ms_loadedAssets.Add(l_assetName, l_assetBundle); } else - MelonLoader.MelonLogger.Warning("Unable to load bundled '" + l_assetName + "' asset"); + Blackout.Logger.Warning("Unable to load bundled '" + l_assetName + "' asset"); } else - MelonLoader.MelonLogger.Warning("Unable to get bundled '" + l_assetName + "' asset stream"); + Blackout.Logger.Warning("Unable to get bundled '" + l_assetName + "' asset stream"); } catch (System.Exception e) { - MelonLoader.MelonLogger.Warning("Unable to load bundled '" + l_assetName + "' asset, reason: " + e.Message); + Blackout.Logger.Warning("Unable to load bundled '" + l_assetName + "' asset, reason: " + e.Message); } } } diff --git a/Blackout/BlackoutController.cs b/Blackout/BlackoutController.cs index 05357e0..e15e414 100644 --- a/Blackout/BlackoutController.cs +++ b/Blackout/BlackoutController.cs @@ -30,7 +30,7 @@ namespace NAK.Blackout; public class BlackoutController : MonoBehaviour { public static BlackoutController Instance; - + // The current state of the player's consciousness. public BlackoutState CurrentState = BlackoutState.Awake; @@ -134,7 +134,7 @@ public class BlackoutController : MonoBehaviour blackoutAnimator = blackoutGO.GetComponent(); if (!blackoutAnimator) { - MelonLogger.Error("Blackout: Could not find blackout animator component!"); + Blackout.Logger.Error("Blackout: Could not find blackout animator component!"); return; } @@ -229,7 +229,7 @@ public class BlackoutController : MonoBehaviour //broken, needs to run next frame private void SendHUDMessage(string message) { - MelonLogger.Msg(message); + Blackout.Logger.Msg(message); if (!CohtmlHud.Instance || !HudMessages) return; StringBuilder secondmessage = new StringBuilder(); diff --git a/Blackout/HarmonyPatches.cs b/Blackout/HarmonyPatches.cs index 7ffa6ed..171b2d0 100644 --- a/Blackout/HarmonyPatches.cs +++ b/Blackout/HarmonyPatches.cs @@ -1,7 +1,6 @@ using ABI_RC.Core.Player; using ABI_RC.Core.Savior; using HarmonyLib; -using MelonLoader; namespace NAK.Blackout.HarmonyPatches; @@ -15,7 +14,7 @@ internal class HarmonyPatches { if (Blackout.inVR != MetaPort.Instance.isUsingVr) { - MelonLogger.Msg("VRMode change detected! Reinitializing Blackout Instance..."); + Blackout.Logger.Msg("VRMode change detected! Reinitializing Blackout Instance..."); Blackout.inVR = MetaPort.Instance.isUsingVr; BlackoutController.Instance.SetupBlackoutInstance(); BlackoutController.Instance.ChangeBlackoutState(BlackoutController.BlackoutState.Awake); diff --git a/Blackout/Integrations/BTKUIAddon.cs b/Blackout/Integrations/BTKUIAddon.cs index 717426c..ab6851f 100644 --- a/Blackout/Integrations/BTKUIAddon.cs +++ b/Blackout/Integrations/BTKUIAddon.cs @@ -13,7 +13,7 @@ public static class BTKUIAddon Page miscPage = QuickMenuAPI.MiscTabPage; Category miscCategory = miscPage.AddCategory(Blackout.SettingsCategory); - AddMelonToggle(ref miscCategory, Blackout.m_entryEnabled); + AddMelonToggle(ref miscCategory, Blackout.EntryEnabled); //Add my own page to not clog up Misc Menu @@ -23,7 +23,7 @@ public static class BTKUIAddon Category blackoutCategory = blackoutPage.AddCategory("Blackout"); - AddMelonToggle(ref blackoutCategory, Blackout.m_entryEnabled); + AddMelonToggle(ref blackoutCategory, Blackout.EntryEnabled); //manual state changing var state_Awake = blackoutCategory.AddButton("Awake State", null, "Enter the Awake State."); @@ -32,21 +32,21 @@ public static class BTKUIAddon state_Drowsy.OnPress += () => BlackoutController.Instance?.ChangeBlackoutState(BlackoutController.BlackoutState.Drowsy); var state_Sleeping = blackoutCategory.AddButton("Sleeping State", null, "Enter the Sleeping State."); state_Sleeping.OnPress += () => BlackoutController.Instance?.ChangeBlackoutState(BlackoutController.BlackoutState.Sleeping); - + //dimming strength - AddMelonSlider(ref blackoutPage, Blackout.m_entryDrowsyDimStrength, 0f, 1f); + AddMelonSlider(ref blackoutPage, Blackout.EntryDrowsyDimStrength, 0f, 1f); //velocity dim multiplier - AddMelonToggle(ref blackoutCategory, Blackout.m_entryDrowsyVelocityMultiplier); + AddMelonToggle(ref blackoutCategory, Blackout.EntryDrowsyVelocityMultiplier); //hud messages - AddMelonToggle(ref blackoutCategory, Blackout.m_entryHudMessages); + AddMelonToggle(ref blackoutCategory, Blackout.EntryHudMessages); //lower fps while sleep (desktop) - AddMelonToggle(ref blackoutCategory, Blackout.m_entryDropFPSOnSleep); + AddMelonToggle(ref blackoutCategory, Blackout.EntryDropFPSOnSleep); //auto sleep state - AddMelonToggle(ref blackoutCategory, Blackout.m_entryAutoSleepState); + AddMelonToggle(ref blackoutCategory, Blackout.EntryAutoSleepState); //i will add the rest of the settings once BTKUILib supports int input } @@ -55,7 +55,7 @@ public static class BTKUIAddon { category.AddToggle(entry.DisplayName, entry.Description, entry.Value).OnValueUpdated += b => entry.Value = b; } - + private static void AddMelonSlider(ref Page page, MelonLoader.MelonPreferences_Entry entry, float min, float max) { page.AddSlider(entry.DisplayName, entry.Description, entry.Value, min, max).OnValueUpdated += f => entry.Value = f; diff --git a/Blackout/Integrations/UIExpansionKitAddon.cs b/Blackout/Integrations/UIExpansionKitAddon.cs index 440e4f1..bc8113a 100644 --- a/Blackout/Integrations/UIExpansionKitAddon.cs +++ b/Blackout/Integrations/UIExpansionKitAddon.cs @@ -15,7 +15,6 @@ public static class UIExpansionKitAddon also because it **used to work**... a game update broke it and uiexpansionkit hasnt updated since what pisses me off more, is that DesktopVRSwitch works, and that was originally copied from Blackout -_- - https://github.com/NotAKidOnSteam/DesktopVRSwitch/blob/main/DesktopVRSwitch/UIExpansionKitAddon.cs **/ var settings = ExpansionKitApi.GetSettingsCategory(Blackout.SettingsCategory); settings.AddSimpleButton("Awake State", AwakeState); diff --git a/Blackout/Main.cs b/Blackout/Main.cs index b341866..0a1e23d 100644 --- a/Blackout/Main.cs +++ b/Blackout/Main.cs @@ -7,52 +7,65 @@ namespace NAK.Blackout; public class Blackout : MelonMod { internal static bool inVR; - internal const string SettingsCategory = "Blackout"; + internal static MelonLogger.Instance Logger; + internal const string SettingsCategory = nameof(Blackout); - internal static MelonPreferences_Category m_categoryBlackout; - internal static MelonPreferences_Entry - m_entryEnabled, - m_entryAutoSleepState, - m_entryHudMessages, - m_entryDropFPSOnSleep, - m_entryDrowsyVelocityMultiplier; - internal static MelonPreferences_Entry - m_entryDrowsyThreshold, m_entryAwakeThreshold, - m_entryDrowsyModeTimer, m_entrySleepModeTimer, - m_entryDrowsyDimStrength; + public static readonly MelonPreferences_Category CategoryBlackout = + MelonPreferences.CreateCategory(SettingsCategory); + + public static readonly MelonPreferences_Entry EntryEnabled = + CategoryBlackout.CreateEntry("Automatic State Change", true, "Should the screen automatically dim if head is still for enough time?"); + + public static readonly MelonPreferences_Entry EntryHudMessages = + CategoryBlackout.CreateEntry("Hud Messages", true, "Notify on state change."); + + public static readonly MelonPreferences_Entry EntryDropFPSOnSleep = + CategoryBlackout.CreateEntry("Limit FPS While Sleep", false, "Limits FPS to 5 while in Sleep State. This only works in Desktop, as SteamVR/HMD handles VR FPS."); + + public static readonly MelonPreferences_Entry EntryDrowsyVelocityMultiplier = + CategoryBlackout.CreateEntry("Drowsy Velocity Multiplier", true, "Should head velocity act as a multiplier to Drowsy Dim Strength?"); + + public static readonly MelonPreferences_Entry EntryAutoSleepState = + CategoryBlackout.CreateEntry("Auto Sleep State", true, "Should the sleep state be used during Automatic State Change?"); + + public static readonly MelonPreferences_Entry EntryDrowsyThreshold = + CategoryBlackout.CreateEntry("Drowsy Threshold", 2f, "Velocity to return partial vision."); + + public static readonly MelonPreferences_Entry EntryAwakeThreshold = + CategoryBlackout.CreateEntry("Awake Threshold", 4f, "Velocity to return full vision."); + + public static readonly MelonPreferences_Entry EntryDrowsyModeTimer = + CategoryBlackout.CreateEntry("Enter Drowsy Time (Minutes)", 3f, "How many minutes without movement until enter drowsy mode."); + + public static readonly MelonPreferences_Entry EntrySleepModeTimer = + CategoryBlackout.CreateEntry("Enter Sleep Time (Seconds)", 10f, "How many seconds without movement until enter sleep mode."); + + public static readonly MelonPreferences_Entry EntryDrowsyDimStrength = + CategoryBlackout.CreateEntry("Drowsy Dim Strength", 0.6f, "How strong of a dimming effect should drowsy mode have."); public override void OnInitializeMelon() { - m_categoryBlackout = MelonPreferences.CreateCategory(SettingsCategory); - m_entryEnabled = m_categoryBlackout.CreateEntry("Automatic State Change", true, description: "Should the screen automatically dim if head is still for enough time?"); - m_entryEnabled.OnEntryValueChangedUntyped.Subscribe(OnUpdateEnabled); - m_entryHudMessages = m_categoryBlackout.CreateEntry("Hud Messages", true, description: "Notify on state change."); - m_entryDropFPSOnSleep = m_categoryBlackout.CreateEntry("Limit FPS While Sleep", false, description: "Limits FPS to 5 while in Sleep State. This only works in Desktop, as SteamVR/HMD handles VR FPS."); - m_entryDrowsyVelocityMultiplier = m_categoryBlackout.CreateEntry("Drowsy Velocity Multiplier", true, description: "Should head velocity act as a multiplier to Drowsy Dim Strength?"); - m_entryAutoSleepState = m_categoryBlackout.CreateEntry("Auto Sleep State", true, description: "Should the sleep state be used during Automatic State Change?"); - m_entryDrowsyThreshold = m_categoryBlackout.CreateEntry("Drowsy Threshold", 2f, description: "Velocity to return partial vision."); - m_entryAwakeThreshold = m_categoryBlackout.CreateEntry("Awake Threshold", 4f, description: "Velocity to return full vision."); - m_entryDrowsyModeTimer = m_categoryBlackout.CreateEntry("Enter Drowsy Time (Minutes)", 3f, description: "How many minutes without movement until enter drowsy mode."); - m_entrySleepModeTimer = m_categoryBlackout.CreateEntry("Enter Sleep Time (Seconds)", 10f, description: "How many seconds without movement until enter sleep mode."); - m_entryDrowsyDimStrength = m_categoryBlackout.CreateEntry("Drowsy Dim Strength", 0.6f, description: "How strong of a dimming effect should drowsy mode have."); - - foreach (var setting in m_categoryBlackout.Entries) + Logger = LoggerInstance; + EntryEnabled.OnEntryValueChangedUntyped.Subscribe(OnUpdateEnabled); + foreach (var entry in CategoryBlackout.Entries) { - if (!setting.OnEntryValueChangedUntyped.GetSubscribers().Any()) - setting.OnEntryValueChangedUntyped.Subscribe(OnUpdateSettings); + if (entry != EntryEnabled && !entry.OnEntryValueChangedUntyped.GetSubscribers().Any()) + { + entry.OnEntryValueChangedUntyped.Subscribe(OnUpdateSettings); + } } //UIExpansionKit addon if (MelonMod.RegisteredMelons.Any(it => it.Info.Name == "UI Expansion Kit")) { - MelonLogger.Msg("Initializing UIExpansionKit support."); + Logger.Msg("Initializing UIExpansionKit support."); UIExpansionKitAddon.Init(); } //BTKUILib addon if (MelonMod.RegisteredMelons.Any(it => it.Info.Name == "BTKUILib")) { - MelonLogger.Msg("Initializing BTKUILib support."); + Logger.Msg("Initializing BTKUILib support."); BTKUIAddon.Init(); } @@ -81,7 +94,7 @@ public class Blackout : MelonMod private void OnEnabled() { if (!BlackoutController.Instance) return; - if (m_entryEnabled.Value) + if (EntryEnabled.Value) { BlackoutController.Instance.OnEnable(); } @@ -89,21 +102,21 @@ public class Blackout : MelonMod { BlackoutController.Instance.OnDisable(); } - BlackoutController.Instance.AutomaticStateChange = m_entryEnabled.Value; + BlackoutController.Instance.AutomaticStateChange = EntryEnabled.Value; } private void UpdateAllSettings() { if (!BlackoutController.Instance) return; - BlackoutController.Instance.HudMessages = m_entryHudMessages.Value; - BlackoutController.Instance.AutoSleepState = m_entryAutoSleepState.Value; - BlackoutController.Instance.DropFPSOnSleep = m_entryDropFPSOnSleep.Value; - BlackoutController.Instance.drowsyThreshold = m_entryDrowsyThreshold.Value; - BlackoutController.Instance.wakeThreshold = m_entryAwakeThreshold.Value; - BlackoutController.Instance.DrowsyModeTimer = m_entryDrowsyModeTimer.Value; - BlackoutController.Instance.SleepModeTimer = m_entrySleepModeTimer.Value; - BlackoutController.Instance.DrowsyDimStrength = m_entryDrowsyDimStrength.Value; - BlackoutController.Instance.DrowsyVelocityMultiplier = m_entryDrowsyVelocityMultiplier.Value; + BlackoutController.Instance.HudMessages = EntryHudMessages.Value; + BlackoutController.Instance.AutoSleepState = EntryAutoSleepState.Value; + BlackoutController.Instance.DropFPSOnSleep = EntryDropFPSOnSleep.Value; + BlackoutController.Instance.drowsyThreshold = EntryDrowsyThreshold.Value; + BlackoutController.Instance.wakeThreshold = EntryAwakeThreshold.Value; + BlackoutController.Instance.DrowsyModeTimer = EntryDrowsyModeTimer.Value; + BlackoutController.Instance.SleepModeTimer = EntrySleepModeTimer.Value; + BlackoutController.Instance.DrowsyDimStrength = EntryDrowsyDimStrength.Value; + BlackoutController.Instance.DrowsyVelocityMultiplier = EntryDrowsyVelocityMultiplier.Value; } private void OnUpdateEnabled(object arg1, object arg2) => OnEnabled(); diff --git a/Blackout/Properties/AssemblyInfo.cs b/Blackout/Properties/AssemblyInfo.cs index 5663398..5a41171 100644 --- a/Blackout/Properties/AssemblyInfo.cs +++ b/Blackout/Properties/AssemblyInfo.cs @@ -1,5 +1,5 @@ -using NAK.Blackout.Properties; -using MelonLoader; +using MelonLoader; +using NAK.Blackout.Properties; using System.Reflection; @@ -15,7 +15,7 @@ using System.Reflection; nameof(NAK.Blackout), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/Blackout" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/Blackout" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/Blackout/format.json b/Blackout/format.json index 5f2e9f7..d30b37e 100644 --- a/Blackout/format.json +++ b/Blackout/format.json @@ -17,8 +17,8 @@ "BTKUILib", "UIExpansionKit" ], - "downloadlink": "https://github.com/NotAKidOnSteam/Blackout/releases/download/v2.0.0/Blackout.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/Blackout/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/Blackout.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/Blackout/", "changelog": "- Added BTKUILib support.\n- Added dimming strength velocity multiplier option.\n- Added option to not use Automatic Sleep State.\n- Dimming strengh now updates in realtime when configuring.", "embedcolor": "#161b22" } \ No newline at end of file diff --git a/CVRGizmos/CVRGizmoManager.cs b/CVRGizmos/CVRGizmoManager.cs index 4d398b5..8816007 100644 --- a/CVRGizmos/CVRGizmoManager.cs +++ b/CVRGizmos/CVRGizmoManager.cs @@ -1,6 +1,6 @@ using CVRGizmos.GismoTypes; -using Gizmos = Popcron.Gizmos; using UnityEngine; +using Gizmos = Popcron.Gizmos; namespace CVRGizmos { diff --git a/CVRGizmos/GizmoTypes/CVRDistanceConstrain.cs b/CVRGizmos/GizmoTypes/CVRDistanceConstrain.cs index 09fd75c..a57ae68 100644 --- a/CVRGizmos/GizmoTypes/CVRDistanceConstrain.cs +++ b/CVRGizmos/GizmoTypes/CVRDistanceConstrain.cs @@ -31,49 +31,49 @@ namespace CVRGizmos.GismoTypes CacheGizmos(); break; } - if (references[i].target == null) - { - break; - } - if (references[i].maxDistance < references[i].minDistance && references[i].maxDistance != 0f) - { - break; - } - Vector3 normalized = (references[i].transform.position - references[i].target.position).normalized; + if (references[i].target == null) + { + break; + } + if (references[i].maxDistance < references[i].minDistance && references[i].maxDistance != 0f) + { + break; + } + Vector3 normalized = (references[i].transform.position - references[i].target.position).normalized; - //BUG: Matrix addition isn't reset, other gizmo types Matrix will persist. - //This gizmo type could be a bit fucked, but I don't have the time to test. - Gizmos.Matrix = Matrix4x4.identity; + //BUG: Matrix addition isn't reset, other gizmo types Matrix will persist. + //This gizmo type could be a bit fucked, but I don't have the time to test. + Gizmos.Matrix = Matrix4x4.identity; - if (references[i].minDistance == 0f) - { - if (references[i].maxDistance == 0f) - { - Gizmos.Color = Color.green; - Gizmos.Line(references[i].target.position, normalized * 9999f); - break; - } - Gizmos.Color = Color.green; - Gizmos.Line(references[i].target.position, references[i].target.position + normalized * references[i].maxDistance); - break; - } - else - { - if (references[i].maxDistance == 0f) - { - Gizmos.Color = Color.red; - Gizmos.Line(references[i].target.position, references[i].target.position + normalized * references[i].minDistance); - Gizmos.Color = Color.green; - Gizmos.Line(references[i].target.position + normalized * references[i].minDistance, normalized * 9999f); - break; - } - Gizmos.Color = Color.red; - Gizmos.Line(references[i].target.position, references[i].target.position + normalized * references[i].minDistance); - Gizmos.Color = Color.green; - Gizmos.Line(references[i].target.position + normalized * references[i].minDistance, references[i].target.position + normalized * references[i].maxDistance); - break; - } - } + if (references[i].minDistance == 0f) + { + if (references[i].maxDistance == 0f) + { + Gizmos.Color = Color.green; + Gizmos.Line(references[i].target.position, normalized * 9999f); + break; + } + Gizmos.Color = Color.green; + Gizmos.Line(references[i].target.position, references[i].target.position + normalized * references[i].maxDistance); + break; + } + else + { + if (references[i].maxDistance == 0f) + { + Gizmos.Color = Color.red; + Gizmos.Line(references[i].target.position, references[i].target.position + normalized * references[i].minDistance); + Gizmos.Color = Color.green; + Gizmos.Line(references[i].target.position + normalized * references[i].minDistance, normalized * 9999f); + break; + } + Gizmos.Color = Color.red; + Gizmos.Line(references[i].target.position, references[i].target.position + normalized * references[i].minDistance); + Gizmos.Color = Color.green; + Gizmos.Line(references[i].target.position + normalized * references[i].minDistance, references[i].target.position + normalized * references[i].maxDistance); + break; + } + } } } } \ No newline at end of file diff --git a/CVRGizmos/Main.cs b/CVRGizmos/Main.cs index 966b1f8..f8896a0 100644 --- a/CVRGizmos/Main.cs +++ b/CVRGizmos/Main.cs @@ -1,28 +1,22 @@ using ABI_RC.Core.Player; using MelonLoader; -using UnityEngine; using System.Collections; namespace CVRGizmos; public class CVRGizmos : MelonMod { + public static readonly MelonPreferences_Category CategoryCVRGizmos = + MelonPreferences.CreateCategory(nameof(CVRGizmos)); - private static MelonPreferences_Category m_categoryCVRGizmos; - private static MelonPreferences_Entry m_entryCVRGizmosEnabled; - private static MelonPreferences_Entry m_entryCVRGizmosLocalOnly; + public static readonly MelonPreferences_Entry EntryEnabled = + CategoryCVRGizmos.CreateEntry("Enabled", false, description: "Toggle CVR Gizmos entirely.", dont_save_default: true); - public override void OnApplicationStart() + public static readonly MelonPreferences_Entry EntryLocalOnly = + CategoryCVRGizmos.CreateEntry("Local Only", false, description: "Toggle CVR Gizmos local-only mode.", dont_save_default: true); + + public override void OnInitializeMelon() { - m_categoryCVRGizmos = MelonPreferences.CreateCategory(nameof(CVRGizmos)); - m_entryCVRGizmosEnabled = m_categoryCVRGizmos.CreateEntry("Enabled", false); - m_entryCVRGizmosLocalOnly = m_categoryCVRGizmos.CreateEntry("Local Only", false); - m_entryCVRGizmosEnabled.Value = false; - - m_categoryCVRGizmos.SaveToFile(false); - m_entryCVRGizmosEnabled.OnValueChangedUntyped += CVRGizmosEnabled; - m_entryCVRGizmosLocalOnly.OnValueChangedUntyped += CVRGizmosLocalOnly; - MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer()); } @@ -37,13 +31,13 @@ public class CVRGizmos : MelonMod public void CVRGizmosEnabled() { if (!CVRGizmoManager.Instance) return; - CVRGizmoManager.Instance.EnableGizmos(m_entryCVRGizmosEnabled.Value); + CVRGizmoManager.Instance.EnableGizmos(EntryEnabled.Value); } public void CVRGizmosLocalOnly() { if (!CVRGizmoManager.Instance) return; - CVRGizmoManager.Instance.g_localOnly = m_entryCVRGizmosLocalOnly.Value; + CVRGizmoManager.Instance.g_localOnly = EntryLocalOnly.Value; CVRGizmoManager.Instance.RefreshGizmos(); } } \ No newline at end of file diff --git a/CVRGizmos/Properties/AssemblyInfo.cs b/CVRGizmos/Properties/AssemblyInfo.cs index d2b3a01..8229f91 100644 --- a/CVRGizmos/Properties/AssemblyInfo.cs +++ b/CVRGizmos/Properties/AssemblyInfo.cs @@ -2,7 +2,6 @@ using MelonLoader; using System.Reflection; - [assembly: AssemblyVersion(AssemblyInfoParams.Version)] [assembly: AssemblyFileVersion(AssemblyInfoParams.Version)] [assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)] @@ -15,7 +14,7 @@ using System.Reflection; nameof(CVRGizmos), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/CVRGizmos" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/CVRGizmos" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/CVRGizmos/format.json b/CVRGizmos/format.json index 3a4a254..c0b8cd9 100644 --- a/CVRGizmos/format.json +++ b/CVRGizmos/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/CVRGizmos/releases/download/r2/CVRGizmos.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/CVRGizmos/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/CVRGizmos.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/CVRGizmos/", "changelog": "Added option to scale player collision. Fixed some VR specific issues.", "embedcolor": "804221" } \ No newline at end of file diff --git a/ChatBoxExtensions/Integrations/ChilloutVRBase.cs b/ChatBoxExtensions/Integrations/ChilloutVRBase.cs index 9898c64..c4cc313 100644 --- a/ChatBoxExtensions/Integrations/ChilloutVRBase.cs +++ b/ChatBoxExtensions/Integrations/ChilloutVRBase.cs @@ -1,6 +1,5 @@ using ABI_RC.Core; using ABI_RC.Core.Base; -using Kafe.ChatBox; namespace NAK.ChatBoxExtensions.Integrations; diff --git a/ChatBoxExtensions/Integrations/Commands.cs b/ChatBoxExtensions/Integrations/Commands.cs index 373059f..a0d54be 100644 --- a/ChatBoxExtensions/Integrations/Commands.cs +++ b/ChatBoxExtensions/Integrations/Commands.cs @@ -1,25 +1,30 @@ namespace NAK.ChatBoxExtensions.Integrations; -public static class Commands { +public static class Commands +{ private const string Character = "/"; private static readonly List CommandList = new(); - internal static void InitializeCommandHandlers() { + internal static void InitializeCommandHandlers() + { Kafe.ChatBox.API.OnMessageSent += (source, msg, notification, displayMsg) => HandleSentCommand(msg, notification, displayMsg); Kafe.ChatBox.API.OnMessageReceived += (source, sender, msg, notification, displayMsg) => HandleReceivedCommand(sender, msg, notification, displayMsg); } - internal static void RegisterCommand(string prefix, Action onCommandSent = null, Action onCommandReceived = null) { + internal static void RegisterCommand(string prefix, Action onCommandSent = null, Action onCommandReceived = null) + { var cmd = new Command { Prefix = prefix, OnCommandSent = onCommandSent, OnCommandReceived = onCommandReceived }; CommandList.Add(cmd); } - internal static void UnregisterCommand(string prefix) { + internal static void UnregisterCommand(string prefix) + { CommandList.RemoveAll(cmd => cmd.Prefix == prefix); } - private class Command { + private class Command + { internal string Prefix; @@ -30,16 +35,20 @@ public static class Commands { internal Action OnCommandReceived; } - private static void HandleSentCommand(string message, bool notification, bool displayMsg) { + private static void HandleSentCommand(string message, bool notification, bool displayMsg) + { if (!message.StartsWith(Character)) return; - foreach (var command in CommandList.Where(command => message.StartsWith(Character + command.Prefix))) { + foreach (var command in CommandList.Where(command => message.StartsWith(Character + command.Prefix))) + { command.OnCommandSent?.Invoke(message, notification, displayMsg); } } - private static void HandleReceivedCommand(string sender, string message, bool notification, bool displayMsg) { + private static void HandleReceivedCommand(string sender, string message, bool notification, bool displayMsg) + { if (!message.StartsWith(Character)) return; - foreach (var command in CommandList.Where(command => message.StartsWith(Character + command.Prefix))) { + foreach (var command in CommandList.Where(command => message.StartsWith(Character + command.Prefix))) + { command.OnCommandReceived?.Invoke(sender, message, notification, displayMsg); } } diff --git a/ChatBoxExtensions/Properties/AssemblyInfo.cs b/ChatBoxExtensions/Properties/AssemblyInfo.cs index 5a74a41..0d38c69 100644 --- a/ChatBoxExtensions/Properties/AssemblyInfo.cs +++ b/ChatBoxExtensions/Properties/AssemblyInfo.cs @@ -15,7 +15,7 @@ using System.Reflection; nameof(NAK.ChatBoxExtensions), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/ChatBoxExtensions" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/ChatBoxExtensions" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/ChatBoxExtensions/format.json b/ChatBoxExtensions/format.json index 93fc8ff..b9e9c53 100644 --- a/ChatBoxExtensions/format.json +++ b/ChatBoxExtensions/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/ChatBoxExtensions/releases/download/v1.0.1/ChatBoxExtensions.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/ChatBoxExtensions/", - "changelog": "- Initial Release\n- No double patching. Bad. Stinky. Dont do it.", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/ChatBoxExtensions.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/ChatBoxExtensions/", + "changelog": "", "embedcolor": "#ffc700" } \ No newline at end of file diff --git a/ClearHudNotifications/Properties/AssemblyInfo.cs b/ClearHudNotifications/Properties/AssemblyInfo.cs index 110ccfc..673a2dc 100644 --- a/ClearHudNotifications/Properties/AssemblyInfo.cs +++ b/ClearHudNotifications/Properties/AssemblyInfo.cs @@ -1,5 +1,5 @@ -using NAK.ClearHudNotifications.Properties; -using MelonLoader; +using MelonLoader; +using NAK.ClearHudNotifications.Properties; using System.Reflection; @@ -15,7 +15,7 @@ using System.Reflection; nameof(NAK.ClearHudNotifications), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/UndoPropButton" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/UndoPropButton" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/ClearHudNotifications/format.json b/ClearHudNotifications/format.json index 3bd0267..f679635 100644 --- a/ClearHudNotifications/format.json +++ b/ClearHudNotifications/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/ClearHudNotifications/releases/download/v1.0.0/ClearHudNotifications.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/ClearHudNotifications/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/ClearHudNotifications.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/ClearHudNotifications/", "changelog": "- Initial Release", "embedcolor": "#6495ED" } \ No newline at end of file diff --git a/DesktopVRIK/DesktopVRIKSystem.cs b/DesktopVRIK/DesktopVRIKSystem.cs index ebdae76..98bf02d 100644 --- a/DesktopVRIK/DesktopVRIKSystem.cs +++ b/DesktopVRIK/DesktopVRIKSystem.cs @@ -200,7 +200,7 @@ internal class DesktopVRIKSystem : MonoBehaviour _cameraTransform = playerSetup.desktopCamera.transform; - DesktopVRIKMod.UpdateAllSettings(); + DesktopVRIK.UpdateAllSettings(); } void Update() diff --git a/DesktopVRIK/HarmonyPatches.cs b/DesktopVRIK/HarmonyPatches.cs index 3feeb70..e973986 100644 --- a/DesktopVRIK/HarmonyPatches.cs +++ b/DesktopVRIK/HarmonyPatches.cs @@ -1,7 +1,6 @@ using ABI_RC.Core.Player; using HarmonyLib; using UnityEngine; -using ABI.CCK.Components; /** diff --git a/DesktopVRIK/Integrations/BTKUIAddon.cs b/DesktopVRIK/Integrations/BTKUIAddon.cs index 98212a7..6d13f0d 100644 --- a/DesktopVRIK/Integrations/BTKUIAddon.cs +++ b/DesktopVRIK/Integrations/BTKUIAddon.cs @@ -12,35 +12,35 @@ public static class BTKUIAddon //Add myself to the Misc Menu Page miscPage = QuickMenuAPI.MiscTabPage; - Category miscCategory = miscPage.AddCategory(DesktopVRIKMod.SettingsCategory); + Category miscCategory = miscPage.AddCategory(DesktopVRIK.SettingsCategory); - AddMelonToggle(ref miscCategory, DesktopVRIKMod.EntryEnabled); + AddMelonToggle(ref miscCategory, DesktopVRIK.EntryEnabled); //Add my own page to not clog up Misc Menu Page desktopVRIKPage = miscCategory.AddPage("DesktopVRIK Settings", "", "Configure the settings for DesktopVRIK.", "DesktopVRIK"); desktopVRIKPage.MenuTitle = "DesktopVRIK Settings"; - Category desktopVRIKCategory = desktopVRIKPage.AddCategory(DesktopVRIKMod.SettingsCategory); - + Category desktopVRIKCategory = desktopVRIKPage.AddCategory(DesktopVRIK.SettingsCategory); + // General Settings - AddMelonToggle(ref desktopVRIKCategory, DesktopVRIKMod.EntryPlantFeet); - + AddMelonToggle(ref desktopVRIKCategory, DesktopVRIK.EntryPlantFeet); + // Calibration Settings - AddMelonToggle(ref desktopVRIKCategory, DesktopVRIKMod.EntryUseVRIKToes); - AddMelonToggle(ref desktopVRIKCategory, DesktopVRIKMod.EntryFindUnmappedToes); - + AddMelonToggle(ref desktopVRIKCategory, DesktopVRIK.EntryUseVRIKToes); + AddMelonToggle(ref desktopVRIKCategory, DesktopVRIK.EntryFindUnmappedToes); + // Fine-tuning Settings - AddMelonToggle(ref desktopVRIKCategory, DesktopVRIKMod.EntryResetFootstepsOnIdle); - + AddMelonToggle(ref desktopVRIKCategory, DesktopVRIK.EntryResetFootstepsOnIdle); + // Body Leaning Weight - AddMelonSlider(ref desktopVRIKPage, DesktopVRIKMod.EntryBodyLeanWeight, 0, 1f, 1); + AddMelonSlider(ref desktopVRIKPage, DesktopVRIK.EntryBodyLeanWeight, 0, 1f, 1); // Max Root Heading Limit & Weights - AddMelonSlider(ref desktopVRIKPage, DesktopVRIKMod.EntryBodyHeadingLimit, 0, 90f, 0); - AddMelonSlider(ref desktopVRIKPage, DesktopVRIKMod.EntryPelvisHeadingWeight, 0, 1f, 1); - AddMelonSlider(ref desktopVRIKPage, DesktopVRIKMod.EntryChestHeadingWeight, 0, 1f, 1); + AddMelonSlider(ref desktopVRIKPage, DesktopVRIK.EntryBodyHeadingLimit, 0, 90f, 0); + AddMelonSlider(ref desktopVRIKPage, DesktopVRIK.EntryPelvisHeadingWeight, 0, 1f, 1); + AddMelonSlider(ref desktopVRIKPage, DesktopVRIK.EntryChestHeadingWeight, 0, 1f, 1); // Lerp Speed - AddMelonSlider(ref desktopVRIKPage, DesktopVRIKMod.EntryIKLerpSpeed, 0, 20f, 0); + AddMelonSlider(ref desktopVRIKPage, DesktopVRIK.EntryIKLerpSpeed, 0, 20f, 0); } private static void AddMelonToggle(ref Category category, MelonLoader.MelonPreferences_Entry entry) diff --git a/DesktopVRIK/Main.cs b/DesktopVRIK/Main.cs index a14d5cb..0239aaf 100644 --- a/DesktopVRIK/Main.cs +++ b/DesktopVRIK/Main.cs @@ -3,11 +3,13 @@ using UnityEngine; namespace NAK.DesktopVRIK; -public class DesktopVRIKMod : MelonMod +public class DesktopVRIK : MelonMod { internal static MelonLogger.Instance Logger; - public const string SettingsCategory = "DesktopVRIK"; - public static readonly MelonPreferences_Category CategoryDesktopVRIK = MelonPreferences.CreateCategory(SettingsCategory); + internal const string SettingsCategory = nameof(DesktopVRIK); + + public static readonly MelonPreferences_Category CategoryDesktopVRIK = + MelonPreferences.CreateCategory(SettingsCategory); public static readonly MelonPreferences_Entry EntryEnabled = CategoryDesktopVRIK.CreateEntry("Enabled", true, description: "Toggle DesktopVRIK entirely. Requires avatar reload."); @@ -97,7 +99,7 @@ public class DesktopVRIKMod : MelonMod // Integration Settings DesktopVRIKSystem.Instance.Setting_IntegrationAMT = EntryIntegrationAMT.Value && integration_AMT; - + // Funny Settings DesktopVRIKSystem.Instance.Setting_ProneThrusting = EntryProneThrusting.Value; } diff --git a/DesktopVRIK/Properties/AssemblyInfo.cs b/DesktopVRIK/Properties/AssemblyInfo.cs index de5bf05..61ac95a 100644 --- a/DesktopVRIK/Properties/AssemblyInfo.cs +++ b/DesktopVRIK/Properties/AssemblyInfo.cs @@ -10,11 +10,11 @@ using System.Reflection; [assembly: AssemblyProduct(nameof(NAK.DesktopVRIK))] [assembly: MelonInfo( - typeof(NAK.DesktopVRIK.DesktopVRIKMod), + typeof(NAK.DesktopVRIK.DesktopVRIK), nameof(NAK.DesktopVRIK), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/DesktopVRIK" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/DesktopVRIK" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/DesktopVRIK/format.json b/DesktopVRIK/format.json index 70822ee..1aa33db 100644 --- a/DesktopVRIK/format.json +++ b/DesktopVRIK/format.json @@ -17,8 +17,8 @@ "requirements": [ "BTKUILib" ], - "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r2/DesktopVRIK.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/DesktopVRIK", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/DesktopVRIK.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/DesktopVRIK/", "changelog": "- Fixed feet targeting previous movement parent position for a frame.\n- Fixed issue with incorrect initialHeadHeight value causing avatar to always have footsteps disabled.", "embedcolor": "9b59b6" } \ No newline at end of file diff --git a/DesktopVRSwitch/DesktopVRSwitch.cs b/DesktopVRSwitch/DesktopVRSwitcher.cs similarity index 92% rename from DesktopVRSwitch/DesktopVRSwitch.cs rename to DesktopVRSwitch/DesktopVRSwitcher.cs index d4c3419..f02261b 100644 --- a/DesktopVRSwitch/DesktopVRSwitch.cs +++ b/DesktopVRSwitch/DesktopVRSwitcher.cs @@ -6,7 +6,7 @@ using Valve.VR; namespace NAK.DesktopVRSwitch; -public class DesktopVRSwitch : MonoBehaviour +public class DesktopVRSwitcher : MonoBehaviour { //Debug Settings public bool _reloadLocalAvatar = true; @@ -52,7 +52,7 @@ public class DesktopVRSwitch : MonoBehaviour yield return null; //wait a frame before checking if (!string.IsNullOrEmpty(XRSettings.loadedDeviceName)) { - DesktopVRSwitchMod.Logger.Msg("Starting SteamVR..."); + DesktopVRSwitch.Logger.Msg("Starting SteamVR..."); XRSettings.enabled = true; //force steamvr to reinitialize input //this does SteamVR_Input.actionSets[0].Activate() for us (we deactivate in StopVR()) @@ -63,7 +63,7 @@ public class DesktopVRSwitch : MonoBehaviour PostVRModeSwitch(true); yield break; } - DesktopVRSwitchMod.Logger.Error("Initializing VR Failed. Is there no VR device connected?"); + DesktopVRSwitch.Logger.Error("Initializing VR Failed. Is there no VR device connected?"); FailedVRModeSwitch(true); yield break; } @@ -84,7 +84,7 @@ public class DesktopVRSwitch : MonoBehaviour PostVRModeSwitch(false); yield break; } - DesktopVRSwitchMod.Logger.Error("Attempted to exit VR without a VR device loaded."); + DesktopVRSwitch.Logger.Error("Attempted to exit VR without a VR device loaded."); FailedVRModeSwitch(false); yield break; } diff --git a/DesktopVRSwitch/HarmonyPatches.cs b/DesktopVRSwitch/HarmonyPatches.cs index 462586a..30c4f8d 100644 --- a/DesktopVRSwitch/HarmonyPatches.cs +++ b/DesktopVRSwitch/HarmonyPatches.cs @@ -19,11 +19,11 @@ internal class PlayerSetupPatches { if (CheckVR.Instance != null) { - CheckVR.Instance.gameObject.AddComponent(); + CheckVR.Instance.gameObject.AddComponent(); return; } - __instance.gameObject.AddComponent(); - DesktopVRSwitchMod.Logger.Error("CheckVR not found. Reverting to fallback method. This should never happen!"); + __instance.gameObject.AddComponent(); + DesktopVRSwitch.Logger.Error("CheckVR not found. Reverting to fallback method. This should never happen!"); } } diff --git a/DesktopVRSwitch/Main.cs b/DesktopVRSwitch/Main.cs index 42953c9..7add8b2 100644 --- a/DesktopVRSwitch/Main.cs +++ b/DesktopVRSwitch/Main.cs @@ -15,21 +15,19 @@ namespace NAK.DesktopVRSwitch; -public class DesktopVRSwitchMod : MelonMod +public class DesktopVRSwitch : MelonMod { - internal const string SettingsCategory = "DesktopVRSwitch"; - internal static MelonPreferences_Category mCategory; internal static MelonLogger.Instance Logger; - internal static MelonPreferences_Entry - mSetting_EnterCalibrationOnSwitch; + public static readonly MelonPreferences_Category Category = + MelonPreferences.CreateCategory(nameof(DesktopVRSwitch)); + + public static readonly MelonPreferences_Entry EntryEnterCalibrationOnSwitch = + Category.CreateEntry("Enter Calibration on Switch", true, "Should you automatically be placed into calibration after switch if FBT is available? Overridden by Save Calibration IK setting."); public override void OnInitializeMelon() { Logger = LoggerInstance; - mCategory = MelonPreferences.CreateCategory(SettingsCategory); - mSetting_EnterCalibrationOnSwitch = mCategory.CreateEntry("Enter Calibration on Switch", true, description: "Should you automatically be placed into calibration after switch if FBT is available? Overridden by Save Calibration IK setting."); - ApplyPatches(typeof(HarmonyPatches.PlayerSetupPatches)); ApplyPatches(typeof(HarmonyPatches.CVRPickupObjectPatches)); ApplyPatches(typeof(HarmonyPatches.CVRWorldPatches)); diff --git a/DesktopVRSwitch/Patches/IKSystemTracker.cs b/DesktopVRSwitch/Patches/IKSystemTracker.cs index b0f2e6b..c87b626 100644 --- a/DesktopVRSwitch/Patches/IKSystemTracker.cs +++ b/DesktopVRSwitch/Patches/IKSystemTracker.cs @@ -45,7 +45,7 @@ public class IKSystemTracker : MonoBehaviour } //make it so you dont instantly end up in FBT from Desktop - IKSystem.firstAvatarLoaded = DesktopVRSwitchMod.mSetting_EnterCalibrationOnSwitch.Value; + IKSystem.firstAvatarLoaded = DesktopVRSwitch.EntryEnterCalibrationOnSwitch.Value; //turn of finger tracking just in case user switched controllers ikSystem.FingerSystem.controlActive = false; } diff --git a/DesktopVRSwitch/Patches/ReferenceCameraPatch.cs b/DesktopVRSwitch/Patches/ReferenceCameraPatch.cs index 25dc8bc..cb547e7 100644 --- a/DesktopVRSwitch/Patches/ReferenceCameraPatch.cs +++ b/DesktopVRSwitch/Patches/ReferenceCameraPatch.cs @@ -21,7 +21,7 @@ internal class ReferenceCameraPatch internal static void CopyToInactiveCam(Camera activeCam, Camera inactiveCam) { - DesktopVRSwitchMod.Logger.Msg("Copying active camera settings & components to inactive camera."); + DesktopVRSwitch.Logger.Msg("Copying active camera settings & components to inactive camera."); //steal basic settings inactiveCam.farClipPlane = activeCam.farClipPlane; diff --git a/DesktopVRSwitch/Patches/VRModeSwitchTracker.cs b/DesktopVRSwitch/Patches/VRModeSwitchTracker.cs index 09d9c18..4ca10e6 100644 --- a/DesktopVRSwitch/Patches/VRModeSwitchTracker.cs +++ b/DesktopVRSwitch/Patches/VRModeSwitchTracker.cs @@ -14,7 +14,7 @@ public class VRModeSwitchTracker { TryCatchHell.TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg("Invoking VRModeSwitchTracker.OnPreVRModeSwitch."); + DesktopVRSwitch.Logger.Msg("Invoking VRModeSwitchTracker.OnPreVRModeSwitch."); Camera activeCamera = PlayerSetup.Instance.GetActiveCamera().GetComponent(); VRModeSwitchTracker.OnPreVRModeSwitch?.Invoke(isVR, activeCamera); }, @@ -25,7 +25,7 @@ public class VRModeSwitchTracker { TryCatchHell.TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg("Invoking VRModeSwitchTracker.OnPostVRModeSwitch."); + DesktopVRSwitch.Logger.Msg("Invoking VRModeSwitchTracker.OnPostVRModeSwitch."); Camera activeCamera = PlayerSetup.Instance.GetActiveCamera().GetComponent(); VRModeSwitchTracker.OnPostVRModeSwitch?.Invoke(isVR, activeCamera); }, @@ -36,7 +36,7 @@ public class VRModeSwitchTracker { TryCatchHell.TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg("Invoking VRModeSwitchTracker.OnFailVRModeSwitch."); + DesktopVRSwitch.Logger.Msg("Invoking VRModeSwitchTracker.OnFailVRModeSwitch."); Camera activeCamera = PlayerSetup.Instance.GetActiveCamera().GetComponent(); VRModeSwitchTracker.OnFailVRModeSwitch?.Invoke(isVR, activeCamera); }, diff --git a/DesktopVRSwitch/Properties/AssemblyInfo.cs b/DesktopVRSwitch/Properties/AssemblyInfo.cs index bd56d33..a262665 100644 --- a/DesktopVRSwitch/Properties/AssemblyInfo.cs +++ b/DesktopVRSwitch/Properties/AssemblyInfo.cs @@ -10,11 +10,11 @@ using System.Reflection; [assembly: AssemblyProduct(nameof(NAK.DesktopVRSwitch))] [assembly: MelonInfo( - typeof(NAK.DesktopVRSwitch.DesktopVRSwitchMod), + typeof(NAK.DesktopVRSwitch.DesktopVRSwitch), nameof(NAK.DesktopVRSwitch), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/DesktopVRSwitch" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/DesktopVRSwitch" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/DesktopVRSwitch/TryCatchHell.cs b/DesktopVRSwitch/TryCatchHell.cs index 89b664e..502ed36 100644 --- a/DesktopVRSwitch/TryCatchHell.cs +++ b/DesktopVRSwitch/TryCatchHell.cs @@ -20,8 +20,8 @@ internal class TryCatchHell } catch (Exception ex) { - DesktopVRSwitchMod.Logger.Error(string.Format(errorMsg, msgArgs)); - DesktopVRSwitchMod.Logger.Msg(ex.Message); + DesktopVRSwitch.Logger.Error(string.Format(errorMsg, msgArgs)); + DesktopVRSwitch.Logger.Msg(ex.Message); } } @@ -29,7 +29,7 @@ internal class TryCatchHell { TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg("Closing ViewManager & CVR_MenuManager menus."); + DesktopVRSwitch.Logger.Msg("Closing ViewManager & CVR_MenuManager menus."); ViewManager.Instance.UiStateToggle(false); CVR_MenuManager.Instance.ToggleQuickMenu(false); }, @@ -40,7 +40,7 @@ internal class TryCatchHell { TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg($"Setting CheckVR hasVrDeviceLoaded to {isVR}."); + DesktopVRSwitch.Logger.Msg($"Setting CheckVR hasVrDeviceLoaded to {isVR}."); CheckVR.Instance.hasVrDeviceLoaded = isVR; }, "Setting CheckVR hasVrDeviceLoaded failed."); @@ -50,7 +50,7 @@ internal class TryCatchHell { TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg($"Setting MetaPort isUsingVr to {isVR}."); + DesktopVRSwitch.Logger.Msg($"Setting MetaPort isUsingVr to {isVR}."); MetaPort.Instance.isUsingVr = isVR; }, "Setting MetaPort isUsingVr failed."); @@ -60,7 +60,7 @@ internal class TryCatchHell { TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg("Configuring new hud affinity for CohtmlHud."); + DesktopVRSwitch.Logger.Msg("Configuring new hud affinity for CohtmlHud."); CohtmlHud.Instance.gameObject.transform.parent = isVR ? PlayerSetup.Instance.vrCamera.transform : PlayerSetup.Instance.desktopCamera.transform; CVRTools.ConfigureHudAffinity(); CohtmlHud.Instance.gameObject.transform.localScale = new Vector3(1.2f, 1f, 1.2f); @@ -72,7 +72,7 @@ internal class TryCatchHell { TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg("Switching HudOperations worldLoadingItem & worldLoadStatus."); + DesktopVRSwitch.Logger.Msg("Switching HudOperations worldLoadingItem & worldLoadStatus."); HudOperations.Instance.worldLoadingItem = isVR ? HudOperations.Instance.worldLoadingItemVr : HudOperations.Instance.worldLoadingItemDesktop; HudOperations.Instance.worldLoadStatus = isVR ? HudOperations.Instance.worldLoadStatusVr : HudOperations.Instance.worldLoadStatusDesktop; }, @@ -83,7 +83,7 @@ internal class TryCatchHell { TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg("Forcing PortableCamera canvas mirroring off."); + DesktopVRSwitch.Logger.Msg("Forcing PortableCamera canvas mirroring off."); //tell the game we are in mirror mode so itll disable it (if enabled) PortableCamera.Instance.mode = MirroringMode.Mirror; PortableCamera.Instance.ChangeMirroring(); @@ -95,7 +95,7 @@ internal class TryCatchHell { TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg("Switching active PlayerSetup camera rigs. Updating Desktop camera FOV."); + DesktopVRSwitch.Logger.Msg("Switching active PlayerSetup camera rigs. Updating Desktop camera FOV."); PlayerSetup.Instance.desktopCameraRig.SetActive(!isVR); PlayerSetup.Instance.vrCameraRig.SetActive(isVR); CVR_DesktopCameraController.UpdateFov(); @@ -110,7 +110,7 @@ internal class TryCatchHell { TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg($"Setting CVRInputManager inputEnabled & CVR_InteractableManager enableInteractions to {!toggle}"); + DesktopVRSwitch.Logger.Msg($"Setting CVRInputManager inputEnabled & CVR_InteractableManager enableInteractions to {!toggle}"); CVRInputManager.Instance.inputEnabled = !toggle; CVR_InteractableManager.enableInteractions = !toggle; }, @@ -121,7 +121,7 @@ internal class TryCatchHell { TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg("Resetting CVRInputManager inputs."); + DesktopVRSwitch.Logger.Msg("Resetting CVRInputManager inputs."); //just in case CVRInputManager.Instance.blockedByUi = false; //sometimes head can get stuck, so just in case @@ -141,7 +141,7 @@ internal class TryCatchHell { TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg("Attempting to reload current local avatar from GUID."); + DesktopVRSwitch.Logger.Msg("Attempting to reload current local avatar from GUID."); AssetManagement.Instance.LoadLocalAvatar(MetaPort.Instance.currentAvatarGuid); }, "Failed to reload local avatar."); @@ -153,13 +153,13 @@ internal class TryCatchHell { if (MetaPort.Instance.settings.GetSettingsBool("ImplementationRichPresenceDiscordEnabled", true)) { - DesktopVRSwitchMod.Logger.Msg("Forcing Discord Rich Presence update."); + DesktopVRSwitch.Logger.Msg("Forcing Discord Rich Presence update."); MetaPort.Instance.settings.SetSettingsBool("ImplementationRichPresenceDiscordEnabled", false); MetaPort.Instance.settings.SetSettingsBool("ImplementationRichPresenceDiscordEnabled", true); } if (MetaPort.Instance.settings.GetSettingsBool("ImplementationRichPresenceSteamEnabled", true)) { - DesktopVRSwitchMod.Logger.Msg("Forcing Steam Rich Presence update."); + DesktopVRSwitch.Logger.Msg("Forcing Steam Rich Presence update."); MetaPort.Instance.settings.SetSettingsBool("ImplementationRichPresenceSteamEnabled", false); MetaPort.Instance.settings.SetSettingsBool("ImplementationRichPresenceSteamEnabled", true); } @@ -171,7 +171,7 @@ internal class TryCatchHell { TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg("Updating CVRGestureRecognizer _camera to active camera."); + DesktopVRSwitch.Logger.Msg("Updating CVRGestureRecognizer _camera to active camera."); Traverse.Create(CVRGestureRecognizer.Instance).Field("_camera").SetValue(PlayerSetup.Instance.GetActiveCamera().GetComponent()); }, "Failed to update CVRGestureRecognizer camera."); @@ -181,7 +181,7 @@ internal class TryCatchHell { TryCatchWrapper(() => { - DesktopVRSwitchMod.Logger.Msg("Updating CVR_Menu_Data core data."); + DesktopVRSwitch.Logger.Msg("Updating CVR_Menu_Data core data."); CVR_MenuManager.Instance.coreData.core.inVr = isVR; }, "Failed to update CVR_Menu_Data core data."); diff --git a/DesktopVRSwitch/format.json b/DesktopVRSwitch/format.json index 0373abd..4920d1d 100644 --- a/DesktopVRSwitch/format.json +++ b/DesktopVRSwitch/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/DesktopVRSwitch/releases/download/v4.3.5/DesktopVRSwitch.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/DesktopVRSwitch/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/DesktopVRSwitch.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/DesktopVRSwitch/", "changelog": "- Reinitialize SteamVR input on switch. Correct fixedDeltaTime when entering Desktop.\n- Tweak to initial switch position for correcting offsets.\n- Fixed FBT tracking point initial size.\n- Update core menu data so QM Recalibrate/SeatedPlay button works.", "embedcolor": "3498db" } \ No newline at end of file diff --git a/FuckMetrics/FuckMetrics.cs b/FuckMetrics/FuckMetrics.cs deleted file mode 100644 index c889ec2..0000000 --- a/FuckMetrics/FuckMetrics.cs +++ /dev/null @@ -1,92 +0,0 @@ -using ABI_RC.Core.InteractionSystem; -using ABI_RC.Core.IO; -using cohtml; -using HarmonyLib; -using UnityEngine; - -namespace NAK.FuckMetrics; - -public static class FuckMetrics -{ - public enum SettingState - { - Always, - MenuOnly, - Disabled - } - - public static void ToggleMetrics(bool enable) - { - var job = SchedulerSystem.Instance.activeJobs.FirstOrDefault(pair => pair.Job.Method.Name == "UpdateMetrics").Job; - if (enable && job == null) - { - SchedulerSystem.AddJob(new SchedulerSystem.Job(ViewManager.Instance.UpdateMetrics), 0f, FuckMetricsMod.EntryMetricsUpdateRate.Value, -1); - } - else if (!enable && job != null) - { - SchedulerSystem.RemoveJob(job); - } - } - - public static void ToggleCoreUpdates(bool enable) - { - var job = SchedulerSystem.Instance.activeJobs.FirstOrDefault(pair => pair.Job.Method.Name == "SendCoreUpdate").Job; - if (enable && job == null) - { - SchedulerSystem.AddJob(new SchedulerSystem.Job(CVR_MenuManager.Instance.SendCoreUpdate), 0f, FuckMetricsMod.EntryCoreUpdateRate.Value, -1); - } - else if (!enable && job != null) - { - SchedulerSystem.RemoveJob(job); - } - } - - public static void ApplyMetricsSettings(bool show) - { - var disableMetrics = FuckMetricsMod.EntryDisableMetrics.Value; - if (disableMetrics == FuckMetrics.SettingState.Always) return; - - if (disableMetrics == FuckMetrics.SettingState.MenuOnly) - { - FuckMetrics.ToggleMetrics(show); - } - else if (disableMetrics == FuckMetrics.SettingState.Disabled && show) - { - ViewManager.Instance.UpdateMetrics(); - } - } - - public static void ApplyCoreUpdatesSettings(bool show) - { - var disableCoreUpdates = FuckMetricsMod.EntryDisableCoreUpdates.Value; - if (disableCoreUpdates == FuckMetrics.SettingState.Always) return; - - if (disableCoreUpdates == FuckMetrics.SettingState.MenuOnly) - { - FuckMetrics.ToggleCoreUpdates(show); - } - else if (disableCoreUpdates == FuckMetrics.SettingState.Disabled && show) - { - CVR_MenuManager.Instance.SendCoreUpdate(); - } - } - - public static void CohtmlAdvanceView(CohtmlView cohtmlView, Traverse menuOpenTraverse) - { - if (!FuckMetricsMod.EntryDisableCohtmlViewOnIdle.Value) return; - - if (cohtmlView != null && !menuOpenTraverse.GetValue()) - { - cohtmlView.enabled = false; - - try - { - cohtmlView.View.Advance(cohtmlView.CohtmlUISystem?.Id ?? 0, (double)Time.unscaledTime * 1000.0); - } - catch (Exception e) - { - FuckMetricsMod.Logger.Error($"An exception was thrown while calling CohtmlView.Advance(). Error message: {e.Message}"); - } - } - } -} diff --git a/FuckMetrics/Main.cs b/FuckMetrics/Main.cs index c8c9b83..d94a37a 100644 --- a/FuckMetrics/Main.cs +++ b/FuckMetrics/Main.cs @@ -1,14 +1,20 @@ -using ABI_RC.Core.Player; +using ABI_RC.Core.InteractionSystem; +using ABI_RC.Core.IO; +using ABI_RC.Core.Player; +using cohtml; +using HarmonyLib; using MelonLoader; using System.Collections; +using UnityEngine; namespace NAK.FuckMetrics; -public class FuckMetricsMod : MelonMod +public class FuckMetrics : MelonMod { - public static MelonLogger.Instance Logger; - public const string SettingsCategory = "FuckMetrics"; - public static readonly MelonPreferences_Category CategoryFuckMetrics = MelonPreferences.CreateCategory(SettingsCategory); + internal static MelonLogger.Instance Logger; + + public static readonly MelonPreferences_Category CategoryFuckMetrics = + MelonPreferences.CreateCategory(nameof(FuckMetrics)); public static readonly MelonPreferences_Entry EntryDisableCohtmlViewOnIdle = CategoryFuckMetrics.CreateEntry("Disable CohtmlView On Idle", false, description: "Disables CohtmlView on the menus when idle. Takes up to 6 seconds after menu exit. This can give a huge performance boost."); @@ -95,4 +101,86 @@ public class FuckMetricsMod : MelonMod Logger.Error(e); } } + + public enum SettingState + { + Always, + MenuOnly, + Disabled + } + + public static void ToggleMetrics(bool enable) + { + var job = SchedulerSystem.Instance.activeJobs.FirstOrDefault(pair => pair.Job.Method.Name == "UpdateMetrics").Job; + if (enable && job == null) + { + SchedulerSystem.AddJob(new SchedulerSystem.Job(ViewManager.Instance.UpdateMetrics), 0f, FuckMetrics.EntryMetricsUpdateRate.Value, -1); + } + else if (!enable && job != null) + { + SchedulerSystem.RemoveJob(job); + } + } + + public static void ToggleCoreUpdates(bool enable) + { + var job = SchedulerSystem.Instance.activeJobs.FirstOrDefault(pair => pair.Job.Method.Name == "SendCoreUpdate").Job; + if (enable && job == null) + { + SchedulerSystem.AddJob(new SchedulerSystem.Job(CVR_MenuManager.Instance.SendCoreUpdate), 0f, FuckMetrics.EntryCoreUpdateRate.Value, -1); + } + else if (!enable && job != null) + { + SchedulerSystem.RemoveJob(job); + } + } + + public static void ApplyMetricsSettings(bool show) + { + var disableMetrics = FuckMetrics.EntryDisableMetrics.Value; + if (disableMetrics == FuckMetrics.SettingState.Always) return; + + if (disableMetrics == FuckMetrics.SettingState.MenuOnly) + { + FuckMetrics.ToggleMetrics(show); + } + else if (disableMetrics == FuckMetrics.SettingState.Disabled && show) + { + ViewManager.Instance.UpdateMetrics(); + } + } + + public static void ApplyCoreUpdatesSettings(bool show) + { + var disableCoreUpdates = FuckMetrics.EntryDisableCoreUpdates.Value; + if (disableCoreUpdates == FuckMetrics.SettingState.Always) return; + + if (disableCoreUpdates == FuckMetrics.SettingState.MenuOnly) + { + FuckMetrics.ToggleCoreUpdates(show); + } + else if (disableCoreUpdates == FuckMetrics.SettingState.Disabled && show) + { + CVR_MenuManager.Instance.SendCoreUpdate(); + } + } + + public static void CohtmlAdvanceView(CohtmlView cohtmlView, Traverse menuOpenTraverse) + { + if (!FuckMetrics.EntryDisableCohtmlViewOnIdle.Value) return; + + if (cohtmlView != null && !menuOpenTraverse.GetValue()) + { + cohtmlView.enabled = false; + + try + { + cohtmlView.View.Advance(cohtmlView.CohtmlUISystem?.Id ?? 0, (double)Time.unscaledTime * 1000.0); + } + catch (Exception e) + { + FuckMetrics.Logger.Error($"An exception was thrown while calling CohtmlView.Advance(). Error message: {e.Message}"); + } + } + } } \ No newline at end of file diff --git a/FuckMetrics/Properties/AssemblyInfo.cs b/FuckMetrics/Properties/AssemblyInfo.cs index cf657ca..89979e9 100644 --- a/FuckMetrics/Properties/AssemblyInfo.cs +++ b/FuckMetrics/Properties/AssemblyInfo.cs @@ -2,7 +2,6 @@ using NAK.FuckMetrics.Properties; using System.Reflection; - [assembly: AssemblyVersion(AssemblyInfoParams.Version)] [assembly: AssemblyFileVersion(AssemblyInfoParams.Version)] [assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)] @@ -11,11 +10,11 @@ using System.Reflection; [assembly: AssemblyProduct(nameof(NAK.FuckMetrics))] [assembly: MelonInfo( - typeof(NAK.FuckMetrics.FuckMetricsMod), + typeof(NAK.FuckMetrics.FuckMetrics), nameof(NAK.FuckMetrics), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/FuckMetrics" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/FuckMetrics" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/FuckMetrics/format.json b/FuckMetrics/format.json index e3d18e4..7b1ae32 100644 --- a/FuckMetrics/format.json +++ b/FuckMetrics/format.json @@ -17,8 +17,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/FuckMetrics/releases/download/v1.0.4/FuckMetrics.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/FuckMetrics/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/FuckMetrics.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/FuckMetrics/", "changelog": "- Initial Release.\n- Renamed to FuckMetrics.\n- Add Update Rate settings.\n- Add back CohtmlView disabling as option.\n- Update CoreUpdate on mic toggle if QM is open.\n- Fix Cohtml disabling not using menu instance.", "embedcolor": "#8ed6fb" } \ No newline at end of file diff --git a/FuckToes/FuckToes.cs b/FuckToes/HarmonyPatches.cs similarity index 78% rename from FuckToes/FuckToes.cs rename to FuckToes/HarmonyPatches.cs index a9b3d36..d975ef4 100644 --- a/FuckToes/FuckToes.cs +++ b/FuckToes/HarmonyPatches.cs @@ -15,9 +15,9 @@ class VRIKPatches //only run for PlayerLocal VRIK if (__instance.gameObject.layer != 8) return; - if (FuckToesMod.m_entryEnabledVR.Value && MetaPort.Instance.isUsingVr) + if (FuckToes.EntryEnabledVR.Value && MetaPort.Instance.isUsingVr) { - if (!FuckToesMod.m_entryEnabledFBT.Value && MetaPort.Instance.isUsingFullbody) return; + if (!FuckToes.EntryEnabledFBT.Value && MetaPort.Instance.isUsingFullbody) return; __instance.references.leftToes = null; __instance.references.rightToes = null; } diff --git a/FuckToes/Main.cs b/FuckToes/Main.cs index 8de4404..5e4abfa 100644 --- a/FuckToes/Main.cs +++ b/FuckToes/Main.cs @@ -2,17 +2,19 @@ namespace NAK.FuckToes; -public class FuckToesMod : MelonMod +public class FuckToes : MelonMod { - internal const string SettingsCategory = "FuckToes"; - internal static MelonPreferences_Category m_categoryFuckToes; - internal static MelonPreferences_Entry m_entryEnabledVR, m_entryEnabledFBT; + public static readonly MelonPreferences_Category Category = + MelonPreferences.CreateCategory(nameof(FuckToes)); + + public static readonly MelonPreferences_Entry EntryEnabledVR = + Category.CreateEntry("Enabled", true, "Nuke VRIK toes when in Halfbody."); + + public static readonly MelonPreferences_Entry EntryEnabledFBT = + Category.CreateEntry("Enabled in FBT", false, "Nuke VRIK toes when in FBT."); + public override void OnInitializeMelon() { - m_categoryFuckToes = MelonPreferences.CreateCategory(SettingsCategory); - m_entryEnabledVR = m_categoryFuckToes.CreateEntry("Enabled", true, description: "Nuke VRIK toes when in Halfbody."); - m_entryEnabledFBT = m_categoryFuckToes.CreateEntry("Enabled in FBT", false, description: "Nuke VRIK toes when in FBT."); - //Apply patches (i stole) ApplyPatches(typeof(HarmonyPatches.VRIKPatches)); } diff --git a/FuckToes/Properties/AssemblyInfo.cs b/FuckToes/Properties/AssemblyInfo.cs index 2d32d6c..1472056 100644 --- a/FuckToes/Properties/AssemblyInfo.cs +++ b/FuckToes/Properties/AssemblyInfo.cs @@ -2,7 +2,6 @@ using MelonLoader; using System.Reflection; - [assembly: AssemblyVersion(AssemblyInfoParams.Version)] [assembly: AssemblyFileVersion(AssemblyInfoParams.Version)] [assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)] @@ -11,11 +10,11 @@ using System.Reflection; [assembly: AssemblyProduct(nameof(NAK.FuckToes))] [assembly: MelonInfo( - typeof(NAK.FuckToes.FuckToesMod), + typeof(NAK.FuckToes.FuckToes), nameof(NAK.FuckToes), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/FuckToes" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/FuckToes" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/FuckToes/format.json b/FuckToes/format.json index 3d0f8e0..196e98a 100644 --- a/FuckToes/format.json +++ b/FuckToes/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/FuckToes/releases/download/v1.0.1/FuckToes.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/FuckToes/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/FuckToes.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/FuckToes/", "changelog": "- Initial Release\n- No double patching. Bad. Stinky. Dont do it.", "embedcolor": "#ffc700" } \ No newline at end of file diff --git a/GestureLock/HarmonyPatches.cs b/GestureLock/HarmonyPatches.cs new file mode 100644 index 0000000..eab0a87 --- /dev/null +++ b/GestureLock/HarmonyPatches.cs @@ -0,0 +1,58 @@ +using ABI_RC.Core.Player; +using ABI_RC.Core.Savior; +using ABI_RC.Core.UI; +using HarmonyLib; +using Valve.VR; + +namespace NAK.GestureLock.HarmonyPatches; + +class Patches +{ + private static bool isLocked; + private static float oldGestureLeft; + private static float oldGestureRight; + + [HarmonyPostfix] + [HarmonyPatch(typeof(InputModuleSteamVR), nameof(InputModuleSteamVR.UpdateInput))] + private static void Postfix_InputModuleSteamVR_UpdateInput + ( + ref CVRInputManager ____inputManager, + ref VRTrackerManager ____trackerManager, + ref SteamVR_Action_Boolean ___steamVrIndexGestureToggle + ) + { + if (!MetaPort.Instance.isUsingVr) + { + return; + } + + if (___steamVrIndexGestureToggle.stateDown && !____trackerManager.trackerNames.Contains("knuckles")) + { + isLocked = !isLocked; + oldGestureLeft = ____inputManager.gestureLeft; + oldGestureRight = ____inputManager.gestureRight; + CohtmlHud.Instance.ViewDropTextImmediate("", "Gesture Lock", "Gestures " + (isLocked ? "Locked" : "Unlocked")); + } + } + + [HarmonyPostfix] + [HarmonyPatch(typeof(CVRInputManager), nameof(CVRInputManager.Update))] + private static void Postfix_CVRInputManager_Update + ( + ref float ___gestureLeft, + ref float ___gestureRight + ) + { + if (!MetaPort.Instance.isUsingVr) + { + return; + } + + if (isLocked) + { + // Dont override raw, other systems like the camera gesture recognizer need it. + ___gestureLeft = oldGestureLeft; + ___gestureRight = oldGestureRight; + } + } +} \ No newline at end of file diff --git a/GestureLock/Main.cs b/GestureLock/Main.cs index 5cacf4c..78a1e86 100644 --- a/GestureLock/Main.cs +++ b/GestureLock/Main.cs @@ -1,70 +1,24 @@ -using ABI_RC.Core.Player; -using ABI_RC.Core.Savior; -using ABI_RC.Core.UI; -using HarmonyLib; -using MelonLoader; -using Valve.VR; +using MelonLoader; -//I legitimately threw this at ChatGPT to rewrite cause i couldn't be bothered. +namespace NAK.GestureLock; -namespace NAK.GestureLock +public class GestureLock : MelonMod { - public class GestureLockMod : MelonMod + public override void OnInitializeMelon() { - [HarmonyPatch] - private class HarmonyPatches + ApplyPatches(typeof(HarmonyPatches.Patches)); + } + + void ApplyPatches(Type type) + { + try { - private static bool isLocked; - private static float oldGestureLeft; - private static float oldGestureRight; - - [HarmonyPostfix] - [HarmonyPatch(typeof(InputModuleSteamVR), "UpdateInput")] - private static void Postfix_InputModuleSteamVR_UpdateInput - ( - ref CVRInputManager ____inputManager, - ref VRTrackerManager ____trackerManager, - ref SteamVR_Action_Boolean ___steamVrIndexGestureToggle - ) - { - if (!MetaPort.Instance.isUsingVr) - { - return; - } - - if (___steamVrIndexGestureToggle.stateDown && !____trackerManager.trackerNames.Contains("knuckles")) - { - isLocked = !isLocked; - oldGestureLeft = ____inputManager.gestureLeft; - oldGestureRight = ____inputManager.gestureRight; - CohtmlHud.Instance.ViewDropTextImmediate("", "Gesture Lock", "Gestures " + (isLocked ? "Locked" : "Unlocked")); - } - } - - [HarmonyPostfix] - [HarmonyPatch(typeof(CVRInputManager), "Update")] - private static void Postfix_CVRInputManager_Update - ( - ref float ___gestureLeft, - ref float ___gestureRight, - ref float ___gestureLeftRaw, - ref float ___gestureRightRaw - ) - { - if (!MetaPort.Instance.isUsingVr) - { - return; - } - - if (isLocked) - { - // Dont override raw, other systems like the camera gesture recognizer need it. - //gestureLeftRaw = gestureLeft; - //gestureRightRaw = gestureRight; - ___gestureLeft = oldGestureLeft; - ___gestureRight = oldGestureRight; - } - } + 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/GestureLock/Properties/AssemblyInfo.cs b/GestureLock/Properties/AssemblyInfo.cs index 9cd89bd..9fb0a2f 100644 --- a/GestureLock/Properties/AssemblyInfo.cs +++ b/GestureLock/Properties/AssemblyInfo.cs @@ -10,11 +10,11 @@ using System.Reflection; [assembly: AssemblyProduct(nameof(NAK.GestureLock))] [assembly: MelonInfo( - typeof(NAK.GestureLock.GestureLockMod), + typeof(NAK.GestureLock.GestureLock), nameof(NAK.GestureLock), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/GestureLock" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/GestureLock" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/GestureLock/format.json b/GestureLock/format.json index 4baff42..6630fa4 100644 --- a/GestureLock/format.json +++ b/GestureLock/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/GestureLock/releases/download/v2.0.0/GestureLock.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/GestureLock/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/GestureLock.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/GestureLock/", "changelog": "- Simplification & refactor.", "embedcolor": "804221" } \ No newline at end of file diff --git a/IKFixes/Main.cs b/IKFixes/Main.cs index 605f37d..485e63c 100644 --- a/IKFixes/Main.cs +++ b/IKFixes/Main.cs @@ -4,8 +4,8 @@ namespace NAK.IKFixes; public class IKFixes : MelonMod { - public const string SettingsCategory = nameof(IKFixes); - public static readonly MelonPreferences_Category Category = MelonPreferences.CreateCategory(SettingsCategory); + public static readonly MelonPreferences_Category Category = + MelonPreferences.CreateCategory(nameof(IKFixes)); public static readonly MelonPreferences_Entry EntryUseFakeRootAngle = Category.CreateEntry("Use Fake Root Angle", true, description: "Emulates maxRootAngle. This fixes feet pointing in direction of head when looking around."); diff --git a/IKFixes/Properties/AssemblyInfo.cs b/IKFixes/Properties/AssemblyInfo.cs index 477dfff..931fe42 100644 --- a/IKFixes/Properties/AssemblyInfo.cs +++ b/IKFixes/Properties/AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; nameof(NAK.IKFixes), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/IKFixes" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/IKFixes" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/IKFixes/format.json b/IKFixes/format.json index d8c7e74..0c281ea 100644 --- a/IKFixes/format.json +++ b/IKFixes/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r2/IKFixes.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/IKFixes.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/IKFixes/", "changelog": "- Fixed feet targeting previous movement parent position for a frame.", "embedcolor": "f46e49" } \ No newline at end of file diff --git a/JumpPatch/Main.cs b/JumpPatch/Main.cs index 949dc7d..15e3ab9 100644 --- a/JumpPatch/Main.cs +++ b/JumpPatch/Main.cs @@ -2,7 +2,7 @@ namespace NAK.JumpPatch; -public class JumpPatchMod : MelonMod +public class JumpPatch : MelonMod { public override void OnInitializeMelon() { diff --git a/JumpPatch/Properties/AssemblyInfo.cs b/JumpPatch/Properties/AssemblyInfo.cs index 4a03541..a4711a6 100644 --- a/JumpPatch/Properties/AssemblyInfo.cs +++ b/JumpPatch/Properties/AssemblyInfo.cs @@ -10,11 +10,11 @@ using System.Reflection; [assembly: AssemblyProduct(nameof(NAK.JumpPatch))] [assembly: MelonInfo( - typeof(NAK.JumpPatch.JumpPatchMod), + typeof(NAK.JumpPatch.JumpPatch), nameof(NAK.JumpPatch), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/JumpPatch" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/JumpPatch" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/JumpPatch/format.json b/JumpPatch/format.json index bedd17d..dd05cdb 100644 --- a/JumpPatch/format.json +++ b/JumpPatch/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/JumpPatch/releases/download/v1.0.0/JumpPatch.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/JumpPatch/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/JumpPatch.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/JumpPatch/", "changelog": "- Initial Release\n- I like my jump animations.", "embedcolor": "#e56597" } \ No newline at end of file diff --git a/MenuScalePatch/Main.cs b/MenuScalePatch/Main.cs index e0b09a7..21b168d 100644 --- a/MenuScalePatch/Main.cs +++ b/MenuScalePatch/Main.cs @@ -4,12 +4,13 @@ namespace NAK.MenuScalePatch; public class MenuScalePatch : MelonMod { - internal static MelonPreferences_Category Category = MelonPreferences.CreateCategory(nameof(MenuScalePatch)); + public static MelonPreferences_Category Category = + MelonPreferences.CreateCategory(nameof(MenuScalePatch)); - internal static MelonPreferences_Entry EntryUseIndependentHeadTurn = + public static MelonPreferences_Entry EntryUseIndependentHeadTurn = Category.CreateEntry("Use Independent Head Turn", true, description: "Should you be able to use independent head turn in a menu while in Desktop?"); - internal static MelonPreferences_Entry EntryPlayerAnchorMenus = + public static MelonPreferences_Entry EntryPlayerAnchorMenus = Category.CreateEntry("Player Anchor Menus", true, description: "Should the menus be anchored to & constantly follow the player?"); public override void OnInitializeMelon() diff --git a/MenuScalePatch/Properties/AssemblyInfo.cs b/MenuScalePatch/Properties/AssemblyInfo.cs index 2062346..d42bda8 100644 --- a/MenuScalePatch/Properties/AssemblyInfo.cs +++ b/MenuScalePatch/Properties/AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; nameof(NAK.MenuScalePatch), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/MenuScalePatch" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/MenuScalePatch/format.json b/MenuScalePatch/format.json index 6b21041..444aba8 100644 --- a/MenuScalePatch/format.json +++ b/MenuScalePatch/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r2/MenuScalePatch.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/MenuScalePatch.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/MenuScalePatch/", "changelog": "- Menus are no longer forced closed on world load.", "embedcolor": "363020" } \ No newline at end of file diff --git a/NAK.CustomComponents/Components/NAKPointerTracker.cs b/NAK.CustomComponents/Components/NAKPointerTracker.cs index 1ccc1e7..fd9e242 100644 --- a/NAK.CustomComponents/Components/NAKPointerTracker.cs +++ b/NAK.CustomComponents/Components/NAKPointerTracker.cs @@ -1,6 +1,6 @@ using ABI.CCK.Components; -using UnityEngine; using ABI_RC.Core.Player; +using UnityEngine; namespace NAK.CCK.CustomComponents; diff --git a/NAK.CustomComponents/Properties/AssemblyInfo.cs b/NAK.CustomComponents/Properties/AssemblyInfo.cs index 40dc080..8639ca0 100644 --- a/NAK.CustomComponents/Properties/AssemblyInfo.cs +++ b/NAK.CustomComponents/Properties/AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; nameof(NAK.CustomComponents), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/UndoPropButton" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/CustomComponents" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/NAK.CustomComponents/format.json b/NAK.CustomComponents/format.json index e9cc453..1d3aa82 100644 --- a/NAK.CustomComponents/format.json +++ b/NAK.CustomComponents/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/PropUndoButton/releases/download/v1.0.1/PropUndoButton.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/PropUndoButton/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/PropUndoButton.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PropUndoButton/", "changelog": "- Initial Release\n- Added redo button.\n- Mitigated issue of props getting stuck locally if deleting them before they fully spawn.\n- Lowered SFX volume to match existing UI sounds.", "embedcolor": "#00FFFF" } \ No newline at end of file diff --git a/PathCamDisabler/Main.cs b/PathCamDisabler/Main.cs index 9342b9f..2673006 100644 --- a/PathCamDisabler/Main.cs +++ b/PathCamDisabler/Main.cs @@ -3,46 +3,46 @@ using ABI_RC.Core.Player; using MelonLoader; using UnityEngine; -namespace NAK.PathCamDisabler +namespace NAK.PathCamDisabler; + +public class PathCamDisabler : MelonMod { - public class PathCamDisablerMod : MelonMod + public static readonly MelonPreferences_Category Category = + MelonPreferences.CreateCategory(nameof(PathCamDisabler)); + + public static readonly MelonPreferences_Entry EntryDisablePathCam = + Category.CreateEntry("Disable Path Camera Controller.", true, "Disable Path Camera Controller."); + + public static readonly MelonPreferences_Entry EntryDisableFlightBind = + Category.CreateEntry("Disable Flight Binding (if controller off).", false, "Disable flight bind if Path Camera Controller is also disabled."); + + public override void OnInitializeMelon() { - internal const string SettingsCategory = "PathCamDisabler"; - internal static MelonPreferences_Category m_categoryPathCamDisabler; - internal static MelonPreferences_Entry m_entryDisablePathCam, m_entryDisableFlightBind; + EntryDisablePathCam.OnEntryValueChangedUntyped.Subscribe(OnUpdateSettings); - public override void OnInitializeMelon() + MelonLoader.MelonCoroutines.Start(WaitForCVRPathCamController()); + } + + private System.Collections.IEnumerator WaitForCVRPathCamController() + { + while (CVRPathCamController.Instance == null) + yield return null; + UpdateSettings(); + } + + private void UpdateSettings() + { + CVRPathCamController.Instance.enabled = !EntryDisablePathCam.Value; + } + private void OnUpdateSettings(object arg1, object arg2) => UpdateSettings(); + + public override void OnUpdate() + { + if (EntryDisablePathCam.Value && !EntryDisableFlightBind.Value) { - m_categoryPathCamDisabler = MelonPreferences.CreateCategory(SettingsCategory); - m_entryDisablePathCam = m_categoryPathCamDisabler.CreateEntry("Disable Path Camera Controller.", true, description: "Disable Path Camera Controller."); - m_entryDisableFlightBind = m_categoryPathCamDisabler.CreateEntry("Disable Flight Binding (if controller off).", false, description: "Disable flight bind if Path Camera Controller is also disabled."); - - m_entryDisablePathCam.OnEntryValueChangedUntyped.Subscribe(OnUpdateSettings); - - MelonLoader.MelonCoroutines.Start(WaitForCVRPathCamController()); - } - - private System.Collections.IEnumerator WaitForCVRPathCamController() - { - while (CVRPathCamController.Instance == null) - yield return null; - UpdateSettings(); - } - - private void UpdateSettings() - { - CVRPathCamController.Instance.enabled = !m_entryDisablePathCam.Value; - } - private void OnUpdateSettings(object arg1, object arg2) => UpdateSettings(); - - public override void OnUpdate() - { - if (m_entryDisablePathCam.Value && !m_entryDisableFlightBind.Value) + if (Input.GetKeyDown(KeyCode.Keypad5)) { - if (Input.GetKeyDown(KeyCode.Keypad5)) - { - PlayerSetup.Instance._movementSystem.ToggleFlight(); - } + PlayerSetup.Instance._movementSystem.ToggleFlight(); } } } diff --git a/PathCamDisabler/Properties/AssemblyInfo.cs b/PathCamDisabler/Properties/AssemblyInfo.cs index a90fd3d..eafd29e 100644 --- a/PathCamDisabler/Properties/AssemblyInfo.cs +++ b/PathCamDisabler/Properties/AssemblyInfo.cs @@ -1,6 +1,6 @@ using MelonLoader; -using System.Reflection; using NAK.PathCamDisabler.Properties; +using System.Reflection; [assembly: AssemblyVersion(AssemblyInfoParams.Version)] [assembly: AssemblyFileVersion(AssemblyInfoParams.Version)] @@ -10,11 +10,11 @@ using NAK.PathCamDisabler.Properties; [assembly: AssemblyProduct(nameof(NAK.PathCamDisabler))] [assembly: MelonInfo( - typeof(NAK.PathCamDisabler.PathCamDisablerMod), + typeof(NAK.PathCamDisabler.PathCamDisabler), nameof(NAK.PathCamDisabler), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/PathCamDisabler" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PathCamDisabler" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/PathCamDisabler/format.json b/PathCamDisabler/format.json index b8a4315..baf1158 100644 --- a/PathCamDisabler/format.json +++ b/PathCamDisabler/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/PathCamDisabler/releases/download/v1.0.1/PathCamDisabler.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/PathCamDisabler/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/PathCamDisabler.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PathCamDisabler/", "changelog": "- Organizational changes.\n- No longer using SaveToFile().", "embedcolor": "#9b59b6" } \ No newline at end of file diff --git a/PickupPushPull/HarmonyPatches.cs b/PickupPushPull/HarmonyPatches.cs index 2fbc3bc..f622275 100644 --- a/PickupPushPull/HarmonyPatches.cs +++ b/PickupPushPull/HarmonyPatches.cs @@ -1,9 +1,7 @@ using ABI.CCK.Components; -using ABI_RC.Core.Player; -using ABI_RC.Core.Savior; using HarmonyLib; -using UnityEngine; using NAK.PickupPushPull.InputModules; +using UnityEngine; namespace NAK.PickupPushPull.HarmonyPatches; diff --git a/PickupPushPull/InputModules/PickupPushPull_Module.cs b/PickupPushPull/InputModules/PickupPushPull_Module.cs index 97298ed..510a7db 100644 --- a/PickupPushPull/InputModules/PickupPushPull_Module.cs +++ b/PickupPushPull/InputModules/PickupPushPull_Module.cs @@ -21,9 +21,9 @@ public class PickupPushPull_Module : CVRInputModule public Vector2 objectRotation = Vector2.zero; //Global settings - public float Setting_PushPullSpeed = 100f; - public float Setting_RotationSpeed = 200f; - public bool Setting_EnableRotation = false; + public float EntryPushPullSpeed = 100f; + public float EntryRotationSpeed = 200f; + public bool EntryEnableRotation = false; //Desktop settings public bool Desktop_UseZoomForRotate = true; @@ -34,7 +34,6 @@ public class PickupPushPull_Module : CVRInputModule private SteamVR_Action_Boolean VR_RotateBind_Boolean; //Local stuff - private CVRInputManager _inputManager; private ControllerRay desktopControllerRay; private float deadzoneRightValue; private bool controlGamepadEnabled; @@ -52,7 +51,7 @@ public class PickupPushPull_Module : CVRInputModule _inputManager = CVRInputManager.Instance; Instance = this; base.Start(); - + //Get desktop controller ray desktopControllerRay = PlayerSetup.Instance.desktopCamera.GetComponent(); @@ -140,10 +139,10 @@ public class PickupPushPull_Module : CVRInputModule if (!Desktop_UseZoomForRotate) return; //mouse rotation when zoomed - if (Setting_EnableRotation && _inputManager.zoom) + if (EntryEnableRotation && _inputManager.zoom) { - objectRotation.x += Setting_RotationSpeed * _inputManager.rawLookVector.x; - objectRotation.y += Setting_RotationSpeed * _inputManager.rawLookVector.y * -1; + objectRotation.x += EntryRotationSpeed * _inputManager.rawLookVector.x; + objectRotation.y += EntryRotationSpeed * _inputManager.rawLookVector.y * -1; _inputManager.lookVector = Vector2.zero; _inputManager.zoom = false; return; @@ -161,15 +160,15 @@ public class PickupPushPull_Module : CVRInputModule if (button1 || button2) { //Rotation - if (Setting_EnableRotation && button2) + if (EntryEnableRotation && button2) { - objectRotation.x += Setting_RotationSpeed * _inputManager.rawLookVector.x; - objectRotation.y += Setting_RotationSpeed * _inputManager.rawLookVector.y * -1; + objectRotation.x += EntryRotationSpeed * _inputManager.rawLookVector.x; + objectRotation.y += EntryRotationSpeed * _inputManager.rawLookVector.y * -1; _inputManager.lookVector = Vector2.zero; return; } - _inputManager.objectPushPull += _inputManager.rawLookVector.y * Setting_PushPullSpeed * Time.deltaTime; + _inputManager.objectPushPull += _inputManager.rawLookVector.y * EntryPushPullSpeed * Time.deltaTime; _inputManager.lookVector = Vector2.zero; } } @@ -183,19 +182,19 @@ public class PickupPushPull_Module : CVRInputModule bool canRotate = (leftObject != null && leftObject.gripType == CVRPickupObject.GripType.Free) || (rightObject != null && rightObject.gripType == CVRPickupObject.GripType.Free); - if (Setting_EnableRotation && canRotate && VR_RotateBind_Boolean.GetState((SteamVR_Input_Sources)VR_RotateHand)) + if (EntryEnableRotation && canRotate && VR_RotateBind_Boolean.GetState((SteamVR_Input_Sources)VR_RotateHand)) { Vector2 rawLookVector = new Vector2(CVRTools.AxisDeadZone(vrLookAction.GetAxis(SteamVR_Input_Sources.Any).x, deadzoneRightValue, true), CVRTools.AxisDeadZone(vrLookAction.GetAxis(SteamVR_Input_Sources.Any).y, deadzoneRightValue, true)); - objectRotation.x += Setting_RotationSpeed * rawLookVector.x; - objectRotation.y += Setting_RotationSpeed * rawLookVector.y * -1; + objectRotation.x += EntryRotationSpeed * rawLookVector.x; + objectRotation.y += EntryRotationSpeed * rawLookVector.y * -1; _inputManager.lookVector = Vector2.zero; return; } - CVRInputManager.Instance.objectPushPull += CVRInputManager.Instance.floatDirection * Setting_PushPullSpeed * Time.deltaTime; + CVRInputManager.Instance.objectPushPull += CVRInputManager.Instance.floatDirection * EntryPushPullSpeed * Time.deltaTime; } } \ No newline at end of file diff --git a/PickupPushPull/Main.cs b/PickupPushPull/Main.cs index 6e87c93..a8f7140 100644 --- a/PickupPushPull/Main.cs +++ b/PickupPushPull/Main.cs @@ -1,46 +1,44 @@ -using ABI.CCK.Components; -using ABI_RC.Core.Player; +using ABI_RC.Core.Player; using ABI_RC.Core.Savior; -using HarmonyLib; using MelonLoader; -using UnityEngine; -using Valve.VR; using NAK.PickupPushPull.InputModules; namespace NAK.PickupPushPull; public class PickupPushPull : MelonMod { - private static MelonPreferences_Category Category_PickupPushPull; - private static MelonPreferences_Entry Setting_PushPullSpeed, Setting_RotateSpeed; - private static MelonPreferences_Entry Setting_EnableRotation, Setting_Desktop_UseZoomForRotate; - private static MelonPreferences_Entry Setting_VR_RotateHand; - private static MelonPreferences_Entry Setting_VR_RotateBind; + public static readonly MelonPreferences_Category Category = + MelonPreferences.CreateCategory(nameof(PickupPushPull)); + + //Global settings + public static readonly MelonPreferences_Entry EntryPushPullSpeed = + Category.CreateEntry("Push Pull Speed", 2f, "Up/down on right joystick for VR. Left button + Up/down on right joystick for Gamepad."); + + public static readonly MelonPreferences_Entry EntryRotateSpeed = + Category.CreateEntry("Rotate Speed", 6f); + + public static readonly MelonPreferences_Entry EntryEnableRotation = + Category.CreateEntry("Enable Rotation", false, "Hold left trigger in VR or right button on Gamepad."); + + //Desktop settings + public static readonly MelonPreferences_Entry EntryDesktopUseZoomForRotate = + Category.CreateEntry("Desktop Use Zoom For Rotate", true, "Use zoom bind for rotation while a prop is held."); + + //VR settings + public static readonly MelonPreferences_Entry EntryVRRotateHand = + Category.CreateEntry("VR Hand", BindingOptionsVR.BindHand.LeftHand); + + public static readonly MelonPreferences_Entry EntryVRRotateBind = + Category.CreateEntry("VR Binding", BindingOptionsVR.BindingOptions.ButtonATouch); public override void OnInitializeMelon() { - Category_PickupPushPull = MelonPreferences.CreateCategory(nameof(PickupPushPull)); - - //Global settings - Setting_PushPullSpeed = Category_PickupPushPull.CreateEntry("Push Pull Speed", 2f, description: "Up/down on right joystick for VR. Left buSettingr + Up/down on right joystick for Gamepad."); - Setting_RotateSpeed = Category_PickupPushPull.CreateEntry("Rotate Speed", 6f); - Setting_EnableRotation = Category_PickupPushPull.CreateEntry("Enable Rotation", false, description: "Hold left trigger in VR or right buSettingr on Gamepad."); - - //Desktop settings - Setting_Desktop_UseZoomForRotate = Category_PickupPushPull.CreateEntry("Desktop Use Zoom For Rotate", true, description: "Use zoom bind for rotation while a prop is held."); - - //VR settings - Setting_VR_RotateHand = Category_PickupPushPull.CreateEntry("VR Hand", BindingOptionsVR.BindHand.LeftHand); - - //bruh - foreach (var setting in Category_PickupPushPull.Entries) + foreach (var entry in Category.Entries) { - setting.OnEntryValueChangedUntyped.Subscribe(OnUpdateSettings); + entry.OnEntryValueChangedUntyped.Subscribe(OnUpdateSettings); } - //special setting - Setting_VR_RotateBind = Category_PickupPushPull.CreateEntry("VR Binding", BindingOptionsVR.BindingOptions.ButtonATouch); - Setting_VR_RotateBind.OnEntryValueChangedUntyped.Subscribe(OnUpdateVRBinding); + EntryVRRotateBind.OnEntryValueChangedUntyped.Subscribe(OnUpdateVRBinding); MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer()); } @@ -69,19 +67,19 @@ public class PickupPushPull : MelonMod if (!PickupPushPull_Module.Instance) return; //Global settings - PickupPushPull_Module.Instance.Setting_PushPullSpeed = Setting_PushPullSpeed.Value * 50; - PickupPushPull_Module.Instance.Setting_RotationSpeed = Setting_RotateSpeed.Value * 50; - PickupPushPull_Module.Instance.Setting_EnableRotation = Setting_EnableRotation.Value; + PickupPushPull_Module.Instance.EntryPushPullSpeed = EntryPushPullSpeed.Value * 50; + PickupPushPull_Module.Instance.EntryRotationSpeed = EntryRotateSpeed.Value * 50; + PickupPushPull_Module.Instance.EntryEnableRotation = EntryEnableRotation.Value; //Desktop settings - PickupPushPull_Module.Instance.Desktop_UseZoomForRotate = Setting_Desktop_UseZoomForRotate.Value; + PickupPushPull_Module.Instance.Desktop_UseZoomForRotate = EntryDesktopUseZoomForRotate.Value; //VR settings - PickupPushPull_Module.Instance.VR_RotateHand = Setting_VR_RotateHand.Value; + PickupPushPull_Module.Instance.VR_RotateHand = EntryVRRotateHand.Value; } - + private void UpdateVRBinding() { //VR special settings - PickupPushPull_Module.Instance.VR_RotateBind = Setting_VR_RotateBind.Value; + PickupPushPull_Module.Instance.VR_RotateBind = EntryVRRotateBind.Value; PickupPushPull_Module.Instance.UpdateVRBinding(); } } diff --git a/PickupPushPull/Properties/AssemblyInfo.cs b/PickupPushPull/Properties/AssemblyInfo.cs index 80c20d8..0a8fa61 100644 --- a/PickupPushPull/Properties/AssemblyInfo.cs +++ b/PickupPushPull/Properties/AssemblyInfo.cs @@ -1,8 +1,7 @@ -using NAK.PickupPushPull.Properties; -using MelonLoader; +using MelonLoader; +using NAK.PickupPushPull.Properties; using System.Reflection; - [assembly: AssemblyVersion(AssemblyInfoParams.Version)] [assembly: AssemblyFileVersion(AssemblyInfoParams.Version)] [assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)] @@ -15,7 +14,7 @@ using System.Reflection; nameof(NAK.PickupPushPull), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/PickupPushPull" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PickupPushPull" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/PickupPushPull/format.json b/PickupPushPull/format.json index 661d26e..158cd42 100644 --- a/PickupPushPull/format.json +++ b/PickupPushPull/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/PickupPushPull/releases/download/v3.0.2/PickupPushPull.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/PickupPushPull/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/PickupPushPull.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PickupPushPull/", "changelog": "- Fixed issue where ControlEnableGamepad setting was improperly checked on startup.", "embedcolor": "804221" } \ No newline at end of file diff --git a/PortableCameraAdditions/Properties/AssemblyInfo.cs b/PortableCameraAdditions/Properties/AssemblyInfo.cs index 02c6025..c3089f5 100644 --- a/PortableCameraAdditions/Properties/AssemblyInfo.cs +++ b/PortableCameraAdditions/Properties/AssemblyInfo.cs @@ -2,7 +2,6 @@ using NAK.PortableCameraAdditions.Properties; using System.Reflection; - [assembly: AssemblyVersion(AssemblyInfoParams.Version)] [assembly: AssemblyFileVersion(AssemblyInfoParams.Version)] [assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)] @@ -15,7 +14,7 @@ using System.Reflection; nameof(NAK.PortableCameraAdditions), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/PortableCameraAdditions" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PortableCameraAdditions" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/PortableCameraAdditions/format.json b/PortableCameraAdditions/format.json index f73d7df..f4593c2 100644 --- a/PortableCameraAdditions/format.json +++ b/PortableCameraAdditions/format.json @@ -18,8 +18,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/PortableCameraAdditions/releases/download/v1.0.2/PortableCameraAdditions.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/PortableCameraAdditions/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/PortableCameraAdditions.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PortableCameraAdditions/", "changelog": "Added F11 bind to fullscreen Portable Camera on Desktop.", "embedcolor": "9b59b6" } \ No newline at end of file diff --git a/PropUndoButton/Main.cs b/PropUndoButton/Main.cs index 6bd96c7..9d47bfd 100644 --- a/PropUndoButton/Main.cs +++ b/PropUndoButton/Main.cs @@ -14,9 +14,7 @@ namespace NAK.PropUndoButton; public class PropUndoButton : MelonMod { - public static List deletedProps = new List(); - - private static readonly MelonPreferences_Category Category = + public static readonly MelonPreferences_Category Category = MelonPreferences.CreateCategory(nameof(PropUndoButton)); public static readonly MelonPreferences_Entry EntryEnabled = @@ -24,16 +22,18 @@ public class PropUndoButton : MelonMod public static readonly MelonPreferences_Entry EntryUseSFX = Category.CreateEntry("Use SFX", true, description: "Toggle audio queues for prop spawn, undo, redo, and warning."); + + internal static List deletedProps = new List(); // audio clip names, InterfaceAudio adds "PropUndo_" prefix - public const string sfx_spawn = "PropUndo_sfx_spawn"; - public const string sfx_undo = "PropUndo_sfx_undo"; - public const string sfx_redo = "PropUndo_sfx_redo"; - public const string sfx_warn = "PropUndo_sfx_warn"; - public const string sfx_deny = "PropUndo_sfx_deny"; + internal const string sfx_spawn = "PropUndo_sfx_spawn"; + internal const string sfx_undo = "PropUndo_sfx_undo"; + internal const string sfx_redo = "PropUndo_sfx_redo"; + internal const string sfx_warn = "PropUndo_sfx_warn"; + internal const string sfx_deny = "PropUndo_sfx_deny"; - public const int redoHistoryLimit = 20; // amount that can be in history at once - public const int redoTimeoutLimit = 120; // seconds + const int redoHistoryLimit = 20; // amount that can be in history at once + const int redoTimeoutLimit = 120; // seconds public override void OnInitializeMelon() { diff --git a/PropUndoButton/Properties/AssemblyInfo.cs b/PropUndoButton/Properties/AssemblyInfo.cs index 8273b6a..cbfc391 100644 --- a/PropUndoButton/Properties/AssemblyInfo.cs +++ b/PropUndoButton/Properties/AssemblyInfo.cs @@ -1,5 +1,5 @@ -using NAK.PropUndoButton.Properties; -using MelonLoader; +using MelonLoader; +using NAK.PropUndoButton.Properties; using System.Reflection; [assembly: AssemblyVersion(AssemblyInfoParams.Version)] @@ -14,7 +14,7 @@ using System.Reflection; nameof(NAK.PropUndoButton), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/UndoPropButton" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/UndoPropButton" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/PropUndoButton/format.json b/PropUndoButton/format.json index e9cc453..1d3aa82 100644 --- a/PropUndoButton/format.json +++ b/PropUndoButton/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/PropUndoButton/releases/download/v1.0.1/PropUndoButton.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/PropUndoButton/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/PropUndoButton.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PropUndoButton/", "changelog": "- Initial Release\n- Added redo button.\n- Mitigated issue of props getting stuck locally if deleting them before they fully spawn.\n- Lowered SFX volume to match existing UI sounds.", "embedcolor": "#00FFFF" } \ No newline at end of file diff --git a/ThirdPerson/ThirdPerson.cs b/ThirdPerson/ThirdPerson.cs index 4d5417f..05c06de 100644 --- a/ThirdPerson/ThirdPerson.cs +++ b/ThirdPerson/ThirdPerson.cs @@ -1,5 +1,4 @@ using MelonLoader; -using System; using System.Reflection; using UnityEngine; using static NAK.ThirdPerson.CameraLogic; diff --git a/TrackedControllerFix/HarmonyPatches.cs b/TrackedControllerFix/HarmonyPatches.cs index c53d14f..be5d728 100644 --- a/TrackedControllerFix/HarmonyPatches.cs +++ b/TrackedControllerFix/HarmonyPatches.cs @@ -11,9 +11,9 @@ internal class PlayerSetupPatches private static void Post_PlayerSetup_Start(ref PlayerSetup __instance) { // Add TrackedControllerFix - var vrLeftHandTracker = __instance.vrLeftHandTracker.AddComponent(); + var vrLeftHandTracker = __instance.vrLeftHandTracker.AddComponent(); vrLeftHandTracker.inputSource = SteamVR_Input_Sources.LeftHand; - var vrRightHandTracker = __instance.vrRightHandTracker.AddComponent(); + var vrRightHandTracker = __instance.vrRightHandTracker.AddComponent(); vrRightHandTracker.inputSource = SteamVR_Input_Sources.RightHand; } } \ No newline at end of file diff --git a/TrackedControllerFix/Main.cs b/TrackedControllerFix/Main.cs index d92d8e2..ec78d2d 100644 --- a/TrackedControllerFix/Main.cs +++ b/TrackedControllerFix/Main.cs @@ -2,7 +2,7 @@ namespace NAK.TrackedControllerFix; -public class TrackedControllerFixMod : MelonMod +public class TrackedControllerFix : MelonMod { public override void OnInitializeMelon() { diff --git a/TrackedControllerFix/Properties/AssemblyInfo.cs b/TrackedControllerFix/Properties/AssemblyInfo.cs index bbde356..45b81ed 100644 --- a/TrackedControllerFix/Properties/AssemblyInfo.cs +++ b/TrackedControllerFix/Properties/AssemblyInfo.cs @@ -10,11 +10,11 @@ using System.Reflection; [assembly: AssemblyProduct(nameof(NAK.TrackedControllerFix))] [assembly: MelonInfo( - typeof(NAK.TrackedControllerFix.TrackedControllerFixMod), + typeof(NAK.TrackedControllerFix.TrackedControllerFix), nameof(NAK.TrackedControllerFix), AssemblyInfoParams.Version, AssemblyInfoParams.Author, - downloadLink: "https://github.com/NotAKidOnSteam/TrackedControllerFix" + downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/TrackedControllerFix" )] [assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] diff --git a/TrackedControllerFix/TrackedControllerFix.cs b/TrackedControllerFix/TrackedControllerFix.cs index c4ba2b0..3097c56 100644 --- a/TrackedControllerFix/TrackedControllerFix.cs +++ b/TrackedControllerFix/TrackedControllerFix.cs @@ -3,7 +3,7 @@ using Valve.VR; namespace NAK.TrackedControllerFix; -public class TrackedControllerFix : MonoBehaviour +public class TrackedControllerFixer : MonoBehaviour { public SteamVR_Input_Sources inputSource; public int deviceIndex; diff --git a/TrackedControllerFix/format.json b/TrackedControllerFix/format.json index 7d05f54..1e830a7 100644 --- a/TrackedControllerFix/format.json +++ b/TrackedControllerFix/format.json @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/TrackedControllerFix/releases/download/v1.0.0/TrackedControllerFix.dll", - "sourcelink": "https://github.com/NotAKidOnSteam/TrackedControllerFix/", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/TrackedControllerFix.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/TrackedControllerFix/", "changelog": "Initial Release", "embedcolor": "3498db" } \ No newline at end of file