major cleanup

This commit is contained in:
NotAKidoS 2023-04-26 15:32:02 -05:00
parent b33e15377f
commit e5242f76c7
85 changed files with 584 additions and 571 deletions

View file

@ -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")]

View file

@ -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"
}

View file

@ -6,17 +6,17 @@ namespace NAK.BadAnimatorFix;
public static class BadAnimatorFixManager
{
private static List<BadAnimatorFix> badAnimatorFixes = new List<BadAnimatorFix>();
private static List<BadAnimatorFixer> badAnimatorFixes = new List<BadAnimatorFixer>();
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<BadAnimatorFix>(out _))
if (!animator.TryGetComponent<BadAnimatorFixer>(out _))
{
animator.gameObject.AddComponent<BadAnimatorFix>();
animator.gameObject.AddComponent<BadAnimatorFixer>();
}
}
}
@ -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();
}

View file

@ -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<Playable>(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);
}
}
}

View file

@ -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<Animator>(true);
foreach (Animator animator in animators)
{
if (!animator.TryGetComponent<BadAnimatorFix>(out _))
if (!animator.TryGetComponent<BadAnimatorFixer>(out _))
{
animator.gameObject.AddComponent<BadAnimatorFix>();
animator.gameObject.AddComponent<BadAnimatorFixer>();
}
}
}

View file

@ -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<bool> EntryEnabled =
CategoryBadAnimatorFix.CreateEntry("Enabled", true, description: "Toggle BadAnimatorFix entirely. Requires avatar/spawnable/world reload.");

View file

@ -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")]

View file

@ -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"
}

View file

@ -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);
}
}
}

View file

@ -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<Animator>();
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();

View file

@ -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);

View file

@ -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<float> entry, float min, float max)
{
page.AddSlider(entry.DisplayName, entry.Description, entry.Value, min, max).OnValueUpdated += f => entry.Value = f;

View file

@ -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);

View file

@ -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<bool>
m_entryEnabled,
m_entryAutoSleepState,
m_entryHudMessages,
m_entryDropFPSOnSleep,
m_entryDrowsyVelocityMultiplier;
internal static MelonPreferences_Entry<float>
m_entryDrowsyThreshold, m_entryAwakeThreshold,
m_entryDrowsyModeTimer, m_entrySleepModeTimer,
m_entryDrowsyDimStrength;
public static readonly MelonPreferences_Category CategoryBlackout =
MelonPreferences.CreateCategory(SettingsCategory);
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
CategoryBlackout.CreateEntry("Automatic State Change", true, "Should the screen automatically dim if head is still for enough time?");
public static readonly MelonPreferences_Entry<bool> EntryHudMessages =
CategoryBlackout.CreateEntry("Hud Messages", true, "Notify on state change.");
public static readonly MelonPreferences_Entry<bool> 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<bool> EntryDrowsyVelocityMultiplier =
CategoryBlackout.CreateEntry("Drowsy Velocity Multiplier", true, "Should head velocity act as a multiplier to Drowsy Dim Strength?");
public static readonly MelonPreferences_Entry<bool> EntryAutoSleepState =
CategoryBlackout.CreateEntry("Auto Sleep State", true, "Should the sleep state be used during Automatic State Change?");
public static readonly MelonPreferences_Entry<float> EntryDrowsyThreshold =
CategoryBlackout.CreateEntry("Drowsy Threshold", 2f, "Velocity to return partial vision.");
public static readonly MelonPreferences_Entry<float> EntryAwakeThreshold =
CategoryBlackout.CreateEntry("Awake Threshold", 4f, "Velocity to return full vision.");
public static readonly MelonPreferences_Entry<float> EntryDrowsyModeTimer =
CategoryBlackout.CreateEntry("Enter Drowsy Time (Minutes)", 3f, "How many minutes without movement until enter drowsy mode.");
public static readonly MelonPreferences_Entry<float> EntrySleepModeTimer =
CategoryBlackout.CreateEntry("Enter Sleep Time (Seconds)", 10f, "How many seconds without movement until enter sleep mode.");
public static readonly MelonPreferences_Entry<float> 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<bool>("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<bool>("Hud Messages", true, description: "Notify on state change.");
m_entryDropFPSOnSleep = m_categoryBlackout.CreateEntry<bool>("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<bool>("Drowsy Velocity Multiplier", true, description: "Should head velocity act as a multiplier to Drowsy Dim Strength?");
m_entryAutoSleepState = m_categoryBlackout.CreateEntry<bool>("Auto Sleep State", true, description: "Should the sleep state be used during Automatic State Change?");
m_entryDrowsyThreshold = m_categoryBlackout.CreateEntry<float>("Drowsy Threshold", 2f, description: "Velocity to return partial vision.");
m_entryAwakeThreshold = m_categoryBlackout.CreateEntry<float>("Awake Threshold", 4f, description: "Velocity to return full vision.");
m_entryDrowsyModeTimer = m_categoryBlackout.CreateEntry<float>("Enter Drowsy Time (Minutes)", 3f, description: "How many minutes without movement until enter drowsy mode.");
m_entrySleepModeTimer = m_categoryBlackout.CreateEntry<float>("Enter Sleep Time (Seconds)", 10f, description: "How many seconds without movement until enter sleep mode.");
m_entryDrowsyDimStrength = m_categoryBlackout.CreateEntry<float>("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();

View file

@ -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")]

View file

@ -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"
}

View file

@ -1,6 +1,6 @@
using CVRGizmos.GismoTypes;
using Gizmos = Popcron.Gizmos;
using UnityEngine;
using Gizmos = Popcron.Gizmos;
namespace CVRGizmos
{

View file

@ -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;
}
}
}
}
}

View file

@ -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<bool> m_entryCVRGizmosEnabled;
private static MelonPreferences_Entry<bool> m_entryCVRGizmosLocalOnly;
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
CategoryCVRGizmos.CreateEntry("Enabled", false, description: "Toggle CVR Gizmos entirely.", dont_save_default: true);
public override void OnApplicationStart()
public static readonly MelonPreferences_Entry<bool> 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<bool>("Enabled", false);
m_entryCVRGizmosLocalOnly = m_categoryCVRGizmos.CreateEntry<bool>("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();
}
}

View file

@ -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")]

View file

@ -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"
}

View file

@ -1,6 +1,5 @@
using ABI_RC.Core;
using ABI_RC.Core.Base;
using Kafe.ChatBox;
namespace NAK.ChatBoxExtensions.Integrations;

View file

@ -1,25 +1,30 @@
namespace NAK.ChatBoxExtensions.Integrations;
public static class Commands {
public static class Commands
{
private const string Character = "/";
private static readonly List<Command> 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<string, bool, bool> onCommandSent = null, Action<string, string, bool, bool> onCommandReceived = null) {
internal static void RegisterCommand(string prefix, Action<string, bool, bool> onCommandSent = null, Action<string, string, bool, bool> 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<string, string, bool, bool> 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);
}
}

View file

@ -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")]

View file

@ -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"
}

View file

@ -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")]

View file

@ -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"
}

View file

@ -200,7 +200,7 @@ internal class DesktopVRIKSystem : MonoBehaviour
_cameraTransform = playerSetup.desktopCamera.transform;
DesktopVRIKMod.UpdateAllSettings();
DesktopVRIK.UpdateAllSettings();
}
void Update()

View file

@ -1,7 +1,6 @@
using ABI_RC.Core.Player;
using HarmonyLib;
using UnityEngine;
using ABI.CCK.Components;
/**

View file

@ -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<bool> entry)

View file

@ -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<bool> 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;
}

View file

@ -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")]

View file

@ -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"
}

View file

@ -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;
}

View file

@ -19,11 +19,11 @@ internal class PlayerSetupPatches
{
if (CheckVR.Instance != null)
{
CheckVR.Instance.gameObject.AddComponent<DesktopVRSwitch>();
CheckVR.Instance.gameObject.AddComponent<DesktopVRSwitcher>();
return;
}
__instance.gameObject.AddComponent<DesktopVRSwitch>();
DesktopVRSwitchMod.Logger.Error("CheckVR not found. Reverting to fallback method. This should never happen!");
__instance.gameObject.AddComponent<DesktopVRSwitcher>();
DesktopVRSwitch.Logger.Error("CheckVR not found. Reverting to fallback method. This should never happen!");
}
}

View file

@ -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<bool>
mSetting_EnterCalibrationOnSwitch;
public static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(DesktopVRSwitch));
public static readonly MelonPreferences_Entry<bool> 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<bool>("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));

View file

@ -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;
}

View file

@ -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;

View file

@ -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<Camera>();
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<Camera>();
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<Camera>();
VRModeSwitchTracker.OnFailVRModeSwitch?.Invoke(isVR, activeCamera);
},

View file

@ -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")]

View file

@ -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<Camera>());
},
"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.");

View file

@ -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"
}

View file

@ -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<bool>())
{
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}");
}
}
}
}

View file

@ -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<bool> 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<bool>())
{
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}");
}
}
}
}

View file

@ -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")]

View file

@ -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"
}

View file

@ -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;
}

View file

@ -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<bool> m_entryEnabledVR, m_entryEnabledFBT;
public static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(FuckToes));
public static readonly MelonPreferences_Entry<bool> EntryEnabledVR =
Category.CreateEntry("Enabled", true, "Nuke VRIK toes when in Halfbody.");
public static readonly MelonPreferences_Entry<bool> 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<bool>("Enabled", true, description: "Nuke VRIK toes when in Halfbody.");
m_entryEnabledFBT = m_categoryFuckToes.CreateEntry<bool>("Enabled in FBT", false, description: "Nuke VRIK toes when in FBT.");
//Apply patches (i stole)
ApplyPatches(typeof(HarmonyPatches.VRIKPatches));
}

View file

@ -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")]

View file

@ -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"
}

View file

@ -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;
}
}
}

View file

@ -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);
}
}
}

View file

@ -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")]

View file

@ -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"
}

View file

@ -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<bool> EntryUseFakeRootAngle =
Category.CreateEntry("Use Fake Root Angle", true, description: "Emulates maxRootAngle. This fixes feet pointing in direction of head when looking around.");

View file

@ -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")]

View file

@ -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"
}

View file

@ -2,7 +2,7 @@
namespace NAK.JumpPatch;
public class JumpPatchMod : MelonMod
public class JumpPatch : MelonMod
{
public override void OnInitializeMelon()
{

View file

@ -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")]

View file

@ -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"
}

View file

@ -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<bool> EntryUseIndependentHeadTurn =
public static MelonPreferences_Entry<bool> EntryUseIndependentHeadTurn =
Category.CreateEntry<bool>("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<bool> EntryPlayerAnchorMenus =
public static MelonPreferences_Entry<bool> EntryPlayerAnchorMenus =
Category.CreateEntry<bool>("Player Anchor Menus", true, description: "Should the menus be anchored to & constantly follow the player?");
public override void OnInitializeMelon()

View file

@ -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")]

View file

@ -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"
}

View file

@ -1,6 +1,6 @@
using ABI.CCK.Components;
using UnityEngine;
using ABI_RC.Core.Player;
using UnityEngine;
namespace NAK.CCK.CustomComponents;

View file

@ -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")]

View file

@ -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"
}

View file

@ -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<bool> EntryDisablePathCam =
Category.CreateEntry("Disable Path Camera Controller.", true, "Disable Path Camera Controller.");
public static readonly MelonPreferences_Entry<bool> 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<bool> 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<bool>("Disable Path Camera Controller.", true, description: "Disable Path Camera Controller.");
m_entryDisableFlightBind = m_categoryPathCamDisabler.CreateEntry<bool>("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();
}
}
}

View file

@ -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")]

View file

@ -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"
}

View file

@ -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;

View file

@ -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<ControllerRay>();
@ -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;
}
}

View file

@ -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<float> Setting_PushPullSpeed, Setting_RotateSpeed;
private static MelonPreferences_Entry<bool> Setting_EnableRotation, Setting_Desktop_UseZoomForRotate;
private static MelonPreferences_Entry<BindingOptionsVR.BindHand> Setting_VR_RotateHand;
private static MelonPreferences_Entry<BindingOptionsVR.BindingOptions> Setting_VR_RotateBind;
public static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(PickupPushPull));
//Global settings
public static readonly MelonPreferences_Entry<float> EntryPushPullSpeed =
Category.CreateEntry<float>("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<float> EntryRotateSpeed =
Category.CreateEntry<float>("Rotate Speed", 6f);
public static readonly MelonPreferences_Entry<bool> EntryEnableRotation =
Category.CreateEntry<bool>("Enable Rotation", false, "Hold left trigger in VR or right button on Gamepad.");
//Desktop settings
public static readonly MelonPreferences_Entry<bool> EntryDesktopUseZoomForRotate =
Category.CreateEntry<bool>("Desktop Use Zoom For Rotate", true, "Use zoom bind for rotation while a prop is held.");
//VR settings
public static readonly MelonPreferences_Entry<BindingOptionsVR.BindHand> EntryVRRotateHand =
Category.CreateEntry<BindingOptionsVR.BindHand>("VR Hand", BindingOptionsVR.BindHand.LeftHand);
public static readonly MelonPreferences_Entry<BindingOptionsVR.BindingOptions> EntryVRRotateBind =
Category.CreateEntry<BindingOptionsVR.BindingOptions>("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<float>("Rotate Speed", 6f);
Setting_EnableRotation = Category_PickupPushPull.CreateEntry<bool>("Enable Rotation", false, description: "Hold left trigger in VR or right buSettingr on Gamepad.");
//Desktop settings
Setting_Desktop_UseZoomForRotate = Category_PickupPushPull.CreateEntry<bool>("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();
}
}

View file

@ -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")]

View file

@ -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"
}

View file

@ -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")]

View file

@ -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"
}

View file

@ -14,9 +14,7 @@ namespace NAK.PropUndoButton;
public class PropUndoButton : MelonMod
{
public static List<DeletedProp> deletedProps = new List<DeletedProp>();
private static readonly MelonPreferences_Category Category =
public static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(PropUndoButton));
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
@ -24,16 +22,18 @@ public class PropUndoButton : MelonMod
public static readonly MelonPreferences_Entry<bool> EntryUseSFX =
Category.CreateEntry("Use SFX", true, description: "Toggle audio queues for prop spawn, undo, redo, and warning.");
internal static List<DeletedProp> deletedProps = new List<DeletedProp>();
// 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()
{

View file

@ -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")]

View file

@ -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"
}

View file

@ -1,5 +1,4 @@
using MelonLoader;
using System;
using System.Reflection;
using UnityEngine;
using static NAK.ThirdPerson.CameraLogic;

View file

@ -11,9 +11,9 @@ internal class PlayerSetupPatches
private static void Post_PlayerSetup_Start(ref PlayerSetup __instance)
{
// Add TrackedControllerFix
var vrLeftHandTracker = __instance.vrLeftHandTracker.AddComponent<TrackedControllerFix>();
var vrLeftHandTracker = __instance.vrLeftHandTracker.AddComponent<TrackedControllerFixer>();
vrLeftHandTracker.inputSource = SteamVR_Input_Sources.LeftHand;
var vrRightHandTracker = __instance.vrRightHandTracker.AddComponent<TrackedControllerFix>();
var vrRightHandTracker = __instance.vrRightHandTracker.AddComponent<TrackedControllerFixer>();
vrRightHandTracker.inputSource = SteamVR_Input_Sources.RightHand;
}
}

View file

@ -2,7 +2,7 @@
namespace NAK.TrackedControllerFix;
public class TrackedControllerFixMod : MelonMod
public class TrackedControllerFix : MelonMod
{
public override void OnInitializeMelon()
{

View file

@ -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")]

View file

@ -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;

View file

@ -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"
}