Decompiled source of HandsStuck v1.0.1

Mods/HandsStuck.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using HandsStuck;
using MelonLoader;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.XR.OpenXR;
using UnityEngine.XR.OpenXR.Features;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(global::HandsStuck.HandsStuck), "HandsStuck", "1.0.0", "HAHOOS", "https://thunderstore.io/c/bonelab/p/HAHOOS/HandsStuck")]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: MelonColor(0, 191, 35, 0)]
[assembly: AssemblyTitle("Fixes the controller tracking bug in newer versions of SteamVR")]
[assembly: AssemblyDescription("Fixes the controller tracking bug in newer versions of SteamVR")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HAHOOS")]
[assembly: AssemblyProduct("HandsStuck")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyFileVersion("1.0.1")]
[assembly: AssemblyInformationalVersion("1.0.1")]
[assembly: ComVisible(false)]
[assembly: Guid("5293f777-bfbf-4a4d-a006-95a2fc2670c3")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyVersion("1.0.1.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace HandsStuck
{
	public class HandsStuck : MelonMod
	{
		public const string Version = "1.0.1";

		public override void OnInitializeMelon()
		{
			OpenXRFeature val = ((IEnumerable<OpenXRFeature>)OpenXRSettings.Instance.features).First((OpenXRFeature x) => ((Object)x).name.StartsWith("EyeGazeInteraction"));
			if (val != null && val.enabled)
			{
				val.enabled = false;
				OpenXRSettings.Instance.ApplySettings();
				((MelonBase)this).LoggerInstance.Msg("Disabled EyeGazeInteraction feature, which breaks controller tracking on SteamVR beta");
			}
			else
			{
				((MelonBase)this).LoggerInstance.Msg("It seems like the feature is not enabled, which means the bug was already fixed by the devs");
			}
		}
	}
}