Decompiled source of iInput v1.0.0

Mods/iInput.dll

Decompiled 3 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BoneLib;
using EyeTracking;
using EyeTracking.EyeGaze;
using MelonLoader;
using Microsoft.CodeAnalysis;
using UnityEngine;
using iInput;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(Core), "iInput", "1.0.0", "freakycheesy", "https://github.com/freakycheesy/iInput.git")]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("iInput")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+f5488a241a256d6c4fb5b54ee8f728f085bfecdf")]
[assembly: AssemblyProduct("iInput")]
[assembly: AssemblyTitle("iInput")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[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 iInput
{
	public class IInputTracking : EyeGazeImplementation
	{
		public override string Name => "iInput";

		public override string DeviceId => "electric.toaster";

		public override bool IsLoaded => true;

		public override void Initialize()
		{
			MelonLogger.Msg("Loaded");
		}

		public override void Update()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			if (Player.HandsExist)
			{
				bool num = Player.LeftController.GetThumbStickTouch() || Player.RightController.GetThumbStickTouch();
				Vector2 gaze = default(Vector2);
				if (num)
				{
					float num2 = (Player.LeftController.GetThumbStickTouch() ? (Player.LeftController.GetThumbStickAxis().x / 2f) : (Player.RightController.GetThumbStickAxis().x / 1.5f));
					float num3 = Player.RightController.GetThumbStickAxis().y / 2.5f;
					((Vector2)(ref gaze))..ctor(num2, num3);
				}
				Tracking.Data.Eye.Left.Gaze = gaze;
				Tracking.Data.Eye.Right.Gaze = gaze;
				Tracking.Data.Eye.Left.PupilDiameterMm = 5f;
				Tracking.Data.Eye.Right.PupilDiameterMm = 5f;
				float num4 = Mathf.Clamp(Player.LeftController.GetIndexCurlAxis() + Player.LeftController.GetMiddleCurlAxis(), 0f, 1f);
				float num5 = Mathf.Clamp(Player.RightController.GetIndexCurlAxis() + Player.RightController.GetMiddleCurlAxis(), 0f, 1f);
				float num6 = num4 + num5;
				float openness = 2.45f - num6;
				Tracking.Data.Eye.Left.Openness = openness;
				Tracking.Data.Eye.Right.Openness = openness;
				Tracking.Data.Eye.MinDilation = 0f;
				Tracking.Data.Eye.MaxDilation = 10f;
			}
		}
	}
	public class Core : MelonMod
	{
		public override void OnInitializeMelon()
		{
			((MelonBase)this).LoggerInstance.Msg("Initialized.");
		}
	}
}