Decompiled source of Accessibility Options v1.0.0

Accessibility_Options.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using FistVR;
using ProBuilder2.Common;
using ProBuilder2.MeshOperations;
using UnityEngine;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[RequireComponent(typeof(ParticleSystem))]
public class CFX_AutoDestructShuriken : MonoBehaviour
{
	public bool OnlyDeactivate;

	private void OnEnable()
	{
		((MonoBehaviour)this).StartCoroutine("CheckIfAlive");
	}

	private IEnumerator CheckIfAlive()
	{
		do
		{
			yield return (object)new WaitForSeconds(0.5f);
		}
		while (((Component)this).GetComponent<ParticleSystem>().IsAlive(true));
		if (OnlyDeactivate)
		{
			((Component)this).gameObject.SetActive(false);
		}
		else
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
[RequireComponent(typeof(Light))]
public class CFX_LightIntensityFade : MonoBehaviour
{
	public float duration = 1f;

	public float delay = 0f;

	public float finalIntensity = 0f;

	private float baseIntensity;

	public bool autodestruct;

	private float p_lifetime = 0f;

	private float p_delay;

	private void Start()
	{
		baseIntensity = ((Component)this).GetComponent<Light>().intensity;
	}

	private void OnEnable()
	{
		p_lifetime = 0f;
		p_delay = delay;
		if (delay > 0f)
		{
			((Behaviour)((Component)this).GetComponent<Light>()).enabled = false;
		}
	}

	private void Update()
	{
		if (p_delay > 0f)
		{
			p_delay -= Time.deltaTime;
			if (p_delay <= 0f)
			{
				((Behaviour)((Component)this).GetComponent<Light>()).enabled = true;
			}
		}
		else if (p_lifetime / duration < 1f)
		{
			((Component)this).GetComponent<Light>().intensity = Mathf.Lerp(baseIntensity, finalIntensity, p_lifetime / duration);
			p_lifetime += Time.deltaTime;
		}
		else if (autodestruct)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
[RequireComponent(typeof(MeshFilter))]
public class WFX_BulletHoleDecal : MonoBehaviour
{
	private static Vector2[] quadUVs = (Vector2[])(object)new Vector2[4]
	{
		new Vector2(0f, 0f),
		new Vector2(0f, 1f),
		new Vector2(1f, 0f),
		new Vector2(1f, 1f)
	};

	public float lifetime = 10f;

	public float fadeoutpercent = 80f;

	public Vector2 frames;

	public bool randomRotation = false;

	public bool deactivate = false;

	private float life;

	private float fadeout;

	private Color color;

	private float orgAlpha;

	private void Awake()
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		color = ((Component)this).GetComponent<Renderer>().material.GetColor("_TintColor");
		orgAlpha = color.a;
	}

	private void OnEnable()
	{
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		int num = Random.Range(0, (int)(frames.x * frames.y));
		int num2 = (int)((float)num % frames.x);
		int num3 = (int)((float)num / frames.y);
		Vector2[] array = (Vector2[])(object)new Vector2[4];
		for (int i = 0; i < 4; i++)
		{
			array[i].x = (quadUVs[i].x + (float)num2) * (1f / frames.x);
			array[i].y = (quadUVs[i].y + (float)num3) * (1f / frames.y);
		}
		((Component)this).GetComponent<MeshFilter>().mesh.uv = array;
		if (randomRotation)
		{
			((Component)this).transform.Rotate(0f, 0f, Random.Range(0f, 360f), (Space)1);
		}
		life = lifetime;
		fadeout = life * (fadeoutpercent / 100f);
		color.a = orgAlpha;
		((Component)this).GetComponent<Renderer>().material.SetColor("_TintColor", color);
		((MonoBehaviour)this).StopAllCoroutines();
		((MonoBehaviour)this).StartCoroutine("holeUpdate");
	}

	private IEnumerator holeUpdate()
	{
		while (life > 0f)
		{
			life -= Time.deltaTime;
			if (life <= fadeout)
			{
				color.a = Mathf.Lerp(0f, orgAlpha, life / fadeout);
				((Component)this).GetComponent<Renderer>().material.SetColor("_TintColor", color);
			}
			yield return null;
		}
	}
}
[RequireComponent(typeof(Light))]
public class WFX_LightFlicker : MonoBehaviour
{
	public float time = 0.05f;

	private float timer;

	private void Start()
	{
		timer = time;
		((MonoBehaviour)this).StartCoroutine("Flicker");
	}

	private IEnumerator Flicker()
	{
		while (true)
		{
			((Behaviour)((Component)this).GetComponent<Light>()).enabled = !((Behaviour)((Component)this).GetComponent<Light>()).enabled;
			do
			{
				timer -= Time.deltaTime;
				yield return null;
			}
			while (timer > 0f);
			timer = time;
		}
	}
}
[BepInPlugin("Okkim.Accessibility_Options", "Accessibility_Options", "1.0.0")]
[BepInProcess("h3vr.exe")]
public class Accessibility_OptionsPlugin : BaseUnityPlugin
{
	private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

	private void Awake()
	{
		LoadAssets();
	}

	private void LoadAssets()
	{
	}
}
public class FollowTargetDebug : MonoBehaviour
{
	public bool check;

	private void OnLevelWasLoaded()
	{
		Debug.Log((object)("OnLevelWasLoaded, player head exists: " + GM.CurrentPlayerBody != null));
	}

	private void Awake()
	{
		Debug.Log((object)"OnAwake, player head exists: ");
	}

	private void Start()
	{
		Debug.Log((object)"Start, player head exists: ");
	}

	private void Update()
	{
		if (!check)
		{
			Debug.Log((object)"Update, player head exists: ");
		}
		check = true;
	}
}
public class ExtrudeRandomEdges : MonoBehaviour
{
	private pb_Object pb;

	private pb_Face lastExtrudedFace = null;

	public float distance = 1f;

	private void Start()
	{
		pb = pb_ShapeGenerator.PlaneGenerator(1f, 1f, 0, 0, (Axis)2, false);
		pb.SetFaceMaterial(pb.faces, pb_Constant.DefaultMaterial);
		lastExtrudedFace = pb.faces[0];
	}

	private void OnGUI()
	{
		if (GUILayout.Button("Extrude Random Edge", (GUILayoutOption[])(object)new GUILayoutOption[0]))
		{
			ExtrudeEdge();
		}
	}

	private void ExtrudeEdge()
	{
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		pb_Face sourceFace = lastExtrudedFace;
		List<pb_WingedEdge> wingedEdges = pb_WingedEdge.GetWingedEdges(pb, false);
		IEnumerable<pb_WingedEdge> source = wingedEdges.Where((pb_WingedEdge x) => x.face == sourceFace);
		List<pb_Edge> list = (from x in source
			where x.opposite == null
			select x into y
			select y.edge.local).ToList();
		int index = Random.Range(0, list.Count);
		pb_Edge val = list[index];
		Vector3 val2 = (pb.vertices[val.x] + pb.vertices[val.y]) * 0.5f - pb_Math.Average<int>((IList<int>)sourceFace.distinctIndices, (Func<int, Vector3>)((int x) => pb.vertices[x]), (IList<int>)null);
		((Vector3)(ref val2)).Normalize();
		pb_Edge[] selectedEdges = default(pb_Edge[]);
		pbMeshOps.Extrude(pb, (pb_Edge[])(object)new pb_Edge[1] { val }, 0f, false, true, ref selectedEdges);
		lastExtrudedFace = pb.faces.Last();
		pb.SetSelectedEdges((IEnumerable<pb_Edge>)selectedEdges);
		pb_Object_Utility.TranslateVertices(pb, pb.SelectedTriangles, val2 * distance);
		pb.ToMesh();
		pb.Refresh((RefreshMask)255);
	}
}
public class HighlightNearestFace : MonoBehaviour
{
	public float travel = 50f;

	public float speed = 0.2f;

	private pb_Object target;

	private pb_Face nearest = null;

	private void Start()
	{
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		target = pb_ShapeGenerator.PlaneGenerator(travel, travel, 25, 25, (Axis)2, false);
		target.SetFaceMaterial(target.faces, pb_Constant.DefaultMaterial);
		((Component)target).transform.position = new Vector3(travel * 0.5f, 0f, travel * 0.5f);
		target.ToMesh();
		target.Refresh((RefreshMask)255);
		Camera main = Camera.main;
		((Component)main).transform.position = new Vector3(25f, 40f, 0f);
		((Component)main).transform.localRotation = Quaternion.Euler(new Vector3(65f, 0f, 0f));
	}

	private void Update()
	{
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		float num = Time.time * speed;
		Vector3 position = default(Vector3);
		((Vector3)(ref position))..ctor(Mathf.PerlinNoise(num, num) * travel, 2f, Mathf.PerlinNoise(num + 1f, num + 1f) * travel);
		((Component)this).transform.position = position;
		if ((Object)(object)target == (Object)null)
		{
			Debug.LogWarning((object)"Missing the ProBuilder Mesh target!");
			return;
		}
		Vector3 val = ((Component)target).transform.InverseTransformPoint(((Component)this).transform.position);
		if (nearest != null)
		{
			target.SetFaceColor(nearest, Color.white);
		}
		int num2 = target.faces.Length;
		float num3 = float.PositiveInfinity;
		nearest = target.faces[0];
		for (int i = 0; i < num2; i++)
		{
			float num4 = Vector3.Distance(val, FaceCenter(target, target.faces[i]));
			if (num4 < num3)
			{
				num3 = num4;
				nearest = target.faces[i];
			}
		}
		target.SetFaceColor(nearest, Color.blue);
		target.RefreshColors();
	}

	private Vector3 FaceCenter(pb_Object pb, pb_Face face)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		Vector3[] vertices = pb.vertices;
		Vector3 zero = Vector3.zero;
		int[] distinctIndices = face.distinctIndices;
		foreach (int num in distinctIndices)
		{
			zero.x += vertices[num].x;
			zero.y += vertices[num].y;
			zero.z += vertices[num].z;
		}
		float num2 = face.distinctIndices.Length;
		zero.x /= num2;
		zero.y /= num2;
		zero.z /= num2;
		return zero;
	}
}

AccessibilityOptions.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using FistVR;
using Microsoft.CodeAnalysis;
using On.FistVR;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyCompany("AccessibilityOptions")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AccessibilityOptions")]
[assembly: AssemblyTitle("AccessibilityOptions")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
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;
		}
	}
}
namespace AccessibilityOptions
{
	[BepInPlugin("okkim.accessibilityoptions", "Accessibility Options", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	public class AccessibilityOptionsBase : BaseUnityPlugin
	{
		public static ConfigEntry<bool> oneHandedWristMenuEnabled;

		public static ConfigEntry<float> verticalPointerOffset;

		public static ConfigEntry<Color> pointerColor;

		public static ConfigEntry<float> pointerScale;

		public static ConfigEntry<bool> lockPanelsAutomatically;

		public static ConfigEntry<string> autoLockPanelWhitelist;

		public static ConfigEntry<bool> weaponPoseLockingEnabled;

		public static ConfigEntry<float> weaponPoseLockingTriggerDuration;

		public static ConfigEntry<bool> gripAngleOverrideEnabled;

		public static ConfigEntry<float> overrideGripAngle;

		public static ConfigEntry<bool> overrideRecoil;

		public static ConfigEntry<bool> oneHandedHoverBench;

		public static ConfigEntry<bool> miscWeaponTweaksEnabled;

		public static ConfigEntry<bool> oneHandedSAREnabled;

		public static ConfigEntry<bool> oneHandedGrenadesEnabled;

		public static ConfigEntry<float> pinnedGrenadePinPullDuration;

		public static ConfigEntry<bool> oneHandedPumpReleaseEnabled;

		private const string ASSET_BUNDLE_NAME = "accessibilityoptions";

		public static AssetBundle pointerAssetBundle;

		private OneHandedWristMenu oneHandedWristMenu;

		private AutoLockingPanels autoLockingPanels;

		private WeaponPoseLock weaponPoseLock;

		private GripAngleOverride gripAngleOverride;

		private OneHandedMiscWeaponTweaks oneHandedMiscWeaponTweaks;

		public AccessibilityOptionsBase()
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			pointerAssetBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "accessibilityoptions"));
			oneHandedWristMenuEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Wrist Menu", "Enable One-Handed Wrist Menu", true, "Enabled/disables one-handed wrist menu (requires game restart)");
			verticalPointerOffset = ((BaseUnityPlugin)this).Config.Bind<float>("Wrist Menu", "Vertical Pointer Offset", -10f, "How far up or down (in degrees) the wrist menu pointer is from the center of your view");
			pointerColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Wrist Menu", "Pointer Color", Color.green, "Color of the wrist menu pointer (RGBA)");
			pointerScale = ((BaseUnityPlugin)this).Config.Bind<float>("Wrist Menu", "Pointer Scale", 0.01f, "How large (in meters) the pointer is");
			weaponPoseLockingEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Weapon Pose Locking", "Enable Weapon Pose Locking", true, "Lock weapons in mid-air by holding down the trigger on a safe or empty chamber");
			weaponPoseLockingTriggerDuration = ((BaseUnityPlugin)this).Config.Bind<float>("Weapon Pose Locking", "Pose Locking Trigger Hold Duration", 0.35f, "How long the trigger needs to be held down for the weapon to get locked");
			overrideRecoil = ((BaseUnityPlugin)this).Config.Bind<bool>("Quality Of Life", "Force Two-Handed Recoil", true, "Force weapons to always recoil like they're being two-handed");
			oneHandedHoverBench = ((BaseUnityPlugin)this).Config.Bind<bool>("Quality Of Life", "Enable One-Handed Hoverbench", true, "Allow locking items into the Hoverbench without requiring two hands");
			gripAngleOverrideEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Quality Of Life", "Enable Grip Angle Override", true, "Override the angle weapons are held at, to make one-handed aiming easier");
			overrideGripAngle = ((BaseUnityPlugin)this).Config.Bind<float>("Quality Of Life", "Override Grip Angle", -75f, "Determines the up/down angle of a weapon's hold pose");
			lockPanelsAutomatically = ((BaseUnityPlugin)this).Config.Bind<bool>("Quality Of Life", "Automatically Lock Option Panels", true, "Option panels lock automatically when spawned");
			autoLockPanelWhitelist = ((BaseUnityPlugin)this).Config.Bind<string>("Quality Of Life", "(Advanced) Auto-Locking Panel Whitelist", "OptionsPanel_Screenmanager AmmoSpawnerV2", "Add a panel class name here (case-sensitive, separated by a space) to lock it automatically upon spawning");
			miscWeaponTweaksEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Miscellaneous Weapon Tweaks", "Enable Miscellaneous One-Handed Weapon Tweaks", true, "Toggle all miscellaneous weapon tweaks on or off");
			oneHandedSAREnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Miscellaneous Weapon Tweaks", "Enable One-Handed Single-Action Revolvers", true, "Automatically advance single-action revolver cylinders upon inserting a round");
			oneHandedGrenadesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Miscellaneous Weapon Tweaks", "Enable One-Handed Grenades", true, "Pull pins by holding the touchpad or AX face buttons");
			pinnedGrenadePinPullDuration = ((BaseUnityPlugin)this).Config.Bind<float>("Miscellaneous Weapon Tweaks", "Pinned Grenade Pin Pull Duration", 0.5f, "How long (in seconds) the button needs to be held down to pull out a grenade pin (set to 0 for instant)");
			oneHandedPumpReleaseEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Miscellaneous Weapon Tweaks", "Enable One-Handed Pump Release", true, "Unlock pump-action weapon pumps by pulling the trigger while holding the pump");
		}

		private void Awake()
		{
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Expected O, but got Unknown
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Expected O, but got Unknown
			if (oneHandedWristMenuEnabled.Value)
			{
				oneHandedWristMenu = ((Component)this).gameObject.AddComponent<OneHandedWristMenu>();
			}
			if (lockPanelsAutomatically.Value)
			{
				autoLockingPanels = ((Component)this).gameObject.AddComponent<AutoLockingPanels>();
			}
			if (weaponPoseLockingEnabled.Value)
			{
				weaponPoseLock = ((Component)this).gameObject.AddComponent<WeaponPoseLock>();
			}
			if (gripAngleOverrideEnabled.Value)
			{
				gripAngleOverride = ((Component)this).gameObject.AddComponent<GripAngleOverride>();
			}
			if (overrideRecoil.Value)
			{
				FVRFireArm.Recoil += new hook_Recoil(FVRFireArm_Recoil);
			}
			if (oneHandedHoverBench.Value)
			{
				FVRPivotLocker.TryToLockObject += new hook_TryToLockObject(FVRPivotLocker_TryToLockObject);
			}
			if (miscWeaponTweaksEnabled.Value)
			{
				oneHandedMiscWeaponTweaks = ((Component)this).gameObject.AddComponent<OneHandedMiscWeaponTweaks>();
			}
		}

		private void FVRFireArm_Recoil(orig_Recoil orig, FVRFireArm self, bool twoHandStabilized, bool foregripStabilized, bool shoulderStabilized, FVRFireArmRecoilProfile overrideprofile, float VerticalRecoilMult)
		{
			orig.Invoke(self, true, true, shoulderStabilized, overrideprofile, VerticalRecoilMult);
		}

		private void FVRPivotLocker_TryToLockObject(orig_TryToLockObject orig, FVRPivotLocker self)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: 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)
			orig.Invoke(self);
			if ((Object)(object)self.m_obj != (Object)null)
			{
				return;
			}
			Collider[] array = Physics.OverlapBox(self.TestingBox.position, self.TestingBox.localScale / 1.9f, self.TestingBox.rotation);
			for (int i = 0; i < array.Length; i++)
			{
				FVRPhysicalObject component = ((Component)array[i]).GetComponent<FVRPhysicalObject>();
				if ((Object)(object)component != (Object)null)
				{
					if ((Object)(object)weaponPoseLock.currentlyLockedWeapon != (Object)null && (Object)(object)weaponPoseLock.currentlyLockedWeapon.thisFirearm == (Object)(object)component)
					{
						weaponPoseLock.currentlyLockedWeapon.UnlockWeapon();
					}
					self.LockObject(component);
					break;
				}
			}
		}
	}
	internal class AutoLockingPanels : MonoBehaviour
	{
		private string[] panelWhitelist = new string[0];

		public void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			FVRPhysicalObject.Awake += new hook_Awake(FVRPhysicalObject_Awake);
			panelWhitelist = AccessibilityOptionsBase.autoLockPanelWhitelist.Value.Split(new char[1] { ' ' });
			for (int i = 0; i < panelWhitelist.Length; i++)
			{
				panelWhitelist[i].Trim();
			}
		}

		private void FVRPhysicalObject_Awake(orig_Awake orig, FVRPhysicalObject self)
		{
			orig.Invoke(self);
			string[] array = panelWhitelist;
			foreach (string text in array)
			{
				Component[] components = ((Component)self).GetComponents(typeof(Component));
				for (int j = 0; j < components.Length; j++)
				{
					if (((object)components[j]).GetType().Name == text)
					{
						if ((Object)(object)((Component)self).GetComponent<Rigidbody>() != (Object)null)
						{
							self.SetIsKinematicLocked(true);
						}
						return;
					}
				}
			}
		}
	}
	internal class GripAngleOverride : MonoBehaviour
	{
		private float overrideGripAngle;

		private void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			overrideGripAngle = AccessibilityOptionsBase.overrideGripAngle.Value;
			FVRFireArm.Awake += new hook_Awake(FVRFireArm_Awake);
		}

		private void FVRFireArm_Awake(orig_Awake orig, FVRFireArm self)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)((FVRInteractiveObject)self).PoseOverride != (Object)null)
			{
				((Component)((FVRInteractiveObject)self).PoseOverride).transform.localRotation = Quaternion.Euler(new Vector3(overrideGripAngle, 0f, 0f));
			}
			if ((Object)(object)((FVRInteractiveObject)self).PoseOverride_Touch != (Object)null)
			{
				((Component)((FVRInteractiveObject)self).PoseOverride_Touch).transform.localRotation = Quaternion.Euler(new Vector3(overrideGripAngle, 0f, 0f));
			}
			orig.Invoke(self);
		}
	}
	internal class OneHandedCappedGrenade : MonoBehaviour
	{
		private FVRCappedGrenadeCap primaryCap;

		private FVRCappedGrenadeCap secondaryCap;

		private AudioSource? uncapAudioSource;

		private void Awake()
		{
			FVRCappedGrenadeCap[] componentsInChildren = ((Component)this).GetComponentsInChildren<FVRCappedGrenadeCap>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				if (i > 1)
				{
					Debug.LogError((object)"Too many caps found!");
					break;
				}
				if (componentsInChildren[i].IsPrimaryCap)
				{
					primaryCap = componentsInChildren[i];
				}
				else
				{
					secondaryCap = componentsInChildren[i];
				}
			}
		}

		public void FVRFixedUpdate_Hooked(FVRCappedGrenade _self)
		{
			if ((!((FVRInteractiveObject)_self).m_hand.IsInStreamlinedMode || !((FVRInteractiveObject)_self).m_hand.Input.BYButtonDown) && (((FVRInteractiveObject)_self).m_hand.IsInStreamlinedMode || !((FVRInteractiveObject)_self).m_hand.Input.TouchpadDown))
			{
				return;
			}
			if (!_self.IsPrimaryCapRemoved)
			{
				if ((Object)(object)primaryCap != (Object)null)
				{
					RemoteCapRemoved(_isPrimary: true, _self, primaryCap);
				}
			}
			else if (_self.UsesSecondaryCap && !_self.IsSecondaryCapRemoved && (Object)(object)secondaryCap != (Object)null)
			{
				RemoteCapRemoved(_isPrimary: false, _self, secondaryCap);
			}
		}

		private void RemoteCapRemoved(bool _isPrimary, FVRCappedGrenade _self, FVRCappedGrenadeCap _cap)
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			if (_isPrimary)
			{
				SM.PlayCoreSound((FVRPooledAudioType)10, _self.AudEvent_CapRemovePrimary, ((Component)this).transform.position);
				_self.IsPrimaryCapRemoved = true;
				uncapAudioSource = (AudioSource)((object)_self).GetType().GetField("AudOnUncapped").GetValue(_self);
				AudioSource? obj = uncapAudioSource;
				if (obj != null)
				{
					obj.Play();
				}
			}
			else
			{
				SM.PlayCoreSound((FVRPooledAudioType)10, _self.AudEvent_CapRemoveSecondary, ((Component)this).transform.position);
				_self.IsSecondaryCapRemoved = true;
			}
			if ((_self.UsesSecondaryCap && _self.IsPrimaryCapRemoved && _self.IsSecondaryCapRemoved) || (!_self.UsesSecondaryCap && _self.IsPrimaryCapRemoved))
			{
				_self.m_IsFuseActive = true;
			}
			Object.Instantiate<GameObject>(_isPrimary ? _self.Cap_Primary_Prefab : _self.Cap_Secondary_Prefab, ((Component)_cap).transform.position, ((Component)_cap).transform.rotation).GetComponent<FVRPhysicalObject>().RecoverRigidbody();
			Object.Destroy((Object)(object)((Component)_cap).gameObject);
			if (_self.HasPopOutShell)
			{
				for (int i = 0; i < _self.ShellPieces.Count; i++)
				{
					_self.ShellPieces[i].localPosition = _self.ShellPoses[i];
				}
			}
		}
	}
	internal class OneHandedMiscWeaponTweaks : MonoBehaviour
	{
		private float pinnedGrenadePinPullDuration;

		private void Awake()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			if (AccessibilityOptionsBase.oneHandedSAREnabled.Value)
			{
				FVRFireArmRound.Chamber += new hook_Chamber(FVRFireArmRound_Chamber);
			}
			if (AccessibilityOptionsBase.oneHandedGrenadesEnabled.Value)
			{
				pinnedGrenadePinPullDuration = AccessibilityOptionsBase.pinnedGrenadePinPullDuration.Value;
				PinnedGrenade.Awake += new hook_Awake(PinnedGrenade_Awake);
				PinnedGrenade.UpdateInteraction += new hook_UpdateInteraction(PinnedGrenade_UpdateInteraction);
				PinnedGrenade.IncreaseFuseSetting += new hook_IncreaseFuseSetting(PinnedGrenade_IncreaseFuseSetting);
				FVRCappedGrenade.Start += new hook_Start(FVRCappedGrenade_Start);
				FVRCappedGrenade.FVRFixedUpdate += new hook_FVRFixedUpdate(FVRCappedGrenade_FVRFixedUpdate);
			}
			if (AccessibilityOptionsBase.oneHandedPumpReleaseEnabled.Value)
			{
				TubeFedShotgunHandle.UpdateHandle += new hook_UpdateHandle(TubeFedShotgunHandle_UpdateHandle);
				ClosedBoltForeHandle.UpdateInteraction += new hook_UpdateInteraction(ClosedBoltForeHandle_UpdateInteraction);
			}
		}

		private void ClosedBoltForeHandle_UpdateInteraction(orig_UpdateInteraction orig, ClosedBoltForeHandle self, FVRViveHand hand)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Expected O, but got Unknown
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"1");
			Vector2 touchpadAxes = hand.Input.TouchpadAxes;
			if (!((FVRPhysicalObject)self.Weapon).IsAltHeld)
			{
				return;
			}
			Debug.Log((object)"2");
			bool flag = false;
			if (hand.IsInStreamlinedMode)
			{
				Debug.Log((object)"3");
				if (hand.Input.BYButtonDown)
				{
					Debug.Log((object)"4");
					flag = true;
				}
			}
			else if (hand.Input.TouchpadDown && Vector2.Angle(Vector2.up, touchpadAxes) < 45f && ((Vector2)(ref touchpadAxes)).magnitude > 0.2f)
			{
				Debug.Log((object)"5");
				flag = true;
			}
			Debug.Log((object)"6");
			bool flag2 = Object.op_Implicit((Object)(ClosedBoltForeHandle)((object)self).GetType().GetField("CanSwap").GetValue(self));
			Debug.Log((object)"7");
			if (flag && flag2)
			{
				Debug.Log((object)"8");
				self.AttemptToToggleMode();
			}
			Debug.Log((object)"9");
		}

		private void OnDestroy()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			FVRFireArmRound.Chamber -= new hook_Chamber(FVRFireArmRound_Chamber);
			PinnedGrenade.Awake -= new hook_Awake(PinnedGrenade_Awake);
			PinnedGrenade.UpdateInteraction -= new hook_UpdateInteraction(PinnedGrenade_UpdateInteraction);
			PinnedGrenade.IncreaseFuseSetting -= new hook_IncreaseFuseSetting(PinnedGrenade_IncreaseFuseSetting);
			FVRCappedGrenade.Start -= new hook_Start(FVRCappedGrenade_Start);
			FVRCappedGrenade.FVRFixedUpdate -= new hook_FVRFixedUpdate(FVRCappedGrenade_FVRFixedUpdate);
		}

		private void FVRFireArmRound_Chamber(orig_Chamber orig, FVRFireArmRound self, FVRFireArmChamber c, bool makeChamberingSound)
		{
			orig.Invoke(self, c, makeChamberingSound);
			FVRFireArm firearm = c.Firearm;
			SingleActionRevolver val = (SingleActionRevolver)(object)((firearm is SingleActionRevolver) ? firearm : null);
			if (val != null)
			{
				val.AdvanceCylinder();
				val.UpdateCylinderRot();
			}
		}

		private void PinnedGrenade_Awake(orig_Awake orig, PinnedGrenade self)
		{
			((Component)self).gameObject.AddComponent<OneHandedPinnedGrenade>();
			orig.Invoke(self);
		}

		private void PinnedGrenade_UpdateInteraction(orig_UpdateInteraction orig, PinnedGrenade self, FVRViveHand hand)
		{
			((Component)self).GetComponent<OneHandedPinnedGrenade>().UpdateInteraction_Hooked(self, hand);
			orig.Invoke(self, hand);
		}

		private void PinnedGrenade_IncreaseFuseSetting(orig_IncreaseFuseSetting orig, PinnedGrenade self)
		{
		}

		private void FVRCappedGrenade_Start(orig_Start orig, FVRCappedGrenade self)
		{
			orig.Invoke(self);
			((Component)self).gameObject.AddComponent<OneHandedCappedGrenade>();
		}

		private void FVRCappedGrenade_FVRFixedUpdate(orig_FVRFixedUpdate orig, FVRCappedGrenade self)
		{
			if (((FVRInteractiveObject)self).IsHeld && !self.m_IsFuseActive)
			{
				((Component)self).GetComponent<OneHandedCappedGrenade>().FVRFixedUpdate_Hooked(self);
			}
			orig.Invoke(self);
		}

		private void TubeFedShotgunHandle_UpdateHandle(orig_UpdateHandle orig, TubeFedShotgunHandle self)
		{
			if ((Object)(object)WeaponPoseLock.instance.currentlyLockedWeapon != (Object)null && ((FVRPhysicalObject)self.Shotgun).IsAltHeld && (Object)(object)WeaponPoseLock.instance.currentlyLockedWeapon.thisFirearm == (Object)(object)self.Shotgun)
			{
				FVRViveHand[] hands = GM.CurrentMovementManager.Hands;
				foreach (FVRViveHand val in hands)
				{
					if ((Object)(object)val.CurrentInteractable == (Object)(object)self.Shotgun && (Object)(object)val.OtherHand.CurrentInteractable != (Object)(object)self.Shotgun)
					{
						if (val.Input.TriggerFloat >= 0.6f)
						{
							self.UnlockHandle();
						}
						break;
					}
				}
			}
			orig.Invoke(self);
		}
	}
	internal class OneHandedPinnedGrenade : MonoBehaviour
	{
		private float pinPullDuration;

		private bool pinBeingPulled;

		private float pinPullDistance;

		private PinnedGrenadeRing? curRing;

		private bool hasPinPullReset = true;

		private void Awake()
		{
			pinPullDuration = AccessibilityOptionsBase.pinnedGrenadePinPullDuration.Value;
		}

		public void UpdateInteraction_Hooked(PinnedGrenade self, FVRViveHand hand)
		{
			if ((hand.IsInStreamlinedMode && hand.Input.BYButtonDown) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadDown))
			{
				for (int i = 0; i < self.m_rings.Count; i++)
				{
					if (!self.m_rings[i].HasPinDetached() && !((FVRInteractiveObject)self.m_rings[i]).IsHeld && hasPinPullReset)
					{
						curRing = self.m_rings[i];
						pinPullDistance = curRing.m_posMax - curRing.m_posMin;
						pinBeingPulled = true;
						break;
					}
				}
			}
			if (((hand.IsInStreamlinedMode && hand.Input.BYButtonUp) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadUp)) && (Object)(object)curRing != (Object)null)
			{
				hasPinPullReset = true;
				pinBeingPulled = false;
				curRing = null;
			}
			if (pinBeingPulled)
			{
				RemoteUpdatePinPos();
			}
			if (hand.Input.TriggerFloat >= 0.8f && ((FVRInteractiveObject)self).m_hasTriggeredUpSinceBegin)
			{
				((FVRInteractiveObject)self).m_hasTriggeredUpSinceBegin = false;
				if ((Object)(object)self.FuseCylinder != (Object)null && !self.m_isPinPulled)
				{
					OneHandedIncreaseFuseSetting(self);
				}
			}
		}

		private void OneHandedIncreaseFuseSetting(PinnedGrenade grenade)
		{
			if (grenade.m_fuseCylinderSetting < 4)
			{
				grenade.m_fuseCylinderSetting++;
			}
			else
			{
				grenade.m_fuseCylinderSetting = 0;
			}
			grenade.m_fuseTarYRotation = (float)grenade.m_fuseCylinderSetting * 24f - 48f;
		}

		private void RemoteUpdatePinPos()
		{
			//IL_00b2: 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)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)curRing != (Object)null) || curRing.HasPinDetached())
			{
				return;
			}
			if (curRing.UsesSwapPin && !curRing.m_hasSwapped)
			{
				curRing.m_hasSwapped = true;
				((Component)curRing.Pin).GetComponent<MeshFilter>().mesh = curRing.SwapPin;
			}
			if (pinPullDuration > 0f)
			{
				PinnedGrenadeRing? obj = curRing;
				obj.m_posCurrent += pinPullDistance * (Time.deltaTime / pinPullDuration);
				((Component)curRing).transform.localPosition = new Vector3(((Component)curRing).transform.localPosition.x, ((Component)curRing).transform.localPosition.y, curRing.m_posCurrent);
				((Component)curRing.Pin).transform.localPosition = new Vector3(((Component)curRing.Pin).transform.localPosition.x, ((Component)curRing.Pin).transform.localPosition.y, curRing.m_posCurrent);
				if (curRing.m_posCurrent > curRing.m_posMax)
				{
					RemoteDetachPin(curRing);
				}
			}
			else
			{
				RemoteDetachPin(curRing);
			}
		}

		private void RemoteDetachPin(PinnedGrenadeRing _ring)
		{
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			if (!_ring.m_hasPinDetached)
			{
				pinBeingPulled = false;
				hasPinPullReset = false;
				_ring.m_hasPinDetached = true;
				_ring.Pin.RootRigidbody = ((Component)_ring.Pin).gameObject.AddComponent<Rigidbody>();
				_ring.Pin.RootRigidbody.mass = 0.02f;
				((Component)_ring).transform.SetParent(((Component)_ring.Pin).transform);
				((Behaviour)_ring.Pin).enabled = true;
				SM.PlayCoreSound((FVRPooledAudioType)10, _ring.G.AudEvent_Pinpull, ((Component)_ring.G).transform.position);
				((Component)_ring).GetComponent<Collider>().enabled = false;
				((Behaviour)_ring).enabled = false;
			}
		}
	}
	internal class OneHandedWristMenu : MonoBehaviour
	{
		private GameObject pointerPrefab;

		private Material pointerMat;

		private float verticalPointerOffset;

		private Color pointerColor;

		private float pointerScale;

		private FVRViveHand curHand;

		private IEnumerator pointerCoroutine;

		private GameObject spawnedPointer;

		private FVRPointableButton curPointable;

		private void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			FVRWristMenu2.ActivateOnHand += new hook_ActivateOnHand(FVRWristMenu2_ActivateOnHand);
			FVRWristMenu2.Deactivate += new hook_Deactivate(FVRWristMenu2_Deactivate);
			verticalPointerOffset = AccessibilityOptionsBase.verticalPointerOffset.Value;
			pointerColor = AccessibilityOptionsBase.pointerColor.Value;
			pointerScale = AccessibilityOptionsBase.pointerScale.Value;
			pointerPrefab = AccessibilityOptionsBase.pointerAssetBundle.LoadAsset<GameObject>("WristMenuPointer");
			pointerMat = ((Renderer)pointerPrefab.GetComponent<MeshRenderer>()).material;
			pointerCoroutine = PointWithHead();
		}

		private void FVRWristMenu2_ActivateOnHand(orig_ActivateOnHand orig, FVRWristMenu2 self, FVRViveHand hand)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			Vector3 localPosition = ((Component)hand).transform.localPosition;
			if (!(((Vector3)(ref localPosition)).magnitude < 0.01f))
			{
				orig.Invoke(self, hand);
				curHand = hand;
				if ((Object)(object)spawnedPointer == (Object)null)
				{
					spawnedPointer = Object.Instantiate<GameObject>(pointerPrefab);
					spawnedPointer.transform.localScale = new Vector3(pointerScale, pointerScale, pointerScale);
					pointerMat.color = pointerColor;
				}
				((MonoBehaviour)this).StartCoroutine(pointerCoroutine);
			}
		}

		private void FVRWristMenu2_Deactivate(orig_Deactivate orig, FVRWristMenu2 self)
		{
			orig.Invoke(self);
			((MonoBehaviour)this).StopCoroutine(pointerCoroutine);
			if ((Object)(object)curPointable != (Object)null && (Object)(object)curHand != (Object)null)
			{
				((FVRPointable)curPointable).EndPoint(curHand);
			}
			if ((Object)(object)spawnedPointer != (Object)null)
			{
				Object.Destroy((Object)(object)spawnedPointer);
			}
		}

		private IEnumerator PointWithHead()
		{
			RaycastHit val2 = default(RaycastHit);
			while (true)
			{
				_ = GM.CurrentPlayerBody.headRotationFiltered;
				Vector3 val = Quaternion.AngleAxis(verticalPointerOffset * -1f, GM.CurrentPlayerBody.Head.right) * GM.CurrentPlayerBody.Head.forward;
				if (Physics.Raycast(GM.CurrentPlayerBody.headPositionFiltered, val, ref val2, 1f, LayerMask.op_Implicit(curHand.PointingLayerMask), (QueryTriggerInteraction)2))
				{
					if ((Object)(object)((Component)((RaycastHit)(ref val2)).collider).GetComponentInParent<FVRWristMenu2>() != (Object)null)
					{
						spawnedPointer.SetActive(true);
						spawnedPointer.transform.position = ((RaycastHit)(ref val2)).point;
						if ((Object)(object)((Component)((RaycastHit)(ref val2)).collider).GetComponent<FVRPointableButton>() != (Object)null)
						{
							FVRPointableButton component = ((Component)((RaycastHit)(ref val2)).collider).GetComponent<FVRPointableButton>();
							if ((Object)(object)curPointable != (Object)null && (Object)(object)component != (Object)(object)curPointable)
							{
								((FVRPointable)curPointable).EndPoint(curHand);
							}
							curPointable = component;
							((FVRPointable)curPointable).OnPoint(curHand);
						}
					}
				}
				else
				{
					if ((Object)(object)curPointable != (Object)null)
					{
						((FVRPointable)curPointable).EndPoint(curHand);
					}
					spawnedPointer.SetActive(false);
				}
				yield return null;
			}
		}
	}
	internal static class PluginInfo
	{
		internal const string NAME = "Accessibility Options";

		internal const string GUID = "okkim.accessibilityoptions";

		internal const string VERSION = "1.0.0";
	}
	public static class ReflectiveEnumerator
	{
		static ReflectiveEnumerator()
		{
		}

		public static IEnumerable<T> GetEnumerableOfType<T>(params object[] constructorArgs) where T : LockableWeapon, IComparable<T>
		{
			List<T> list = new List<T>();
			foreach (Type item in from myType in Assembly.GetAssembly(typeof(T)).GetTypes()
				where myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(T))
				select myType)
			{
				list.Add((T)Activator.CreateInstance(item, constructorArgs));
			}
			list.Sort();
			return list;
		}
	}
	public abstract class LockableWeapon<T> : LockableWeapon where T : MonoBehaviour
	{
		protected T Target { get; private set; }

		protected virtual void Awake()
		{
			Target = ((Component)this).GetComponent<T>();
			thisFirearm = ((Component)this).GetComponent<FVRFireArm>();
			chambers = thisFirearm.GetChambers();
			durationForPoseLock = WeaponPoseLock.instance.triggerDuration;
		}

		private void OnDestroy()
		{
			if ((Object)(object)WeaponPoseLock.instance.currentlyLockedWeapon == (Object)(object)this)
			{
				UnlockWeapon();
			}
		}
	}
	public abstract class LockableWeapon : MonoBehaviour
	{
		private enum WeaponLockState
		{
			Unlocked,
			Locking,
			Locked
		}

		public FVRFireArm thisFirearm;

		protected List<FVRFireArmChamber> chambers;

		public float durationForPoseLock;

		private float curTriggerDuration;

		private bool isValidForPoseLock;

		private WeaponLockState lockState;

		public abstract bool CanFire();

		public virtual bool IsBoltMoving()
		{
			return false;
		}

		public void CheckChamberTriggerAmt(bool _isFiring)
		{
			FVRViveHand hand = ((FVRInteractiveObject)thisFirearm).m_hand;
			if (hand != null && hand.Input.TriggerFloat >= 0.6f)
			{
				if (!_isFiring)
				{
					isValidForPoseLock = true;
					return;
				}
				bool flag = true;
				foreach (FVRFireArmChamber chamber in chambers)
				{
					if (chamber.IsFull && !chamber.IsSpent)
					{
						flag = false;
						break;
					}
				}
				if (flag)
				{
					isValidForPoseLock = true;
					return;
				}
			}
			isValidForPoseLock = false;
		}

		private void Update()
		{
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			switch (lockState)
			{
			case WeaponLockState.Unlocked:
				curTriggerDuration = 0f;
				if (isValidForPoseLock)
				{
					lockState = WeaponLockState.Locking;
				}
				break;
			case WeaponLockState.Locking:
				if (isValidForPoseLock)
				{
					FVRViveHand hand = ((FVRInteractiveObject)thisFirearm).m_hand;
					if ((hand == null || !(hand.Input.TriggerFloat < 0.6f)) && !IsBoltMoving())
					{
						curTriggerDuration += Time.deltaTime;
						if (curTriggerDuration > durationForPoseLock)
						{
							lockState = WeaponLockState.Locked;
						}
						break;
					}
				}
				lockState = WeaponLockState.Unlocked;
				break;
			case WeaponLockState.Locked:
				if ((Object)(object)WeaponPoseLock.instance.currentlyLockedWeapon != (Object)null && (Object)(object)WeaponPoseLock.instance.currentlyLockedWeapon != (Object)(object)this)
				{
					WeaponPoseLock.instance.currentlyLockedWeapon.UnlockWeapon();
				}
				if ((Object)(object)WeaponPoseLock.instance.currentlyLockedWeapon == (Object)null)
				{
					LockWeapon();
					break;
				}
				if (!((FVRPhysicalObject)thisFirearm).RootRigidbody.isKinematic)
				{
					((FVRPhysicalObject)thisFirearm).RootRigidbody.isKinematic = true;
				}
				if ((Object)(object)((Component)thisFirearm).transform.parent != (Object)null)
				{
					((Component)thisFirearm).transform.SetParent((Transform)null);
				}
				((Component)thisFirearm).gameObject.transform.position = WeaponPoseLock.instance.lockedWeaponProxy.transform.position;
				((Component)thisFirearm).gameObject.transform.rotation = WeaponPoseLock.instance.lockedWeaponProxy.transform.rotation;
				break;
			}
		}

		public virtual void LockWeapon()
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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)
			((FVRInteractiveObject)thisFirearm).m_hand.Buzz(((FVRInteractiveObject)thisFirearm).m_hand.Buzzer.Buzz_BeginInteraction);
			WeaponPoseLock.instance.currentlyLockedWeapon = this;
			((FVRPhysicalObject)thisFirearm).IsKinematicLocked = true;
			((FVRPhysicalObject)thisFirearm).RootRigidbody.isKinematic = true;
			WeaponPoseLock.instance.lockedWeaponSize = ((FVRPhysicalObject)thisFirearm).Size;
			((FVRPhysicalObject)thisFirearm).Size = (FVRPhysicalObjectSize)5;
			WeaponPoseLock.instance.lockedWeaponProxy.transform.position = ((Component)thisFirearm).transform.position;
			WeaponPoseLock.instance.lockedWeaponProxy.transform.rotation = ((Component)thisFirearm).transform.rotation;
		}

		public virtual void UnlockWeapon()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			isValidForPoseLock = false;
			WeaponPoseLock.instance.currentlyLockedWeapon = null;
			lockState = WeaponLockState.Unlocked;
			((FVRPhysicalObject)thisFirearm).IsKinematicLocked = false;
			((FVRPhysicalObject)thisFirearm).RootRigidbody.isKinematic = false;
			((FVRPhysicalObject)thisFirearm).Size = WeaponPoseLock.instance.lockedWeaponSize;
		}
	}
	public class LockableBAP : LockableWeapon<BAP>
	{
		private BAP BAP;

		protected override void Awake()
		{
			base.Awake();
			ref BAP bAP = ref BAP;
			FVRFireArm obj = thisFirearm;
			bAP = (BAP)(object)((obj is BAP) ? obj : null);
		}

		public override bool CanFire()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)BAP != (Object)null && (int)BAP.FireSelector_Modes[BAP.m_fireSelectorMode].ModeType == 0)
			{
				return false;
			}
			return true;
		}
	}
	public class LockableBoltActionRifle : LockableWeapon<BoltActionRifle>
	{
		private BoltActionRifle BAR;

		protected override void Awake()
		{
			base.Awake();
			ref BoltActionRifle bAR = ref BAR;
			FVRFireArm obj = thisFirearm;
			bAR = (BoltActionRifle)(object)((obj is BoltActionRifle) ? obj : null);
		}

		public override bool CanFire()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)BAR != (Object)null && (int)BAR.FireSelector_Modes[BAR.m_fireSelectorMode].ModeType == 0)
			{
				return false;
			}
			return true;
		}
	}
	public class LockableBreakActionWeapon : LockableWeapon<BreakActionWeapon>
	{
		private BreakActionWeapon BAW;

		protected override void Awake()
		{
			base.Awake();
			ref BreakActionWeapon bAW = ref BAW;
			FVRFireArm obj = thisFirearm;
			bAW = (BreakActionWeapon)(object)((obj is BreakActionWeapon) ? obj : null);
		}

		public override bool CanFire()
		{
			if ((Object)(object)BAW != (Object)null && (!BAW.IsLatched || !BAW.HasTriggerReset))
			{
				return false;
			}
			return true;
		}
	}
	public class LockableClosedBoltWeapon : LockableWeapon<ClosedBoltWeapon>
	{
		private ClosedBoltWeapon CBW;

		private FireSelectorModeType fireMode;

		protected override void Awake()
		{
			base.Awake();
			ref ClosedBoltWeapon cBW = ref CBW;
			FVRFireArm obj = thisFirearm;
			cBW = (ClosedBoltWeapon)(object)((obj is ClosedBoltWeapon) ? obj : null);
		}

		public override bool CanFire()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Invalid comparison between Unknown and I4
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Invalid comparison between Unknown and I4
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Invalid comparison between Unknown and I4
			if ((Object)(object)CBW != (Object)null)
			{
				fireMode = CBW.FireSelector_Modes[CBW.m_fireSelectorMode].ModeType;
				if ((int)fireMode == 0)
				{
					return false;
				}
				if ((int)fireMode == 1 && !CBW.m_hasTriggerReset)
				{
					return false;
				}
				if (((int)fireMode == 2 && CBW.m_CamBurst == 0) || (int)fireMode == 4)
				{
					return false;
				}
			}
			return true;
		}

		public override bool IsBoltMoving()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Invalid comparison between Unknown and I4
			if ((int)CBW.Bolt.CurPos == 0 || (int)CBW.Bolt.CurPos == 2)
			{
				return false;
			}
			return true;
		}
	}
	public class LockableDerringer : LockableWeapon<Derringer>
	{
		private Derringer derringer;

		protected override void Awake()
		{
			base.Awake();
			ref Derringer reference = ref derringer;
			FVRFireArm obj = thisFirearm;
			reference = (Derringer)(object)((obj is Derringer) ? obj : null);
		}

		public override bool CanFire()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Invalid comparison between Unknown and I4
			if ((Object)(object)derringer != (Object)null && ((derringer.HasExternalHammer && !derringer.IsExternalHammerCocked()) || !derringer.m_hasTriggerReset || (int)derringer.GetHingeState() == 2))
			{
				return false;
			}
			return true;
		}
	}
	public class LockableFlaregun : LockableWeapon<Flaregun>
	{
		private Flaregun FG;

		protected override void Awake()
		{
			base.Awake();
			ref Flaregun fG = ref FG;
			FVRFireArm obj = thisFirearm;
			fG = (Flaregun)(object)((obj is Flaregun) ? obj : null);
		}

		public override bool CanFire()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Invalid comparison between Unknown and I4
			if ((Object)(object)FG != (Object)null && (!FG.m_isHammerCocked || !FG.m_isTriggerReset || (int)FG.m_hingeState == 2))
			{
				return false;
			}
			return true;
		}
	}
	public class LockableHandgun : LockableWeapon<Handgun>
	{
		private Handgun HG;

		private FireSelectorModeType fireMode;

		protected override void Awake()
		{
			base.Awake();
			ref Handgun hG = ref HG;
			FVRFireArm obj = thisFirearm;
			hG = (Handgun)(object)((obj is Handgun) ? obj : null);
		}

		public override bool CanFire()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Invalid comparison between Unknown and I4
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Invalid comparison between Unknown and I4
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Invalid comparison between Unknown and I4
			if ((Object)(object)HG != (Object)null)
			{
				fireMode = HG.FireSelectorModes[HG.m_fireSelectorMode].ModeType;
				if ((int)fireMode == 3)
				{
					return false;
				}
				if ((int)fireMode == 1 && !HG.HasTriggerReset)
				{
					return false;
				}
				if ((int)fireMode == 4 && HG.m_CamBurst == 0)
				{
					return false;
				}
			}
			return true;
		}

		public override bool IsBoltMoving()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Invalid comparison between Unknown and I4
			if ((int)HG.Slide.CurPos == 0 || (int)HG.Slide.CurPos == 2)
			{
				return false;
			}
			return true;
		}
	}
	public class LockableLeverActionFirearm : LockableWeapon<LeverActionFirearm>
	{
		private LeverActionFirearm LAF;

		protected override void Awake()
		{
			base.Awake();
			ref LeverActionFirearm lAF = ref LAF;
			FVRFireArm obj = thisFirearm;
			lAF = (LeverActionFirearm)(object)((obj is LeverActionFirearm) ? obj : null);
		}

		public override bool CanFire()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Invalid comparison between Unknown and I4
			if ((Object)(object)LAF != (Object)null && (LAF.m_isSpinning || (int)LAF.m_curLeverPos != 2 || !LAF.m_isHammerCocked || (LAF.UsesSecondChamber && !LAF.m_isHammerCocked2)))
			{
				return false;
			}
			return true;
		}

		public override void LockWeapon()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			base.LockWeapon();
			LAF.m_curLeverPos = (ZPos)0;
			LAF.m_tarLeverRot = LAF.LeverAngleRange.x;
		}

		public override void UnlockWeapon()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			base.UnlockWeapon();
			LAF.m_curLeverPos = (ZPos)2;
			LAF.m_tarLeverRot = LAF.LeverAngleRange.y;
		}
	}
	public class LockableOpenBoltReceiver : LockableWeapon<OpenBoltReceiver>
	{
		private OpenBoltReceiver OBR;

		private FireSelectorModeType fireMode;

		protected override void Awake()
		{
			base.Awake();
			ref OpenBoltReceiver oBR = ref OBR;
			FVRFireArm obj = thisFirearm;
			oBR = (OpenBoltReceiver)(object)((obj is OpenBoltReceiver) ? obj : null);
		}

		public override bool CanFire()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Invalid comparison between Unknown and I4
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Invalid comparison between Unknown and I4
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Invalid comparison between Unknown and I4
			if ((Object)(object)OBR != (Object)null)
			{
				fireMode = OBR.FireSelector_Modes[OBR.m_fireSelectorMode].ModeType;
				if ((int)fireMode == 0)
				{
					return false;
				}
				if ((int)fireMode == 1 && OBR.m_hasTriggerCycled)
				{
					return false;
				}
				if (((int)fireMode == 4 && OBR.m_CamBurst == 0) || (int)fireMode == 3)
				{
					return false;
				}
			}
			return true;
		}

		public override bool IsBoltMoving()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Invalid comparison between Unknown and I4
			if ((int)OBR.Bolt.CurPos == 0 || (int)OBR.Bolt.CurPos == 2)
			{
				return false;
			}
			return true;
		}
	}
	public class LockableRevolver : LockableWeapon<Revolver>
	{
		private Revolver revolver;

		protected override void Awake()
		{
			base.Awake();
			ref Revolver reference = ref revolver;
			FVRFireArm obj = thisFirearm;
			reference = (Revolver)(object)((obj is Revolver) ? obj : null);
		}

		public override bool CanFire()
		{
			if ((Object)(object)revolver != (Object)null && (revolver.m_hasTriggerCycled || !revolver.isCylinderArmLocked))
			{
				return false;
			}
			return true;
		}
	}
	public class LockableRevolvingShotgun : LockableWeapon<RevolvingShotgun>
	{
		private RevolvingShotgun RS;

		private FireSelectorModeType fireMode;

		protected override void Awake()
		{
			base.Awake();
			ref RevolvingShotgun rS = ref RS;
			FVRFireArm obj = thisFirearm;
			rS = (RevolvingShotgun)(object)((obj is RevolvingShotgun) ? obj : null);
		}

		public override bool CanFire()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: 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_0044: Invalid comparison between Unknown and I4
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Invalid comparison between Unknown and I4
			if ((Object)(object)RS != (Object)null)
			{
				fireMode = RS.FireSelector_Modes[RS.m_fireSelectorMode].ModeType;
				if ((int)fireMode == 0)
				{
					return false;
				}
				if ((int)fireMode == 1 && RS.m_hasTriggerCycled)
				{
					return false;
				}
				if ((int)fireMode == 2 && RS.m_hasTriggerCycled && (!RS.Chambers[RS.CurChamber].IsFull || RS.Chambers[RS.CurChamber].IsSpent))
				{
					return false;
				}
			}
			return true;
		}
	}
	public class LockableRollingBlock : LockableWeapon<RollingBlock>
	{
		private RollingBlock RB;

		protected override void Awake()
		{
			base.Awake();
			ref RollingBlock rB = ref RB;
			FVRFireArm obj = thisFirearm;
			rB = (RollingBlock)(object)((obj is RollingBlock) ? obj : null);
		}

		public override bool CanFire()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Invalid comparison between Unknown and I4
			if ((Object)(object)RB != (Object)null && ((int)RB.m_state != 1 || !RB.Chamber.IsFull || RB.Chamber.IsSpent))
			{
				return false;
			}
			return true;
		}
	}
	public class LockableSingleActionRevolver : LockableWeapon<SingleActionRevolver>
	{
		private SingleActionRevolver SAR;

		protected override void Awake()
		{
			base.Awake();
			ref SingleActionRevolver sAR = ref SAR;
			FVRFireArm obj = thisFirearm;
			sAR = (SingleActionRevolver)(object)((obj is SingleActionRevolver) ? obj : null);
		}

		public override bool CanFire()
		{
			if ((Object)(object)SAR != (Object)null && (!SAR.m_isHammerCocked || SAR.m_isStateToggled))
			{
				return false;
			}
			return true;
		}
	}
	public class LockableTubeFedShotgun : LockableWeapon<TubeFedShotgun>
	{
		private TubeFedShotgun? TFS;

		protected override void Awake()
		{
			base.Awake();
			ref TubeFedShotgun? tFS = ref TFS;
			FVRFireArm obj = thisFirearm;
			tFS = (TubeFedShotgun?)(object)((obj is TubeFedShotgun) ? obj : null);
		}

		public override bool CanFire()
		{
			if ((Object)(object)TFS != (Object)null && TFS.HasSafety && TFS.IsSafetyEngaged)
			{
				return false;
			}
			return true;
		}

		public override bool IsBoltMoving()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Invalid comparison between Unknown and I4
			if ((int)TFS.Mode == 0)
			{
				return false;
			}
			if ((int)TFS.Bolt.CurPos == 0 || (int)TFS.Bolt.CurPos == 2)
			{
				return false;
			}
			return true;
		}
	}
	internal class WeaponPoseLock : MonoBehaviour
	{
		public static WeaponPoseLock instance;

		public Dictionary<Type, Type> LockableWeaponDict = new Dictionary<Type, Type>();

		public float triggerDuration;

		public LockableWeapon currentlyLockedWeapon;

		public FVRPhysicalObjectSize lockedWeaponSize;

		public GameObject lockedWeaponProxy;

		private void Awake()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Expected O, but got Unknown
			instance = this;
			triggerDuration = AccessibilityOptionsBase.weaponPoseLockingTriggerDuration.Value;
			GM.InitScene += new hook_InitScene(GM_InitScene);
			FVRFireArm.Awake += new hook_Awake(FVRFireArm_Awake);
			FVRFireArm.FVRUpdate += new hook_FVRUpdate(FVRFireArm_FVRUpdate);
			FVRFireArm.BeginInteraction += new hook_BeginInteraction(FVRFireArm_BeginInteraction);
			FVRQuickBeltSlot.MoveContentsInstant += new hook_MoveContentsInstant(FVRQuickBeltSlot_MoveContentsInstant);
			FVRQuickBeltSlot.MoveContents += new hook_MoveContents(FVRQuickBeltSlot_MoveContents);
			FVRQuickBeltSlot.MoveContentsCheap += new hook_MoveContentsCheap(FVRQuickBeltSlot_MoveContentsCheap);
			LockableWeaponDict[typeof(BoltActionRifle)] = typeof(LockableBoltActionRifle);
			LockableWeaponDict[typeof(TubeFedShotgun)] = typeof(LockableTubeFedShotgun);
			LockableWeaponDict[typeof(ClosedBoltWeapon)] = typeof(LockableClosedBoltWeapon);
			LockableWeaponDict[typeof(OpenBoltReceiver)] = typeof(LockableOpenBoltReceiver);
			LockableWeaponDict[typeof(Handgun)] = typeof(LockableHandgun);
			LockableWeaponDict[typeof(BAP)] = typeof(LockableBAP);
			LockableWeaponDict[typeof(Revolver)] = typeof(LockableRevolver);
			LockableWeaponDict[typeof(SingleActionRevolver)] = typeof(LockableSingleActionRevolver);
			LockableWeaponDict[typeof(Flaregun)] = typeof(LockableFlaregun);
			LockableWeaponDict[typeof(BreakActionWeapon)] = typeof(LockableBreakActionWeapon);
			LockableWeaponDict[typeof(Derringer)] = typeof(LockableDerringer);
			LockableWeaponDict[typeof(RevolvingShotgun)] = typeof(LockableRevolvingShotgun);
			LockableWeaponDict[typeof(RollingBlock)] = typeof(LockableRollingBlock);
			LockableWeaponDict[typeof(LeverActionFirearm)] = typeof(LockableLeverActionFirearm);
		}

		private void GM_InitScene(orig_InitScene orig, GM self)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			orig.Invoke(self);
			lockedWeaponProxy = Object.Instantiate<GameObject>(new GameObject(), ((Component)GM.CurrentPlayerBody).gameObject.transform);
			((Object)lockedWeaponProxy).name = "lockedWeaponProxy";
			GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(OnShotFired);
			GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(OnShotFired);
		}

		private void FVRFireArm_Awake(orig_Awake orig, FVRFireArm self)
		{
			orig.Invoke(self);
			LockableWeaponDict.TryGetValue(((object)self).GetType(), out Type value);
			if ((object)value != null)
			{
				_ = (LockableWeapon)(object)((Component)self).gameObject.AddComponent(value);
			}
		}

		private void FVRFireArm_BeginInteraction(orig_BeginInteraction orig, FVRFireArm self, FVRViveHand hand)
		{
			orig.Invoke(self, hand);
			if ((Object)(object)currentlyLockedWeapon != (Object)null)
			{
				LockableWeapon component = ((Component)self).gameObject.GetComponent<LockableWeapon>();
				if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)currentlyLockedWeapon && (!((FVRPhysicalObject)component.thisFirearm).IsAltHeld || !((Object)(object)((FVRInteractiveObject)component.thisFirearm).m_hand.OtherHand.m_currentInteractable != (Object)(object)component.thisFirearm)))
				{
					component.UnlockWeapon();
				}
			}
		}

		private void FVRFireArm_FVRUpdate(orig_FVRUpdate orig, FVRFireArm self)
		{
			orig.Invoke(self);
			if ((Object)(object)((FVRInteractiveObject)self).m_hand != (Object)null && !((FVRPhysicalObject)self).IsAltHeld)
			{
				LockableWeapon component = ((Component)self).GetComponent<LockableWeapon>();
				if ((Object)(object)component != (Object)null)
				{
					component.CheckChamberTriggerAmt(component.CanFire());
				}
			}
		}

		private void OnShotFired(FVRFireArm _firearm)
		{
			if ((Object)(object)currentlyLockedWeapon != (Object)null && (Object)(object)_firearm == (Object)(object)currentlyLockedWeapon.thisFirearm)
			{
				currentlyLockedWeapon.UnlockWeapon();
			}
		}

		private void FVRQuickBeltSlot_MoveContentsInstant(orig_MoveContentsInstant orig, FVRQuickBeltSlot self, Vector3 dir)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			if (!IsQBWeaponLocked(self))
			{
				orig.Invoke(self, dir);
			}
			else
			{
				Debug.Log((object)"Blocked MovecontentsInstant");
			}
		}

		private void FVRQuickBeltSlot_MoveContents(orig_MoveContents orig, FVRQuickBeltSlot self, Vector3 dir)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			if (!IsQBWeaponLocked(self))
			{
				orig.Invoke(self, dir);
			}
			else
			{
				Debug.Log((object)"Blocked Movecontents");
			}
		}

		private void FVRQuickBeltSlot_MoveContentsCheap(orig_MoveContentsCheap orig, FVRQuickBeltSlot self, Vector3 dir)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			if (!IsQBWeaponLocked(self))
			{
				orig.Invoke(self, dir);
			}
			else
			{
				Debug.Log((object)"Blocked MovecontentsCheap");
			}
		}

		private bool IsQBWeaponLocked(FVRQuickBeltSlot slot)
		{
			if ((Object)(object)slot.CurObject != (Object)null && (Object)(object)((Component)slot.CurObject).GetComponent<LockableWeapon>() != (Object)null && (Object)(object)currentlyLockedWeapon == (Object)(object)((Component)slot).GetComponent<LockableWeapon>())
			{
				Debug.Log((object)"Blocked locked weapon from holstering");
				return true;
			}
			return false;
		}
	}
}