mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
Move many mods to Deprecated folder, fix spelling
This commit is contained in:
parent
5e822cec8d
commit
0042590aa6
539 changed files with 7475 additions and 3120 deletions
6
.Deprecated/CameraExperiments/CameraExperiments.csproj
Normal file
6
.Deprecated/CameraExperiments/CameraExperiments.csproj
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</Project>
|
170
.Deprecated/CameraExperiments/Main.cs
Normal file
170
.Deprecated/CameraExperiments/Main.cs
Normal file
|
@ -0,0 +1,170 @@
|
|||
using ABI_RC.Core;
|
||||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI_RC.Core.Player;
|
||||
using HarmonyLib;
|
||||
using MagicaCloth2;
|
||||
using MelonLoader;
|
||||
using Unity.Burst;
|
||||
using Unity.Collections;
|
||||
using Unity.Jobs;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.WhereAmIPointing;
|
||||
|
||||
public class WhereAmIPointingMod : MelonMod
|
||||
{
|
||||
#region Melon Preferences
|
||||
|
||||
// cannot disable because then id need extra logic to reset the alpha :)
|
||||
// private const string SettingsCategory = nameof(WhereAmIPointingMod);
|
||||
//
|
||||
// private static readonly MelonPreferences_Category Category =
|
||||
// MelonPreferences.CreateCategory(SettingsCategory);
|
||||
//
|
||||
// private static readonly MelonPreferences_Entry<bool> Entry_Enabled =
|
||||
// Category.CreateEntry("enabled", true, display_name: "Enabled",description: "Toggle WhereAmIPointingMod entirely.");
|
||||
|
||||
#endregion Melon Preferences
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
ApplyPatches(typeof(TransformManager_Patches));
|
||||
}
|
||||
|
||||
private void ApplyPatches(Type type)
|
||||
{
|
||||
try
|
||||
{
|
||||
HarmonyInstance.PatchAll(type);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LoggerInstance.Msg($"Failed while patching {type.Name}!");
|
||||
LoggerInstance.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
internal static class TransformManager_Patches
|
||||
{
|
||||
// Patch for EnableTransform(DataChunk, bool)
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TransformManager), nameof(TransformManager.EnableTransform), new[] { typeof(DataChunk), typeof(bool) })]
|
||||
private static bool OnEnableTransformChunk(TransformManager __instance, DataChunk c, bool sw, ref NativeArray<ExBitFlag8> ___flagArray)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Enhanced validation
|
||||
if (!__instance.IsValid())
|
||||
return false;
|
||||
|
||||
if (___flagArray == null || !___flagArray.IsCreated)
|
||||
{
|
||||
Debug.LogWarning("[MagicaCloth2] EnableTransform failed: Flag array is invalid or disposed");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!c.IsValid || c.startIndex < 0 || c.startIndex + c.dataLength > ___flagArray.Length)
|
||||
{
|
||||
Debug.LogWarning($"[MagicaCloth2] EnableTransform failed: Invalid chunk parameters. Start: {c.startIndex}, Length: {c.dataLength}, Array Length: {___flagArray.Length}");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create and run the job with additional safety
|
||||
SafeEnableTransformJob job = new()
|
||||
{
|
||||
chunk = c,
|
||||
sw = sw,
|
||||
flagList = ___flagArray,
|
||||
maxLength = ___flagArray.Length
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
job.Run();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[MagicaCloth2] Error in EnableTransform job execution: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
|
||||
return false; // Prevent original method execution
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[MagicaCloth2] Critical error in EnableTransform patch: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Patch for EnableTransform(int, bool)
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TransformManager), nameof(TransformManager.EnableTransform), new[] { typeof(int), typeof(bool) })]
|
||||
private static bool OnEnableTransformIndex(TransformManager __instance, int index, bool sw, ref NativeArray<ExBitFlag8> ___flagArray)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Enhanced validation
|
||||
if (!__instance.IsValid())
|
||||
return false;
|
||||
|
||||
if (___flagArray == null || !___flagArray.IsCreated)
|
||||
{
|
||||
Debug.LogWarning("[MagicaCloth2] EnableTransform failed: Flag array is invalid or disposed");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (index < 0 || index >= ___flagArray.Length)
|
||||
{
|
||||
Debug.LogWarning($"[MagicaCloth2] EnableTransform failed: Index {index} out of range [0, {___flagArray.Length})");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Safely modify the flag
|
||||
var flag = ___flagArray[index];
|
||||
if (flag.Value == 0)
|
||||
return false;
|
||||
|
||||
flag.SetFlag(TransformManager.Flag_Enable, sw);
|
||||
___flagArray[index] = flag;
|
||||
|
||||
return false; // Prevent original method execution
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[MagicaCloth2] Critical error in EnableTransform patch: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[BurstCompile]
|
||||
private struct SafeEnableTransformJob : IJob
|
||||
{
|
||||
public DataChunk chunk;
|
||||
public bool sw;
|
||||
public NativeArray<ExBitFlag8> flagList;
|
||||
[ReadOnly] public int maxLength;
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
// Additional bounds checking
|
||||
if (chunk.startIndex < 0 || chunk.startIndex + chunk.dataLength > maxLength)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < chunk.dataLength; i++)
|
||||
{
|
||||
int index = chunk.startIndex + i;
|
||||
if (index >= maxLength)
|
||||
break;
|
||||
|
||||
ExBitFlag8 flag = flagList[index];
|
||||
if (flag.Value == 0)
|
||||
continue;
|
||||
|
||||
flag.SetFlag(TransformManager.Flag_Enable, sw);
|
||||
flagList[index] = flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
32
.Deprecated/CameraExperiments/Properties/AssemblyInfo.cs
Normal file
32
.Deprecated/CameraExperiments/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using NAK.WhereAmIPointing.Properties;
|
||||
using MelonLoader;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyTitle(nameof(NAK.WhereAmIPointing))]
|
||||
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
|
||||
[assembly: AssemblyProduct(nameof(NAK.WhereAmIPointing))]
|
||||
|
||||
[assembly: MelonInfo(
|
||||
typeof(NAK.WhereAmIPointing.WhereAmIPointingMod),
|
||||
nameof(NAK.WhereAmIPointing),
|
||||
AssemblyInfoParams.Version,
|
||||
AssemblyInfoParams.Author,
|
||||
downloadLink: "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/WhereAmIPointing"
|
||||
)]
|
||||
|
||||
[assembly: MelonGame("Alpha Blend Interactive", "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.WhereAmIPointing.Properties;
|
||||
internal static class AssemblyInfoParams
|
||||
{
|
||||
public const string Version = "1.0.1";
|
||||
public const string Author = "NotAKidoS";
|
||||
}
|
14
.Deprecated/CameraExperiments/README.md
Normal file
14
.Deprecated/CameraExperiments/README.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
# WhereAmIPointing
|
||||
|
||||
Simple mod that makes your controller rays always visible when the menus are open. Useful for when you're trying to aim at something in the distance. Also visualizes which ray is being used for menu interaction.
|
||||
|
||||
---
|
||||
|
||||
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.
|
23
.Deprecated/CameraExperiments/format.json
Normal file
23
.Deprecated/CameraExperiments/format.json
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"_id": 234,
|
||||
"name": "WhereAmIPointing",
|
||||
"modversion": "1.0.1",
|
||||
"gameversion": "2024r175",
|
||||
"loaderversion": "0.6.1",
|
||||
"modtype": "Mod",
|
||||
"author": "NotAKidoS",
|
||||
"description": "Simple mod that makes your controller rays always visible when the menus are open. Useful for when you're trying to aim at something in the distance. Also visualizes which ray is being used for menu interaction.",
|
||||
"searchtags": [
|
||||
"controller",
|
||||
"ray",
|
||||
"line",
|
||||
"tomato"
|
||||
],
|
||||
"requirements": [
|
||||
"None"
|
||||
],
|
||||
"downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r40/WhereAmIPointing.dll",
|
||||
"sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/WhereAmIPointing/",
|
||||
"changelog": "- Fixed line renderer alpha not being reset when the menu is closed.",
|
||||
"embedcolor": "#f61963"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue