mass commit of laziness

This commit is contained in:
NotAKidoS 2025-12-28 20:30:00 -06:00
parent ce992c70ee
commit 6d4fc549d9
167 changed files with 5471 additions and 675 deletions

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>PlayerCloneAttachment</RootNamespace>
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\playercloneattachment.assets" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,169 @@
using ABI_RC.Core;
using ABI_RC.Core.InteractionSystem;
using ABI_RC.Core.Player;
using ABI_RC.Core.Savior;
using ABI_RC.Systems.FaceTracking;
using ABI_RC.Systems.InputManagement;
using MelonLoader;
using UnityEngine;
namespace NAK.ControlToUnlockEyes;
public class ControlToUnlockEyesMod : MelonMod
{
public override void OnInitializeMelon()
{
HarmonyInstance.Patch(
typeof(FaceTrackingManager).GetMethod(nameof(FaceTrackingManager.RegisterBuiltinModules),
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
postfix: new HarmonyLib.HarmonyMethod(typeof(ControlToUnlockEyesMod).GetMethod(nameof(OnPostFaceTrackingManagerRegisterBuiltinModules),
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static))
);
}
private static void OnPostFaceTrackingManagerRegisterBuiltinModules(FaceTrackingManager __instance)
=> __instance.RegisterEyeModule(new DefaultEyeModule());
public class DefaultEyeModule : IEyeTrackingModule
{
private const float FixedDistance = 10f;
private bool _useFixedDistance = true;
private readonly EyeTrackingData _eyeTrackingData = new();
private bool _dataAvailable;
private bool _running;
private ControllerRay _activeRay;
private Transform _rayDirectionTransform;
private CVRHand lastInteractHand = CVRHand.Right;
public bool Start(bool vr)
{
_running = true;
return true;
}
public void Stop()
{
_running = false;
}
public void Update()
{
if (!PlayerSetup.Instance)
return;
UpdateLastInteractHand();
UpdateFakedEyeTrackingData();
}
private void UpdateLastInteractHand()
{
ControllerRay leftRay = PlayerSetup.Instance.vrRayLeft;
ControllerRay rightRay = PlayerSetup.Instance.vrRayRight;
if (!MetaPort.Instance.isUsingVr)
{
_activeRay = PlayerSetup.Instance.desktopRay;
_rayDirectionTransform = _activeRay.rayDirectionTransform;
return;
}
bool leftAvailable = IsHandAvailable(leftRay, CVRHand.Left);
bool rightAvailable = IsHandAvailable(rightRay, CVRHand.Right);
if (CVRInputManager.Instance.interactLeftDown && leftAvailable)
lastInteractHand = CVRHand.Left;
else if (CVRInputManager.Instance.interactRightDown && rightAvailable)
lastInteractHand = CVRHand.Right;
_activeRay = GetLastInteractRay();
_rayDirectionTransform = _activeRay.rayDirectionTransform;
}
private void UpdateFakedEyeTrackingData()
{
_dataAvailable = _activeRay.CanSelectPlayersAndProps();
if (!_dataAvailable)
return;
_eyeTrackingData.blinking = false;
Transform ourCameraTransform = PlayerSetup.Instance.activeCam.transform;
Vector3 rayForward = _rayDirectionTransform.forward;
float rayDistance = _useFixedDistance ? FixedDistance : _activeRay.Hit.distance;
// TODO: dot product check to flip direction if behind camera
// Convert to camera-local *direction* (normalized) and multiply by selected distance so the gazePoint
// is on a sphere around the camera rather than mapped to a "square".
Vector3 localDir = ourCameraTransform.InverseTransformDirection(rayForward).normalized;
Vector3 localGazePoint = localDir * rayDistance;
_eyeTrackingData.gazePoint = localGazePoint;
}
private ControllerRay GetLastInteractRay()
{
if (!MetaPort.Instance.isUsingVr)
return PlayerSetup.Instance.desktopRay;
ControllerRay leftRay = PlayerSetup.Instance.vrRayLeft;
ControllerRay rightRay = PlayerSetup.Instance.vrRayRight;
if (lastInteractHand == CVRHand.Left && IsHandAvailable(leftRay, CVRHand.Left))
return leftRay;
if (lastInteractHand == CVRHand.Right && IsHandAvailable(rightRay, CVRHand.Right))
return rightRay;
return GetBestAvailableHand();
}
private ControllerRay GetBestAvailableHand()
{
if (!MetaPort.Instance.isUsingVr)
return PlayerSetup.Instance.desktopRay;
ControllerRay leftRay = PlayerSetup.Instance.vrRayLeft;
ControllerRay rightRay = PlayerSetup.Instance.vrRayRight;
bool leftAvailable = IsHandAvailable(leftRay, CVRHand.Left);
bool rightAvailable = IsHandAvailable(rightRay, CVRHand.Right);
if (CVRInputManager.Instance.interactLeftDown && leftAvailable)
return leftRay;
if (CVRInputManager.Instance.interactRightDown && rightAvailable)
return rightRay;
if (lastInteractHand == CVRHand.Left && leftAvailable)
return leftRay;
if (lastInteractHand == CVRHand.Right && rightAvailable)
return rightRay;
if (rightAvailable) return rightRay;
if (leftAvailable) return leftRay;
return rightRay;
}
private static bool IsHandAvailable(ControllerRay ray, CVRHand hand)
{
if (ray.grabbedObject)
return false;
if (CVR_MenuManager.Instance.IsViewShown &&
CVR_MenuManager.Instance.SelectedQuickMenuHand == hand)
return false;
return true;
}
public bool IsRunning() => _running;
public bool IsDataAvailable() => _dataAvailable;
public EyeTrackingData GetTrackingData() => _eyeTrackingData;
public string GetModuleName() => "None";
public string GetModuleShortName() => "None";
}
}

View file

@ -0,0 +1,32 @@
using MelonLoader;
using NAK.ControlToUnlockEyes.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.ControlToUnlockEyes))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.ControlToUnlockEyes))]
[assembly: MelonInfo(
typeof(NAK.ControlToUnlockEyes.ControlToUnlockEyesMod),
nameof(NAK.ControlToUnlockEyes),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/ControlToUnlockEyes"
)]
[assembly: MelonGame("ChilloutVR", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: MelonColor(255, 246, 25, 99)] // red-pink
[assembly: MelonAuthorColor(255, 158, 21, 32)] // red
[assembly: HarmonyDontPatchAll]
namespace NAK.ControlToUnlockEyes.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.0";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,22 @@
# YouAreMyPropNowWeAreHavingSoftTacosLater
Lets you bring held, attached, and occupied props through world loads. This is configurable in the mod settings.
https://youtu.be/9P6Jeh-VN58?si=eXTPGyKB_0wq1gZO
There is special logic in place for bringing air vehicles through world loads.
If above the ground you will be placed up to 20m above the spawnpoint of the next world.
## Examples
https://fixupx.com/NotAKidoS/status/1910545346922422675
---
Here is the block of text where I tell you this mod is not affiliated with or endorsed by ABI.
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
> This mod is an independent creation 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": 262,
"name": "YouAreMyPropNowWeAreHavingSoftTacosLater",
"modversion": "1.0.0",
"gameversion": "2025r180",
"loaderversion": "0.7.2",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "Lets you bring held, attached, and occupied props through world loads. This is configurable in the mod settings.\nhttps://youtu.be/9P6Jeh-VN58?si=eXTPGyKB_0wq1gZO\n\nThere is special logic in place for bringing air vehicles through world loads. If above the ground you will be placed up to 20m above the spawnpoint of the next world.",
"searchtags": [
"prop",
"spawn",
"friend",
"load"
],
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r47/YouAreMyPropNowWeAreHavingSoftTacosLater.dll",
"sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/YouAreMyPropNowWeAreHavingSoftTacosLater/",
"changelog": "- Initial release",
"embedcolor": "#f61963"
}