Decompiled source of InfiniteAmmo v1.1.0

InfiniteAmmo.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using HBMF.ModMenu;
using HarmonyLib;
using Il2CppFirearmSystem;
using InfiniteAmmo;
using MelonLoader;
using MelonLoader.Preferences;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Mod), "InfiniteAmmo", "1.1.0", "korbykob", null)]
[assembly: MelonGame("GexagonVR", "Hard Bullet")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("InfiniteAmmo")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("InfiniteAmmo")]
[assembly: AssemblyTitle("InfiniteAmmo")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace InfiniteAmmo;

[HarmonyPatch]
public class Mod : MelonMod
{
	private static MelonPreferences_Entry<bool> enabled;

	public override void OnInitializeMelon()
	{
		enabled = MelonPreferences.CreateCategory("InfiniteAmmo").CreateEntry<bool>("Enabled", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		Menu.CreateCategory("INFINITE AMMO").CreateBool("ENABLE", enabled.Value, (Action<bool>)delegate(bool value)
		{
			enabled.Value = value;
		});
	}

	[HarmonyPatch(typeof(ProjectileContainer), "TryEjectProjectile")]
	[HarmonyPrefix]
	public static void GrabPatch(ProjectileContainer __instance)
	{
		__instance._infinityAmmo = enabled.Value;
	}
}