Move mods to Depricated folder.

This commit is contained in:
NotAKidoS 2023-07-26 11:30:19 -05:00
parent e61f119f32
commit 5d1cb2ebec
70 changed files with 44 additions and 119 deletions

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk"/>

View file

@ -0,0 +1,140 @@
using ABI.CCK.Components;
using ABI_RC.Core.Player;
using UnityEngine;
namespace NAK.AASBufferFix;
public class AASBufferHelper : MonoBehaviour
{
///public bool DebuggingFlag = false;
//public stuff
public bool GameHandlesAAS { get; private set; }
//internal references
private PuppetMaster _puppetMaster;
//outside aas buffers
private float[] _aasBufferFloat = new float[0];
private int[] _aasBufferInt = new int[0];
private byte[] _aasBufferByte = new byte[0];
//calculated footprints
private int _aasFootprint = -1;
private int _avatarFootprint = 0;
private void Start() => _puppetMaster = GetComponent<PuppetMaster>();
public void OnAvatarInstantiated(Animator animator)
{
// have never run into an avatar without an animator until today
if (animator == null)
{
GameHandlesAAS = true;
return;
}
//check if avatar uses Avatar Advanced Settings
///SendDebug("[OnInit] Remote avatar initialized. Checking for AAS...");
CVRAvatar avatar = animator.GetComponent<CVRAvatar>();
if (avatar != null && !avatar.avatarUsesAdvancedSettings)
{
GameHandlesAAS = true;
return;
}
//check if AAS footprint is valid
///SendDebug("[OnInit] Avatar uses AAS. Generating AAS footprint...");
_avatarFootprint = Utils.GenerateAnimatorAASFootprint(animator);
if (_avatarFootprint == 1)
{
// we will let the game handle this by setting GameHandlesAAS to true
///SendDebug("[OnInit] Avatar does not contain valid AAS. It is likely hidden or blocked.");
GameHandlesAAS = true;
return;
}
///SendDebug($"[OnInit] Avatar footprint is : {_avatarFootprint}");
//check if we received expected AAS while we loaded the avatar, and if so, apply it now
if (SyncDataMatchesExpected())
{
///SendDebug("[OnInit] Valid buffered AAS found. Applying buffer...");
ApplyExternalAASBuffer();
return;
}
//we loaded avatar faster than wearer
///SendDebug("[OnInit] Remote avatar initialized faster than wearer. Waiting on valid AAS...");
}
public void OnAvatarDestroyed()
{
GameHandlesAAS = false;
_aasFootprint = -1;
_avatarFootprint = 0;
}
public void OnReceiveAAS(float[] settingsFloat, int[] settingsInt, byte[] settingsByte)
{
// Calculate AAS footprint to compare against.
_aasFootprint = (settingsFloat.Length + 1) * (settingsInt.Length + 1) * (settingsByte.Length + 1);
//if it matches, apply the settings and let game take over
if (SyncDataMatchesExpected())
{
///SendDebug("[OnSync] Avatar values matched and have been applied.");
ApplyExternalAAS(settingsFloat, settingsInt, settingsByte);
return;
}
//avatar is still loading on our side, we must assume AAS data is correct and store it until we load
//there is also a chance it errored
//if (_avatarFootprint == 0)
//{
// ///SendDebug("[OnSync] Avatar is still loading on our end.");
// StoreExternalAASBuffer(settingsFloat, settingsInt, settingsByte);
// return;
//}
//avatar is loaded on our end, and is not blocked by filter
//this does run if it is manually hidden or distance hidden
///SendDebug("[OnSync] Avatar is loaded on our side and is not blocked. Comparing for expected values.");
///SendDebug($"[OnSync] Avatar Footprint is : {_avatarFootprint}");
//if it did not match, that means the avatar we see on our side is different than what the remote user is wearing and syncing
///SendDebug("[OnSync] Avatar loaded is different than wearer. The wearer is likely still loading the avatar!");
StoreExternalAASBuffer(settingsFloat, settingsInt, settingsByte);
}
private void ApplyExternalAASBuffer()
{
GameHandlesAAS = true;
_puppetMaster?.ApplyAdvancedAvatarSettings(_aasBufferFloat, _aasBufferInt, _aasBufferByte);
}
private void ApplyExternalAAS(float[] settingsFloat, int[] settingsInt, byte[] settingsByte)
{
GameHandlesAAS = true;
_puppetMaster?.ApplyAdvancedAvatarSettings(settingsFloat, settingsInt, settingsByte);
}
private void StoreExternalAASBuffer(float[] settingsFloat, int[] settingsInt, byte[] settingsByte)
{
Array.Resize(ref _aasBufferFloat, settingsFloat.Length);
Array.Resize(ref _aasBufferInt, settingsInt.Length);
Array.Resize(ref _aasBufferByte, settingsByte.Length);
Array.Copy(settingsFloat, _aasBufferFloat, settingsFloat.Length);
Array.Copy(settingsInt, _aasBufferInt, settingsInt.Length);
Array.Copy(settingsByte, _aasBufferByte, settingsByte.Length);
}
private bool SyncDataMatchesExpected() => _aasFootprint == _avatarFootprint;
///private void SendDebug(string message)
///{
/// if (!DebuggingFlag) return;
/// AASBufferFix.Logger.Msg(message);
///}
}

View file

@ -0,0 +1,70 @@
using ABI_RC.Core;
using ABI_RC.Core.Base;
using ABI_RC.Core.Player;
using HarmonyLib;
using UnityEngine;
namespace NAK.AASBufferFix.HarmonyPatches;
[HarmonyPatch]
internal class HarmonyPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(PuppetMaster), "Start")]
private static void Postfix_PuppetMaster_Start(ref PuppetMaster __instance)
{
__instance.AddComponentIfMissing<AASBufferHelper>();
}
[HarmonyPostfix]
[HarmonyPatch(typeof(PuppetMaster), "AvatarInstantiated")]
private static void Postfix_PuppetMaster_AvatarInstantiated(ref PuppetMaster __instance, ref Animator ____animator)
{
AASBufferHelper externalBuffer = __instance.GetComponent<AASBufferHelper>();
externalBuffer?.OnAvatarInstantiated(____animator);
}
[HarmonyPostfix]
[HarmonyPatch(typeof(PuppetMaster), "AvatarDestroyed")]
private static void Postfix_PuppetMaster_AvatarDestroyed(ref PuppetMaster __instance)
{
AASBufferHelper externalBuffer = __instance.GetComponent<AASBufferHelper>();
externalBuffer?.OnAvatarDestroyed();
}
[HarmonyPrefix]
[HarmonyPatch(typeof(PuppetMaster), "ApplyAdvancedAvatarSettings")]
private static bool Prefix_PuppetMaster_ApplyAdvancedAvatarSettings(float[] settingsFloat, int[] settingsInt, byte[] settingsByte, ref PuppetMaster __instance)
{
AASBufferHelper externalBuffer = __instance.GetComponent<AASBufferHelper>();
if (externalBuffer != null && !externalBuffer.GameHandlesAAS)
{
externalBuffer.OnReceiveAAS(settingsFloat, settingsInt, settingsByte);
return false;
}
return true;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(CVRAnimatorManager), "ApplyAdvancedAvatarSettingsFromBuffer")]
private static bool Prefix_CVRAnimatorManager_ApplyAdvancedAvatarSettingsFromBuffer(ref Animator ____animator)
{
AASBufferHelper externalBuffer = ____animator.GetComponentInParent<AASBufferHelper>();
if (externalBuffer != null && !externalBuffer.GameHandlesAAS)
{
//dont apply if stable buffer no exist
return false;
}
return true;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(PlayerSetup), "SendAdvancedAvatarSettings")]
private static bool Prefix_PlayerSetup_SendAdvancedAvatarSettings(ref PlayerSetup __instance)
{
//dont sync wrong settings to remote users
return !__instance.avatarIsLoading;
}
}

View file

@ -0,0 +1,12 @@
using MelonLoader;
namespace NAK.AASBufferFix;
public class AASBufferFix : MelonMod
{
///public static MelonLogger.Instance Logger;
public override void OnInitializeMelon()
{
///Logger = LoggerInstance;
}
}

View file

@ -0,0 +1,29 @@
using MelonLoader;
using NAK.AASBufferFix.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.AASBufferFix))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.AASBufferFix))]
[assembly: MelonInfo(
typeof(NAK.AASBufferFix.AASBufferFix),
nameof(NAK.AASBufferFix),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/AASBufferFix"
)]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
namespace NAK.AASBufferFix.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.7";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,26 @@
# AASBufferFix
Fixes two issues with the Avatar Advanced Settings buffers when loading remote avatars:
https://feedback.abinteractive.net/p/aas-is-still-synced-while-loading-an-avatar
https://feedback.abinteractive.net/p/aas-buffer-is-nuked-on-remote-load
Avatars will no longer load in naked or transition to the wrong state on load.
AAS will also not be updated unless the expected data matches what is received.
The avatar will stay in the default animator state until AAS data is received that is deemed correct.
You will no longer sync garbage AAS while switching avatar.
---
Here is the block of text where I tell you this mod is not affiliated or endorsed by ABI.
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
> This mod is an independent creation and is not affiliated with, supported by or approved by Alpha Blend Interactive.
> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use.
> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive.

View file

@ -0,0 +1,67 @@
using UnityEngine;
namespace NAK.AASBufferFix;
public class Utils
{
public static int GenerateAnimatorAASFootprint(Animator animator)
{
int avatarFloatCount = 0;
int avatarIntCount = 0;
int avatarBoolCount = 0;
int bitCount = 0;
foreach (AnimatorControllerParameter animatorControllerParameter in animator.parameters)
{
// Do not count above bit limit
if (!(bitCount <= 3200))
break;
if (animatorControllerParameter.name.Length > 0 && animatorControllerParameter.name[0] != '#' && !coreParameters.Contains(animatorControllerParameter.name))
{
AnimatorControllerParameterType type = animatorControllerParameter.type;
switch (type)
{
case AnimatorControllerParameterType.Float:
avatarFloatCount++;
bitCount += 32;
break;
case AnimatorControllerParameterType.Int:
avatarIntCount++;
bitCount += 32;
break;
case AnimatorControllerParameterType.Bool:
avatarBoolCount++;
bitCount++;
break;
default:
//we dont count triggers
break;
}
}
}
//bool to byte
avatarBoolCount = ((int)Math.Ceiling((double)avatarBoolCount / 8));
//create the footprint
return (avatarFloatCount + 1) * (avatarIntCount + 1) * (avatarBoolCount + 1);
}
private static readonly HashSet<string> coreParameters = new HashSet<string>
{
"MovementX",
"MovementY",
"Grounded",
"Emote",
"GestureLeft",
"GestureRight",
"Toggle",
"Sitting",
"Crouching",
"CancelEmote",
"Prone",
"Flying"
};
}

View file

@ -0,0 +1,23 @@
{
"_id": 126,
"name": "AASBufferFix",
"modversion": "1.0.7",
"gameversion": "2022r170p1",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "Fixes two issues with the Avatar Advanced Settings buffers when loading remote avatars. In simple terms, it means 'fewer wardrobe malfunctions'.\n\nEmpty buffer (all 0/false) will no longer be applied on load.\nReceived AAS data is ignored until the wearer has loaded into the expected avatar.\n(The avatar will sit in its default state until the wearer has loaded and started syncing correct AAS)\nAAS will no longer be sent while switching avatar.\n\nPlease view the GitHub README for links to relevant feedback posts.",
"searchtags": [
"aas",
"sync",
"naked",
"buffer"
],
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r13/AASBufferFix.dll",
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/AASBufferFix/",
"changelog": "- Fixed an issue with the avatar footprint being calculated with values that exceed the 3200 AAS bit limit.",
"embedcolor": "9b59b6"
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk"/>

View file

@ -0,0 +1,26 @@
using ABI_RC.Core.Savior;
using ABI_RC.Core.UI;
using cohtml;
using HarmonyLib;
namespace NAK.ClearHudNotifications.HarmonyPatches;
internal static class CohtmlHudPatches
{
[HarmonyPrefix]
[HarmonyPatch(typeof(CohtmlHud), nameof(CohtmlHud.ViewDropText), new Type[] { typeof(string), typeof(string), typeof(string) })]
private static bool Prefix_CohtmlHud_ViewDropText(string cat, string headline, string small, ref CohtmlHud __instance)
{
if (!headline.Contains(MetaPort.Instance.username)) return true; // we only want our username notification
if (small == "A user has joined your Instance." && !MetaPort.Instance.settings.GetSettingsBool("HUDCustomizationPlayerJoins", false))
{
ClearHudNotifications.ClearNotifications();
return false;
}
// clears buffer
if (__instance._isReady) __instance.hudView.View.TriggerEvent("DisplayHudMessageImmediately", cat, headline, small, 3);
return false;
}
}

View file

@ -0,0 +1,40 @@
using ABI_RC.Core.UI;
using MelonLoader;
using UnityEngine;
namespace NAK.ClearHudNotifications;
public class ClearHudNotifications : MelonMod
{
public override void OnInitializeMelon()
{
ApplyPatches(typeof(HarmonyPatches.CohtmlHudPatches));
}
public override void OnUpdate()
{
if (Input.GetKeyDown(KeyCode.F4))
{
ClearNotifications();
}
}
public static void ClearNotifications()
{
// sending an immediate notification clears buffer
CohtmlHud.Instance?.ViewDropTextImmediate("(Local) Client", "Notifications Cleared!", "Cleared Hud Notifications!");
}
void ApplyPatches(Type type)
{
try
{
HarmonyInstance.PatchAll(type);
}
catch (Exception e)
{
LoggerInstance.Msg($"Failed while patching {type.Name}!");
LoggerInstance.Error(e);
}
}
}

View file

@ -0,0 +1,31 @@
using MelonLoader;
using NAK.ClearHudNotifications.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.ClearHudNotifications))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.ClearHudNotifications))]
[assembly: MelonInfo(
typeof(NAK.ClearHudNotifications.ClearHudNotifications),
nameof(NAK.ClearHudNotifications),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/UndoPropButton"
)]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: HarmonyDontPatchAll]
namespace NAK.ClearHudNotifications.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.0";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,23 @@
{
"_id": -1,
"name": "ClearHudNotifications",
"modversion": "1.0.0",
"gameversion": "2022r170p1",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "Clears queued hud notifications when joining a new online instance. Can also press F4 to manually clear notifications.",
"searchtags": [
"hud",
"queue",
"notifications",
"clear"
],
"requirements": [
"None"
],
"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

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk"/>

View file

@ -0,0 +1,20 @@
using ABI_RC.Core.Player;
using ABI_RC.Core.Savior;
using ABI_RC.Systems.IK.SubSystems;
using HarmonyLib;
namespace NAK.ControllerFreeze.HarmonyPatches;
class PlayerSetupPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.Update))]
static void Postfix_PlayerSetup_Update()
{
if (MetaPort.Instance.isUsingVr)
{
BodySystem.TrackingLeftArmEnabled = true;
BodySystem.TrackingRightArmEnabled = true;
}
}
}

View file

@ -0,0 +1,24 @@
using MelonLoader;
namespace NAK.ControllerFreeze;
public class ControllerFreeze : MelonMod
{
public override void OnInitializeMelon()
{
ApplyPatches(typeof(HarmonyPatches.PlayerSetupPatches));
}
void ApplyPatches(Type type)
{
try
{
HarmonyInstance.PatchAll(type);
}
catch (Exception e)
{
LoggerInstance.Msg($"Failed while patching {type.Name}!");
LoggerInstance.Error(e);
}
}
}

View file

@ -0,0 +1,30 @@
using MelonLoader;
using NAK.ControllerFreeze.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.ControllerFreeze))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.ControllerFreeze))]
[assembly: MelonInfo(
typeof(NAK.ControllerFreeze.ControllerFreeze),
nameof(NAK.ControllerFreeze),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/ControllerFreeze"
)]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: HarmonyDontPatchAll]
namespace NAK.ControllerFreeze.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.5";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,16 @@
# ControllerFreeze
This made no sense to dirty TrackedControllerFix with, so it is now its own mod.
Prevents game disabling arm tracking when a controller is inactive. This obviously will cause issues if you only play with one controller.
---
Here is the block of text where I tell you this mod is not affiliated or endorsed by ABI.
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
> This mod is an independent creation and is not affiliated with, supported by or approved by Alpha Blend Interactive.
> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use.
> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive.

View file

@ -0,0 +1,23 @@
{
"_id": -1,
"name": "ControllerFreeze",
"modversion": "1.0.5",
"gameversion": "2022r170p1",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "Allows your controllers to track while the SteamVR overlay is open. This also fixes Quest/Touch controllers feeling slow during fast movements.\n\nSupport for SmoothRay & DesktopVRSwitch.",
"searchtags": [
"vr",
"quest",
"controller",
"tracking"
],
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r9/ControllerFreeze.dll",
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/ControllerFreeze/",
"changelog": "Initial CVRMG Release",
"embedcolor": "3498db"
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk"/>

View file

@ -0,0 +1,64 @@
using ABI_RC.Core.InteractionSystem;
using ABI_RC.Core.IO;
using cohtml;
using HarmonyLib;
namespace NAK.FuckMetrics.HarmonyPatches;
public static class CVR_MenuManagerPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(CVR_MenuManager), "ToggleQuickMenu", new Type[] { typeof(bool) })]
private static void Postfix_CVR_MenuManager_ToggleQuickMenu(bool show)
{
FuckMetrics.ApplyMetricsSettings(show);
FuckMetrics.ApplyCoreUpdatesSettings(show);
}
}
public static class ViewManagerPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(ViewManager), "UiStateToggle", new Type[] { typeof(bool) })]
private static void Postfix_ViewManager_UiStateToggle(bool show)
{
FuckMetrics.ApplyMetricsSettings(show);
FuckMetrics.ApplyCoreUpdatesSettings(show);
}
}
public static class CohtmlViewPatches
{
private static CohtmlView _quickMenuView;
private static CohtmlView _gameMenuView;
private static Traverse _quickMenuOpenTraverse;
private static Traverse _gameMenuOpenTraverse;
[HarmonyPostfix]
[HarmonyPatch(typeof(CVR_MenuManager), "Start")]
private static void Postfix_CVRMenuManager_Start(ref CVR_MenuManager __instance, ref CohtmlView ___quickMenu)
{
_quickMenuView = ___quickMenu;
_quickMenuOpenTraverse = Traverse.Create(__instance).Field("_quickMenuOpen");
SchedulerSystem.AddJob(() => FuckMetrics.CohtmlAdvanceView(_quickMenuView, _quickMenuOpenTraverse), 15f, 6f, -1);
}
[HarmonyPostfix]
[HarmonyPatch(typeof(ViewManager), "Start")]
private static void Postfix_ViewManager_Start(ref ViewManager __instance, ref CohtmlView ___gameMenuView)
{
_gameMenuView = ___gameMenuView;
_gameMenuOpenTraverse = Traverse.Create(__instance).Field("_gameMenuOpen");
SchedulerSystem.AddJob(() => FuckMetrics.CohtmlAdvanceView(_gameMenuView, _gameMenuOpenTraverse), 12f, 6f, -1);
}
[HarmonyPostfix]
[HarmonyPatch(typeof(ViewManager), "OnMicrophoneStatusSwitched")]
private static void Postfix_ViewManager_OnMicrophoneStatusSwitched()
{
if (_quickMenuOpenTraverse.GetValue<bool>())
{
CVR_MenuManager.Instance.SendCoreUpdate();
}
}
}

View file

@ -0,0 +1,186 @@
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 FuckMetrics : MelonMod
{
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.");
public static readonly MelonPreferences_Entry<FuckMetrics.SettingState> EntryDisableMetrics =
CategoryFuckMetrics.CreateEntry("Menu Metrics", FuckMetrics.SettingState.MenuOnly, description: "Disables menu metrics (FPS & Ping). Updates once on menu open if disabled.");
public static readonly MelonPreferences_Entry<FuckMetrics.SettingState> EntryDisableCoreUpdates =
CategoryFuckMetrics.CreateEntry("Menu Core Updates", FuckMetrics.SettingState.MenuOnly, description: "Disables menu core updates (Gamerule Icons & Debug Status). Updates once on menu open if disabled.");
public static readonly MelonPreferences_Entry<float> EntryMetricsUpdateRate =
CategoryFuckMetrics.CreateEntry("Metrics Update Rate", 1f, description: "Sets the update rate for the menu metrics. Default is 0.5f. Recommended to be 1f or higher.");
public static readonly MelonPreferences_Entry<float> EntryCoreUpdateRate =
CategoryFuckMetrics.CreateEntry("Core Update Rate", 2f, description: "Sets the update rate for the menu core updates. Default is 0.1f. Recommended to be 2f or higher.");
public override void OnInitializeMelon()
{
Logger = LoggerInstance;
EntryDisableMetrics.OnEntryValueChangedUntyped.Subscribe(OnDisableMetrics);
EntryDisableCoreUpdates.OnEntryValueChangedUntyped.Subscribe(OnDisableCoreUpdates);
EntryMetricsUpdateRate.OnEntryValueChangedUntyped.Subscribe(OnChangeMetricsUpdateRate);
EntryCoreUpdateRate.OnEntryValueChangedUntyped.Subscribe(OnChangeCoreUpdateRate);
ApplyPatches(typeof(HarmonyPatches.CVR_MenuManagerPatches));
ApplyPatches(typeof(HarmonyPatches.ViewManagerPatches));
ApplyPatches(typeof(HarmonyPatches.CohtmlViewPatches));
MelonCoroutines.Start(WaitForLocalPlayer());
}
private IEnumerator WaitForLocalPlayer()
{
while (PlayerSetup.Instance == null)
yield return null;
InitializeSettings();
}
private void InitializeSettings()
{
FuckMetrics.ToggleMetrics(false);
FuckMetrics.ToggleCoreUpdates(false);
FuckMetrics.ToggleMetrics(EntryDisableMetrics.Value == FuckMetrics.SettingState.Always);
FuckMetrics.ToggleCoreUpdates(EntryDisableCoreUpdates.Value == FuckMetrics.SettingState.Always);
}
private void OnDisableMetrics(object arg1, object arg2)
{
FuckMetrics.ToggleMetrics(EntryDisableMetrics.Value != FuckMetrics.SettingState.Disabled);
}
private void OnDisableCoreUpdates(object arg1, object arg2)
{
FuckMetrics.ToggleCoreUpdates(EntryDisableCoreUpdates.Value != FuckMetrics.SettingState.Disabled);
}
private void OnChangeMetricsUpdateRate(object arg1, object arg2)
{
if (EntryDisableMetrics.Value != FuckMetrics.SettingState.Disabled)
{
FuckMetrics.ToggleMetrics(false);
FuckMetrics.ToggleMetrics(true);
}
}
private void OnChangeCoreUpdateRate(object arg1, object arg2)
{
if (EntryDisableCoreUpdates.Value != FuckMetrics.SettingState.Disabled)
{
FuckMetrics.ToggleCoreUpdates(false);
FuckMetrics.ToggleCoreUpdates(true);
}
}
private void ApplyPatches(Type type)
{
try
{
HarmonyInstance.PatchAll(type);
}
catch (Exception e)
{
Logger.Msg($"Failed while patching {type.Name}!");
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

@ -0,0 +1,30 @@
using MelonLoader;
using NAK.FuckMetrics.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.FuckMetrics))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.FuckMetrics))]
[assembly: MelonInfo(
typeof(NAK.FuckMetrics.FuckMetrics),
nameof(NAK.FuckMetrics),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/FuckMetrics"
)]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: HarmonyDontPatchAll]
namespace NAK.FuckMetrics.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.4";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,24 @@
{
"_id": 135,
"name": "FuckMetrics",
"modversion": "1.0.4",
"gameversion": "2022r170p1",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "This mod limits UpdateMetrics & SendCoreUpdate while the menus are closed. This helps to alleviate hitching and performance issues, particularly with FPS drops while unmuted in online instances and VRIK tapping in place.\n\nPlease view the Github README for more info.",
"searchtags": [
"cohtml",
"menus",
"quick",
"fps",
"performance"
],
"requirements": [
"None"
],
"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

@ -0,0 +1,30 @@
using ABI_RC.Core.Player;
using ABI_RC.Systems.MovementSystem;
using HarmonyLib;
using UnityEngine;
namespace NAK.HeadBobbingFix.HarmonyPatches;
class PlayerSetupPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.HandleDesktopCameraPosition))]
public static void Postfix_PlayerSetup_HandleDesktopCameraPosition(bool ignore, ref PlayerSetup __instance, ref MovementSystem ____movementSystem, ref int ___headBobbingLevel)
{
if (!HeadBobbingFix.EntryEnabled.Value)
return;
// this would be much simplier if I bothered with transpilers
if (____movementSystem.disableCameraControl && !ignore)
return;
if (___headBobbingLevel != 2)
return;
Transform viewpointTransform = __instance._viewPoint.pointer.transform;
if (viewpointTransform != null)
{
__instance.desktopCamera.transform.position = viewpointTransform.position;
}
}
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk"/>

View file

@ -0,0 +1,37 @@
using ABI_RC.Core.Player;
using MelonLoader;
namespace NAK.HeadBobbingFix;
public class HeadBobbingFix : MelonMod
{
public static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(HeadBobbingFix));
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
Category.CreateEntry("Enabled", true, description: "Toggle HeadBobbingFix entirely. You need full headbobbing enabled for the mod to take effect.");
public override void OnInitializeMelon()
{
EntryEnabled.OnEntryValueChanged.Subscribe(OnEntryEnabledChanged);
ApplyPatches(typeof(HarmonyPatches.PlayerSetupPatches));
}
void OnEntryEnabledChanged(bool newValue, bool oldValue)
{
if (newValue) PlayerSetup.Instance?.SetViewPointOffset();
}
void ApplyPatches(Type type)
{
try
{
HarmonyInstance.PatchAll(type);
}
catch (Exception e)
{
LoggerInstance.Msg($"Failed while patching {type.Name}!");
LoggerInstance.Error(e);
}
}
}

View file

@ -0,0 +1,30 @@
using MelonLoader;
using NAK.HeadBobbingFix.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.HeadBobbingFix))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.HeadBobbingFix))]
[assembly: MelonInfo(
typeof(NAK.HeadBobbingFix.HeadBobbingFix),
nameof(NAK.HeadBobbingFix),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/HeadBobbingFix"
)]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: HarmonyDontPatchAll]
namespace NAK.HeadBobbingFix.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.1";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,18 @@
## HeadBobbingFix
Makes the Desktop camera pivot correctly with the viewpoint when full head bobbing is enabled.
https://github.com/NotAKidOnSteam/NAK_CVR_Mods/assets/37721153/d2b0f918-b4a9-408a-b25f-4c68761ad1c7
## Relevant Feedback Posts:
https://feedback.abinteractive.net/p/pivot-desktop-camera-with-head
---
Here is the block of text where I tell you this mod is not affiliated or endorsed by ABI.
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
> This mod is an independent creation and is not affiliated with, supported by or approved by Alpha Blend Interactive.
> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use.
> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive.

View file

@ -0,0 +1,23 @@
{
"_id": 165,
"name": "HeadBobbingFix",
"modversion": "1.0.1",
"gameversion": "2022r170p1",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "Fixes Desktop camera pivoting in place when full head bobbing is enabled. Please view the README for more info: [README](https://github.com/NotAKidOnSteam/NAK_CVR_Mods/blob/main/HeadBobbingFix/README.md)",
"searchtags": [
"desktop",
"camera",
"pivot",
"fix"
],
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r11/HeadBobbingFix.dll",
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/HeadBobbingFix/",
"changelog": "- Initial Release\n- Rename to HeadBobbingFix to prevent confusion",
"embedcolor": "#e33b24"
}

View file

@ -0,0 +1,23 @@
using ABI_RC.Core.Savior;
using ABI_RC.Systems.MovementSystem;
using HarmonyLib;
namespace NAK.JumpPatch.HarmonyPatches;
class MovementSystemPatches
{
[HarmonyPrefix]
[HarmonyPatch(typeof(MovementSystem), nameof(MovementSystem.Update))]
private static void Prefix_MovementSystem_Update(ref bool ____isGrounded, ref bool __state)
{
__state = CVRInputManager.Instance.jump;
CVRInputManager.Instance.jump = CVRInputManager.Instance.jump && ____isGrounded;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(MovementSystem), nameof(MovementSystem.Update))]
private static void Postfix_MovementSystem_Update(ref bool __state)
{
CVRInputManager.Instance.jump = __state;
}
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk"/>

View file

@ -0,0 +1,24 @@
using MelonLoader;
namespace NAK.JumpPatch;
public class JumpPatch : MelonMod
{
public override void OnInitializeMelon()
{
ApplyPatches(typeof(HarmonyPatches.MovementSystemPatches));
}
private void ApplyPatches(Type type)
{
try
{
HarmonyInstance.PatchAll(type);
}
catch (Exception e)
{
LoggerInstance.Msg($"Failed while patching {type.Name}!");
LoggerInstance.Error(e);
}
}
}

View file

@ -0,0 +1,30 @@
using MelonLoader;
using NAK.JumpPatch.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.JumpPatch))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.JumpPatch))]
[assembly: MelonInfo(
typeof(NAK.JumpPatch.JumpPatch),
nameof(NAK.JumpPatch),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/JumpPatch"
)]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: HarmonyDontPatchAll]
namespace NAK.JumpPatch.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.1";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,23 @@
{
"_id": 151,
"name": "JumpPatch",
"modversion": "1.0.1",
"gameversion": "2022r170p1",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "Prevents you from jumping until you've been grounded for a frame.\nThis ensures Grounded parameter fires when hitting the ground while holding jump.",
"searchtags": [
"jump",
"animation",
"grounded",
"simple"
],
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r4/JumpPatch.dll",
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/JumpPatch/",
"changelog": "- Return jump input after MovementSystem.Update. Fixes conflict with PRM jump-to-recover option.",
"embedcolor": "#e56597"
}

View file

@ -0,0 +1,117 @@
using ABI.CCK.Components;
using ABI_RC.Core.Player;
using UnityEngine;
namespace NAK.CCK.CustomComponents;
public class NAKPointerTracker : MonoBehaviour
{
// Configuration
public Transform referenceTransform;
public string pointerType = "";
public float radius = 0.1f;
public Vector3 offset = Vector3.zero;
// Animator module
public Animator animator;
public string parameterName;
// Internal stuff
bool isLocal;
float initialAngle;
CVRPointer trackedPointer;
void Start()
{
// Create collider
Collider collider = base.gameObject.GetComponent<Collider>();
if (collider == null)
{
SphereCollider sphereCollider = base.gameObject.AddComponent<SphereCollider>();
sphereCollider.isTrigger = true;
Vector3 lossyScale = base.transform.lossyScale;
sphereCollider.radius = radius / Mathf.Max(Mathf.Max(lossyScale.x, lossyScale.y), lossyScale.z);
sphereCollider.center = offset;
}
// Create rigidbody (required for triggers)
Rigidbody rigidbody = base.gameObject.GetComponent<Rigidbody>();
if (rigidbody == null)
{
rigidbody = base.gameObject.AddComponent<Rigidbody>();
rigidbody.useGravity = false;
rigidbody.isKinematic = true;
}
// Initial setup
if (referenceTransform == null) referenceTransform = transform;
Vector3 direction = (transform.TransformPoint(offset) - referenceTransform.position);
Vector3 projectedDirection = Vector3.ProjectOnPlane(direction, referenceTransform.up);
initialAngle = Vector3.SignedAngle(referenceTransform.forward, projectedDirection, referenceTransform.up);
isLocal = gameObject.layer == 8;
}
void OnDrawGizmosSelected()
{
if (base.isActiveAndEnabled)
{
Gizmos.color = Color.red;
Gizmos.matrix = Matrix4x4.TRS(base.transform.position, base.transform.rotation, Vector3.one);
Gizmos.DrawWireSphere(offset, radius);
}
}
void OnTriggerEnter(Collider other)
{
if (trackedPointer != null) return;
// generic pointer or specific pointer
CVRPointer pointer = other.gameObject.GetComponent<CVRPointer>();
if (pointer != null && (String.IsNullOrEmpty(pointerType) || pointer.type == pointerType))
{
trackedPointer = pointer;
}
}
void Update()
{
if (trackedPointer == null) return;
// Check if tracked pointer was disabled
if (!trackedPointer.isActiveAndEnabled)
{
ReleasePointer();
return;
}
TrackPointer();
}
void TrackPointer()
{
if (animator != null)
{
float angle = GetAngleFromPosition(trackedPointer.transform.position, initialAngle) / 360;
if (!isLocal)
{
animator.SetFloat(parameterName + "_Angle", angle);
return;
}
PlayerSetup.Instance.changeAnimatorParam(parameterName + "_Angle", angle);
}
}
void ReleasePointer()
{
trackedPointer = null;
}
float GetAngleFromPosition(Vector3 trackedPos, float offset = 0)
{
Vector3 direction = (trackedPos - referenceTransform.position);
Vector3 projectedDirection = Vector3.ProjectOnPlane(direction, referenceTransform.up);
float angle = Vector3.SignedAngle(referenceTransform.forward, projectedDirection, referenceTransform.up) - offset;
if (angle < 0) angle += 360f;
return angle;
}
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk"/>

View file

@ -0,0 +1,15 @@
using ABI_RC.Core.Util.AssetFiltering;
using MelonLoader;
using NAK.CCK.CustomComponents;
namespace NAK.CustomComponents;
public class CustomComponents : MelonMod
{
public override void OnInitializeMelon()
{
// Add our CCK component to the prop whitelist
var propWhitelist = SharedFilter._avatarWhitelist;
propWhitelist.Add(typeof(NAKPointerTracker));
}
}

View file

@ -0,0 +1,30 @@
using MelonLoader;
using NAK.CustomComponents.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.CustomComponents))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.CustomComponents))]
[assembly: MelonInfo(
typeof(NAK.CustomComponents.CustomComponents),
nameof(NAK.CustomComponents),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/CustomComponents"
)]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: HarmonyDontPatchAll]
namespace NAK.CustomComponents.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.0";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,23 @@
{
"_id": 147,
"name": "PropUndoButton",
"modversion": "1.0.1",
"gameversion": "2022r170p1",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "**CTRL+Z** to undo latest spawned prop. **CTRL+SHIFT+Z** to redo deleted prop.\nIncludes optional SFX for prop spawn, undo, redo, warn, and deny, which can be disabled in settings.\n\nYou can replace the sfx in 'ChilloutVR\\ChilloutVR_Data\\StreamingAssets\\Cohtml\\UIResources\\GameUI\\mods\\PropUndo\\audio'.",
"searchtags": [
"prop",
"undo",
"bind",
"button"
],
"requirements": [
"None"
],
"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

@ -0,0 +1,36 @@
using ABI_RC.Core.IO;
using MelonLoader;
using UnityEngine;
namespace NAK.Nevermind;
public class Nevermind : MelonMod
{
public override void OnUpdate()
{
if (!Input.GetKeyDown(KeyCode.Home)) return;
CancelWorldDownloadJoinOnComplete();
CancelWorldLoadJoin();
}
void CancelWorldDownloadJoinOnComplete()
{
var downloadManager = CVRDownloadManager.Instance;
downloadManager.ActiveWorldDownload = false;
foreach (var download in downloadManager._downloadTasks)
download.Value.JoinOnComplete = false;
}
void CancelWorldLoadJoin()
{
var objectLoader = CVRObjectLoader.Instance;
if (!objectLoader._isLoadingWorld)
{
objectLoader.j.Bytes = null;
objectLoader.j.ObjectId = null;
objectLoader.IsLoadingWorldToJoin = false;
objectLoader.CurrentWorldLoadingStage = -1;
}
}
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk"/>

View file

@ -0,0 +1,31 @@
using Nevermind.Properties;
using MelonLoader;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.Nevermind))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.Nevermind))]
[assembly: MelonInfo(
typeof(NAK.Nevermind.Nevermind),
nameof(NAK.Nevermind),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/Nevermind"
)]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: MelonOptionalDependencies("BTKUILib")]
[assembly: HarmonyDontPatchAll]
namespace Nevermind.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.0";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,23 @@
{
"_id": 129,
"name": "Nevermind",
"modversion": "1.0.0",
"gameversion": "2022r170p1",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "Prevents VRIK from using toe bones in VR & optionaly FBT.\n\nVRIK calculates weird center of mass when toes are mapped, so it is sometimes desired to unmap toes to prevent an avatars feet from resting far back.\n\nPlease see the README for relevant imagery detailing the problem.",
"searchtags": [
"toes",
"vrik",
"ik",
"feet"
],
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/Nevermind.dll",
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/Nevermind/",
"changelog": "- Initial Release\n- No double patching. Bad. Stinky. Dont do it.",
"embedcolor": "#ffc700"
}

View file

@ -0,0 +1,73 @@
using ABI_RC.Core.Base;
using ABI_RC.Core.Player;
using MelonLoader;
using System.Reflection;
using System.Web.Services.Description;
using ABI_RC.Systems.Camera;
using UnityEngine;
using Valve.VR.InteractionSystem;
namespace NAK.NoDepthOnlyFlat;
public class NoDepthOnlyFlat : MelonMod
{
public static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(NoDepthOnlyFlat));
public static readonly MelonPreferences_Entry<bool> EntryUseDepthOnPlayerCamera =
Category.CreateEntry("Use Depth On Player Camera", false, description: "Toggle depth texture on player cameras.");
public static readonly MelonPreferences_Entry<bool> EntryUseDepthOnPortableCamera =
Category.CreateEntry("Use Depth On Portable Camera", false, description: "Toggle depth texture on portable camera.");
public override void OnInitializeMelon()
{
HarmonyInstance.Patch(
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.Start)),
postfix: new HarmonyLib.HarmonyMethod(typeof(NoDepthOnlyFlat).GetMethod(nameof(OnPlayerSetupStart_Postfix), BindingFlags.NonPublic | BindingFlags.Static))
);
HarmonyInstance.Patch(
typeof(PortableCamera).GetMethod(nameof(PortableCamera.Start)),
postfix: new HarmonyLib.HarmonyMethod(typeof(NoDepthOnlyFlat).GetMethod(nameof(OnPortableCameraStart_Postfix), BindingFlags.NonPublic | BindingFlags.Static))
);
foreach (MelonPreferences_Entry setting in Category.Entries)
setting.OnEntryValueChangedUntyped.Subscribe(OnSettingsChanged);
}
public static void OnSettingsChanged(object oldValue = null, object newValue = null)
{
SetPlayerSetupCameraDepthTextureMode(EntryUseDepthOnPlayerCamera.Value);
SetPortableCameraDepthTextureMode(EntryUseDepthOnPortableCamera.Value);
}
private static void SetPlayerSetupCameraDepthTextureMode(bool useDepth)
{
if (PlayerSetup.Instance != null)
{
PlayerSetup.Instance.desktopCamera.GetComponent<Camera>().depthTextureMode = useDepth ? DepthTextureMode.Depth : DepthTextureMode.None;
PlayerSetup.Instance.vrCamera.GetComponent<Camera>().depthTextureMode = useDepth ? DepthTextureMode.Depth : DepthTextureMode.None;
}
}
private static void SetPortableCameraDepthTextureMode(bool useDepth)
{
if (PortableCamera.Instance != null)
{
PortableCamera.Instance._camera.depthTextureMode = useDepth ? DepthTextureMode.Depth : DepthTextureMode.None;
}
}
// Lazy way to set settings on start
private static void OnPlayerSetupStart_Postfix()
{
SetPlayerSetupCameraDepthTextureMode(EntryUseDepthOnPlayerCamera.Value);
}
private static void OnPortableCameraStart_Postfix()
{
SetPortableCameraDepthTextureMode(EntryUseDepthOnPortableCamera.Value);
}
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk" />

View file

@ -0,0 +1,29 @@
using MelonLoader;
using NAK.NoDepthOnlyFlat.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.NoDepthOnlyFlat))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.NoDepthOnlyFlat))]
[assembly: MelonInfo(
typeof(NAK.NoDepthOnlyFlat.NoDepthOnlyFlat),
nameof(NAK.NoDepthOnlyFlat),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/NoDepthOnlyFlat"
)]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
namespace NAK.NoDepthOnlyFlat.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.0";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,14 @@
# NoDepthOnlyFlat
Sets depth texture mode for player and portable cameras or something. Shit together, have not tested, it could explode.
---
Here is the block of text where I tell you this mod is not affiliated or endorsed by ABI.
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
> This mod is an independent creation and is not affiliated with, supported by or approved by Alpha Blend Interactive.
> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use.
> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive.

View file

@ -0,0 +1,23 @@
{
"_id": 172,
"name": "NoDepthOnlyFlat",
"modversion": "1.0.0",
"gameversion": "2022r170p1",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "Exterrata & NotAKidoS",
"description": "A simple mod to add an audio cue for muting and unmuting.\n\nYou can replace the sfx in 'ChilloutVR\\ChilloutVR_Data\\StreamingAssets\\Cohtml\\UIResources\\GameUI\\mods\\NoDepthOnlyFlat\\audio'.",
"searchtags": [
"mute",
"unmute",
"audio",
"sound"
],
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r13/NoDepthOnlyFlat.dll",
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/NoDepthOnlyFlat/",
"changelog": "- Initial CVRMG release",
"embedcolor": "92e492"
}

View file

@ -0,0 +1,54 @@
using ABI_RC.Core.Player;
using ABI_RC.Core.Savior;
using HarmonyLib;
using UnityEngine;
namespace NAK.PlaySpaceScaleFix.HarmonyPatches;
class PlayerSetupPatches
{
/**
Store vrCamera position before vrRig is scaled.
Use new vrCamera position after vrRig is scaled to get an offset.
Use offset on _PlayerLocal object to keep player in place.
Calculate scale difference, use to scale the avatars local position to keep avatar in place.
**/
[HarmonyPrefix]
[HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.SetPlaySpaceScale))]
static void Prefix_PlayerSetup_SetPlaySpaceScale(ref PlayerSetup __instance, ref Vector3 __state)
{
__state = __instance.vrCamera.transform.position;
__state.y = __instance.transform.position.y;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.SetPlaySpaceScale))]
static void Postfix_PlayerSetup_SetPlaySpaceScale(ref PlayerSetup __instance, ref Vector3 __state)
{
// DesktopVRSwitch might allow an offset other than 0,0,0 for the vrCamera in Desktop
// Safest to just not run this patch if in Desktop, as Desktop doesn't have an offset at all anyways
if (!PlaySpaceScaleFix.EntryEnabled.Value || !MetaPort.Instance.isUsingVr)
return;
Vector3 newPosition = __instance.vrCamera.transform.position;
newPosition.y = __instance.transform.position.y;
Vector3 offset = newPosition - __state;
// Offset _PlayerLocal to keep player in place
__instance.transform.position -= offset;
// Scale avatar local position to keep avatar in place
if (__instance._avatar != null)
{
// This calculation done in PlayerSetup.CheckUpdateAvatarScaleToPlaySpaceRelation already, but using Initial scale.
// We only need difference between last and current scale for scaling the localposition.
Vector3 scaleDifferenceNotInitial = __instance.DivideVectors(__instance._avatar.transform.localScale, __instance.lastScale);
__instance._avatar.transform.localPosition = Vector3.Scale(__instance._avatar.transform.localPosition, scaleDifferenceNotInitial);
}
}
}

View file

@ -0,0 +1,30 @@
using MelonLoader;
namespace NAK.PlaySpaceScaleFix;
public class PlaySpaceScaleFix : MelonMod
{
public static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(PlaySpaceScaleFix));
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
Category.CreateEntry("Enabled", true, description: "Toggle PlaySpaceScaleFix entirely.");
public override void OnInitializeMelon()
{
ApplyPatches(typeof(HarmonyPatches.PlayerSetupPatches));
}
void ApplyPatches(Type type)
{
try
{
HarmonyInstance.PatchAll(type);
}
catch (Exception e)
{
LoggerInstance.Msg($"Failed while patching {type.Name}!");
LoggerInstance.Error(e);
}
}
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk"/>

View file

@ -0,0 +1,32 @@
using MelonLoader;
using NAK.PlaySpaceScaleFix.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.PlaySpaceScaleFix))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.PlaySpaceScaleFix))]
[assembly: MelonInfo(
typeof(NAK.PlaySpaceScaleFix.PlaySpaceScaleFix),
nameof(NAK.PlaySpaceScaleFix),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PlaySpaceScaleFix"
)]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: MelonColor(255, 241, 200, 82)]
[assembly: MelonAuthorColor(255, 114, 17, 25)]
[assembly: HarmonyDontPatchAll]
namespace NAK.PlaySpaceScaleFix.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.0";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,18 @@
# PlaySpaceScaleFix
Fixes the issue where the player in VR is incorrectly positioned relative to the center of the playspace when adjusting playspace scales.
Ensures that scaling and switching avatars no longer result in unusual offsets.
https://github.com/NotAKidOnSteam/NAK_CVR_Mods/assets/37721153/50cf5934-1548-4e58-b40b-004a74c4e01d
---
Here is the block of text where I tell you this mod is not affiliated or endorsed by ABI.
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
> This mod is an independent creation and is not affiliated with, supported by or approved by Alpha Blend Interactive.
> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use.
> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive.

View file

@ -0,0 +1,23 @@
{
"_id": -1,
"name": "PlaySpaceScaleFix",
"modversion": "1.0.0",
"gameversion": "2022r170p1",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "Fixes the issue where the player in VR is incorrectly positioned relative to the center of the playspace when adjusting playspace scales.\n\nEnsures that scaling and switching avatars no longer result in unusual offsets.",
"searchtags": [
"scale",
"play",
"space",
"offset"
],
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r4/PlaySpaceScaleFix.dll",
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PlaySpaceScaleFix/",
"changelog": "- Initial Release",
"embedcolor": "#e56597"
}

View file

@ -0,0 +1,47 @@
using ABI_RC.Systems.IK;
using HarmonyLib;
using UnityEngine;
using Valve.VR;
namespace NAK.TrackedPointFix.HarmonyPatches;
class IKSystemPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(TrackingPoint), nameof(TrackingPoint.SetVisibility))]
static void Postfix_TrackingPoint_SetVisibility(ref TrackingPoint __instance)
{
GameObject systemTracker = __instance.referenceTransform.Find("DisplayTracker").gameObject;
if (systemTracker != null)
{
systemTracker.SetActive(__instance.displayObject.activeSelf);
__instance.displayObject.SetActive(false);
}
}
[HarmonyPostfix]
[HarmonyPatch(typeof(TrackingPoint), nameof(TrackingPoint.Initialize))]
static void Postfix_TrackingPoint_Initialize(ref TrackingPoint __instance)
{
GameObject systemTracker = new GameObject();
systemTracker.name = "DisplayTracker";
systemTracker.transform.parent = __instance.referenceTransform;
systemTracker.transform.localPosition = Vector3.zero;
systemTracker.transform.localRotation = Quaternion.identity;
systemTracker.transform.localScale = Vector3.one;
systemTracker.SetActive(false);
SteamVR_RenderModel renderModel = systemTracker.AddComponent<SteamVR_RenderModel>();
renderModel.enabled = true;
renderModel.updateDynamically = false;
renderModel.createComponents = false;
renderModel.SetDeviceIndex(ExtractNumberFromTrackingPoint(__instance.name));
}
public static int ExtractNumberFromTrackingPoint(string inputString)
{
string numberString = inputString.Replace("SteamVR_", "");
int number = int.Parse(numberString);
return number;
}
}

View file

@ -0,0 +1,24 @@
using MelonLoader;
namespace NAK.TrackedPointFix;
public class TrackedPointFix : MelonMod
{
public override void OnInitializeMelon()
{
ApplyPatches(typeof(HarmonyPatches.IKSystemPatches));
}
void ApplyPatches(Type type)
{
try
{
HarmonyInstance.PatchAll(type);
}
catch (Exception e)
{
LoggerInstance.Msg($"Failed while patching {type.Name}!");
LoggerInstance.Error(e);
}
}
}

View file

@ -0,0 +1,30 @@
using MelonLoader;
using NAK.TrackedPointFix.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.TrackedPointFix))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.TrackedPointFix))]
[assembly: MelonInfo(
typeof(NAK.TrackedPointFix.TrackedPointFix),
nameof(NAK.TrackedPointFix),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/TrackedPointFix"
)]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: HarmonyDontPatchAll]
namespace NAK.TrackedPointFix.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.3";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,19 @@
# TrackedPointFix (Depricated)
lazy af fix for a small issue
Your Left/Right hand controllers will now track faster and while in the Steam overlay.
This approach to fixing the issue is made lazy to support DesktopVRSwitch.
(also because im lazy)
---
Here is the block of text where I tell you this mod is not affiliated or endorsed by ABI.
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
> This mod is an independent creation and is not affiliated with, supported by or approved by Alpha Blend Interactive.
> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use.
> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive.

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk"/>

View file

@ -0,0 +1,23 @@
{
"_id": -1,
"name": "TrackedPointFix",
"modversion": "1.0.0",
"gameversion": "2022r170p1",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "Allows your controllers to track while the SteamVR overlay is open. This also fixes Quest/Touch controllers feeling slow during fast movements.",
"searchtags": [
"vr",
"quest",
"controller",
"tracking"
],
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/TrackedPointFix.dll",
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/TrackedPointFix/",
"changelog": "Initial Release",
"embedcolor": "3498db"
}