This commit is contained in:
NotAKidoS 2023-05-09 03:46:58 -05:00
parent 26441f8b1e
commit c7b16abd4f
27 changed files with 591 additions and 91 deletions

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 HarmonyLib;
using UnityEngine;
using static ABI_RC.Core.CVRTools;
namespace NAK.CameraFixes.HarmonyPatches;
class CVRCamControllerPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(CVRCamController), nameof(CVRCamController.Start))]
static void Postfix_CVRCamController_Start(ref CVRCamController __instance)
{
SetGameObjectLayerRecursive(__instance.gameObject, LayerMask.NameToLayer("UI Internal"));
}
}

28
CameraFixes/Main.cs Normal file
View file

@ -0,0 +1,28 @@
using ABI_RC.Core.IO;
using MelonLoader;
using UnityEngine;
namespace NAK.CameraFixes;
public class CameraFixes : MelonMod
{
internal static MelonLogger.Instance Logger;
public override void OnInitializeMelon()
{
Logger = LoggerInstance;
ApplyPatches(typeof(HarmonyPatches.CVRCamControllerPatches));
}
void ApplyPatches(Type type)
{
try
{
HarmonyInstance.PatchAll(type);
}
catch (Exception e)
{
Logger.Msg($"Failed while patching {type.Name}!");
Logger.Error(e);
}
}
}

View file

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

23
CameraFixes/format.json Normal file
View file

@ -0,0 +1,23 @@
{
"_id": 129,
"name": "CameraFixes",
"modversion": "1.0.0",
"gameversion": "2022r170",
"loaderversion": "0.5.7",
"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/CameraFixes.dll",
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/CameraFixes/",
"changelog": "- Initial Release\n- No double patching. Bad. Stinky. Dont do it.",
"embedcolor": "#ffc700"
}