using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BoneLib; using BoneLib.BoneMenu; using HarmonyLib; using Il2CppSLZ.Marrow; using MelonLoader; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(PSVR2Fingers), "PSVR2 Fingers", "5.0.2", "Idris", null)] [assembly: MelonGame("Stress Level Zero", "BONELAB")] [assembly: AssemblyTitle("Psvr2 Index Fingers")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Psvr2 Index Fingers")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("a436d0b0-afb5-441b-8e02-d6f9bef82d77")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] public class PSVR2Fingers : MelonMod { [HarmonyPatch(typeof(OpenController), "ProcessFingers")] public class ControllerPatch { public static void Postfix(OpenController __instance) { if (!enabledMod) { return; } float num = Mathf.Clamp01(((BaseController)__instance)._processedIndex); float num2 = Mathf.Clamp01(((BaseController)__instance)._processedMiddle); if (num < 0.01f && num2 < 0.01f) { ((BaseController)__instance)._processedIndex = 0f; ((BaseController)__instance)._processedMiddle = 0f; ((BaseController)__instance)._processedRing = 0f; ((BaseController)__instance)._processedPinky = 0f; return; } ((BaseController)__instance)._processedIndex = num; ((BaseController)__instance)._processedMiddle = num2; if (num < 0.05f) { ((BaseController)__instance)._processedRing = 0f; ((BaseController)__instance)._processedPinky = 0f; } if (triggerClosesLowerFingers && num > 0.05f) { float processedPinky = (((BaseController)__instance)._processedRing = Mathf.Clamp01(num * 0.9f)); ((BaseController)__instance)._processedPinky = processedPinky; } ((BaseController)__instance)._processedThumb = Mathf.Clamp01(((BaseController)__instance)._processedThumb); ((BaseController)__instance)._processedIndex = Mathf.Clamp01(((BaseController)__instance)._processedIndex); ((BaseController)__instance)._processedMiddle = Mathf.Clamp01(((BaseController)__instance)._processedMiddle); ((BaseController)__instance)._processedRing = Mathf.Clamp01(((BaseController)__instance)._processedRing); ((BaseController)__instance)._processedPinky = Mathf.Clamp01(((BaseController)__instance)._processedPinky); } } public static bool enabledMod = true; public static bool triggerClosesLowerFingers = true; private static bool menuCreated = false; public override void OnInitializeMelon() { Hooking.OnLevelLoaded += OnLevelLoaded; ((MelonBase)this).HarmonyInstance.PatchAll(typeof(ControllerPatch)); } private void OnLevelLoaded(LevelInfo info) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (!menuCreated) { menuCreated = true; Page val = Page.Root.CreatePage("PSVR2 Fingers", Color.white, 0, true); val.CreateBool("Enable PSVR2 Fingers", Color.white, enabledMod, (Action)delegate(bool v) { enabledMod = v; }); val.CreateBool("Trigger Closes Ring + Pinky", Color.white, triggerClosesLowerFingers, (Action)delegate(bool v) { triggerClosesLowerFingers = v; }); } } }