Decompiled source of FX05 Xiuhcoatl v1.0.0

FX05_Xiuhcoatl.dll

Decompiled 3 weeks 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.FX05_Xiuhcoatl;

[BepInPlugin("Volks.FX05_Xiuhcoatl", "FX05_Xiuhcoatl", "1.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class FX05_XiuhcoatlPlugin : 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.FX05_Xiuhcoatl");
		OtherLoader.RegisterDirectLoad(BasePath, "Volks.FX05_Xiuhcoatl", "", "", "xiuhcoatl_rifle", "");
	}
}