Decompiled source of FluxRaiderP320KitRevamped v2.0.0

FluxRaiderP320KitRevamped.dll

Decompiled 2 days ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OpenScripts2;
using OtherLoader;
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]
public class ForeMagRelease : UniversalAdvancedMagazineGrabTrigger
{
	[Header("ForeMagRelease Config")]
	public bool EjectMainMagOnSecondaryRelease = true;

	private bool wasSecondaryMagPresent = true;

	public override void UpdateInteraction(FVRViveHand hand)
	{
		((UniversalAdvancedMagazineGrabTrigger)this).UpdateInteraction(hand);
		if (base.IsSecondarySlotGrab)
		{
			FVRFireArmMagazine magazine = base.FireArm.SecondaryMagazineSlots[base.SecondaryGrabSlot].Magazine;
			if (wasSecondaryMagPresent && (Object)(object)magazine == (Object)null && EjectMainMagOnSecondaryRelease && (Object)(object)base.FireArm.Magazine != (Object)null)
			{
				base.FireArm.EjectMag(false);
			}
			wasSecondaryMagPresent = (Object)(object)magazine != (Object)null;
		}
		else
		{
			wasSecondaryMagPresent = true;
		}
	}
}
namespace Volks.FluxRaiderP320KitRevamped;

[BepInPlugin("Volks.FluxRaiderP320KitRevamped", "FluxRaiderP320KitRevamped", "2.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class FluxRaiderP320KitRevampedPlugin : BaseUnityPlugin
{
	private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

	internal static ManualLogSource Logger;

	private void Awake()
	{
		Logger = ((BaseUnityPlugin)this).Logger;
		LoadAssets();
	}

	private void LoadAssets()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Volks.FluxRaiderP320KitRevamped");
		OtherLoader.RegisterDirectLoad(BasePath, "Volks.FluxRaiderP320KitRevamped", "", "", "fluxraiderp320kit_volks", "");
	}
}