Move many mods to Deprecated folder, fix spelling

This commit is contained in:
NotAKidoS 2025-04-03 02:57:35 -05:00
parent 5e822cec8d
commit 0042590aa6
539 changed files with 7475 additions and 3120 deletions

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/NotAKidoS/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/NotAKidoS/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/NotAKidoS/NAK_CVR_Mods/releases/download/r4/PlaySpaceScaleFix.dll",
"sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/PlaySpaceScaleFix/",
"changelog": "- Initial Release",
"embedcolor": "#e56597"
}