Decompiled source of UnlimitedPaint v1.0.0

UnlimitedPaint.dll

Decompiled a year ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("UnlimitedPaint")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UnlimitedPaint")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("825109f0-f89a-4b7f-9eb7-db193fe68fa8")]
[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 UnlimitedPaint;

[BepInPlugin("Maran.UnlimitedPaintMod", "Unlimited Paint", "1.0.0.0")]
public class UnlimitedPaintMain : BaseUnityPlugin
{
	private const string guid = "Maran.UnlimitedPaintMod";

	private const string name = "Unlimited Paint";

	private const string version = "1.0.0.0";

	private readonly Harmony harmony = new Harmony("Maran.UnlimitedPaintMod");

	private static UnlimitedPaintMain instance;

	public static ManualLogSource logger;

	public static ConfigFile config;

	private void Awake()
	{
		instance = this;
		logger = Logger.CreateLogSource("Maran.UnlimitedPaintMod");
		config = ((BaseUnityPlugin)this).Config;
		PluginConfig.Load();
		logger.LogInfo((object)"Paint cans are ready!");
		harmony.PatchAll();
	}
}
internal class PluginConfig
{
	public static ConfigEntry<bool> requireShaking;

	public static void Load()
	{
		requireShaking = UnlimitedPaintMain.config.Bind<bool>("Main", "Require Shaking", false, "Is shaking the Paint Can still required to refill it?");
	}
}
[HarmonyPatch(typeof(SprayPaintItem))]
internal class SprayPaintUpdatePatch
{
	[HarmonyPatch("LateUpdate")]
	[HarmonyPostfix]
	private static void sprayPaintUpdatePatch(ref float ___sprayCanTank, ref float ___sprayCanShakeMeter)
	{
		___sprayCanTank = 1f;
		if (!PluginConfig.requireShaking.Value)
		{
			___sprayCanShakeMeter = 1f;
		}
	}
}