Decompiled source of ShipLoot VR Fix v1.0.0

slenered.SLVRF.dll

Decompiled 17 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LCVR.UI;
using Microsoft.CodeAnalysis;
using ShipLoot.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("LCVR")]
[assembly: IgnoresAccessChecksTo("Newtonsoft.Json")]
[assembly: IgnoresAccessChecksTo("ShipLoot")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("UnityEngine")]
[assembly: AssemblyCompany("slenered.SLVRF")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ShipLoot VR Fix")]
[assembly: AssemblyTitle("slenered.SLVRF")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 ShipLoot_VR_Fix
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("slenered.SLVRF", "ShipLoot VR Fix", "1.0.0")]
	public class ShipLoot_VR_Fix : BaseUnityPlugin
	{
		internal static class VRHUDPatch
		{
			[HarmonyPatch(typeof(VRHUD), "Awake")]
			[HarmonyPostfix]
			private static void getVRHUD(VRHUD __instance)
			{
				Instance.VRHUD = __instance;
				Instance.Logger.LogInfo((object)"Retrieving VR HUD");
			}

			[HarmonyPatch(typeof(HudManagerPatcher), "CopyValueCounter")]
			[HarmonyPostfix]
			private static void PatchShipLoot()
			{
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
				HudManagerPatcher._totalCounter.transform.SetParent(((Component)Instance.VRHUD.PitchLockedCanvas).transform, false);
				Vector3 localPosition = HudManagerPatcher._totalCounter.transform.localPosition;
				Quaternion localRotation = HudManagerPatcher._totalCounter.transform.localRotation;
				HudManagerPatcher._totalCounter.transform.localPosition = new Vector3(localPosition.x - 360f, -270f, localPosition.z + 85f);
				HudManagerPatcher._totalCounter.transform.localRotation = new Quaternion(localRotation.x + 0f, localRotation.y + 0.03f, localRotation.z + 0f, localRotation.w);
				HudManagerPatcher._totalCounter.transform.localScale = Vector3.one * 1.5f;
				Instance.Logger.LogInfo((object)"Patched ShipLoot UI");
			}
		}

		private static ShipLoot_VR_Fix Instance { get; set; }

		private ManualLogSource Logger { get; set; }

		private static Harmony? Harmony { get; set; }

		private VRHUD VRHUD { get; set; }

		private void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			Logger = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			Harmony = new Harmony("slenered.SLVRF");
			try
			{
				Harmony.PatchAll(typeof(VRHUDPatch));
			}
			catch (Exception ex)
			{
				Logger.LogError((object)("Failed to patch fix; '" + ex.Message + "'\n" + ex.StackTrace));
			}
			Logger.LogInfo((object)"slenered.SLVRF v1.0.0 has loaded!");
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "slenered.SLVRF";

		public const string PLUGIN_NAME = "ShipLoot VR Fix";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}