Decompiled source of Guncase Lockout Fix v1.0.1

DrDog.CaseLockoutFix.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("Dr_Dog_PhD")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Fixes the bug with guncases that causes them to break when leaving the Safehouse with the cover open.")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1")]
[assembly: AssemblyProduct("DrDog.CaseLockoutFix")]
[assembly: AssemblyTitle("Guncase Lockout Fix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.1.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 BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string id = null, string name = null, string version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string id = null, string name = null, string version = null)
		{
		}
	}
}
namespace DrDog
{
	[BepInProcess("h3vr.exe")]
	[BepInPlugin("DrDog.CaseLockoutFix", "Guncase Lockout Fix", "1.0.1")]
	public class CaseLockoutFix : BaseUnityPlugin
	{
		public class SaveableGunCaseCoverFixHook
		{
			[HarmonyPatch(typeof(SaveableGunCaseLatch), "IsInteractable")]
			[HarmonyPrefix]
			private static bool Prefix(SaveableGunCaseLatch __instance, ref bool __result)
			{
				if (__instance.Cover.IsOpen())
				{
					__result = true;
					return false;
				}
				return true;
			}
		}

		public const string Id = "DrDog.CaseLockoutFix";

		internal static ManualLogSource Logger { get; private set; }

		public static string Name => "Guncase Lockout Fix";

		public static string Version => "1.0.1";

		public void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogMessage((object)("Hello, world! Sent from DrDog.CaseLockoutFix " + Name + " " + Version));
			Harmony.CreateAndPatchAll(typeof(SaveableGunCaseCoverFixHook), (string)null);
		}
	}
}