Decompiled source of SprayPaintLimit v22.0.1

plugins/SprayPaintLimit.dll

Decompiled 3 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using SprayPaintLimit.Patches;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SprayPaintLimit")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SprayPaintLimit")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9e64457d-d39a-445c-a5ee-31fe9cf51771")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SprayPaintLimit
{
	[BepInPlugin("slapitnow.spraypaintlimit", "SprayPaintLimit", "22.0.1")]
	public class SprayPaintLimit : BaseUnityPlugin
	{
		private const string modGUID = "slapitnow.spraypaintlimit";

		private const string modName = "SprayPaintLimit";

		private const string modVersion = "22.0.1";

		private readonly Harmony harmony = new Harmony("slapitnow.spraypaintlimit");

		internal ManualLogSource mls;

		private void Awake()
		{
			mls = Logger.CreateLogSource("slapitnow.spraypaintlimit");
			mls.LogInfo((object)"Version 22.0.1 loaded!");
			harmony.PatchAll(typeof(SprayPaintLimit));
			harmony.PatchAll(typeof(SprayPaintItemPatch));
		}
	}
}
namespace SprayPaintLimit.Patches
{
	[HarmonyPatch(typeof(SprayPaintItem))]
	internal class SprayPaintItemPatch
	{
		[HarmonyPatch("LateUpdate")]
		[HarmonyPrefix]
		public static void SprayLateUpdate(SprayPaintItem __instance, ref float ___sprayCanTank, ref float ___sprayCanShakeMeter)
		{
			if (!__instance.isWeedKillerSprayBottle)
			{
				__instance.maxSprayPaintDecals = 22000000;
				__instance.sprayIntervalSpeed = 0.01f;
				___sprayCanShakeMeter = 1f;
				___sprayCanTank = 1f;
			}
		}
	}
}