Decompiled source of DisableDeliveryDelay v2.0.0

DisableDeliveryAnimation.dll

Decompiled a month 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 DisableDeliveryAnimation.Patches;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("DisableDeliveryAnimation")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DisableDeliveryAnimation")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("bb71a010-5e0e-44db-be81-ecebf5b15bc6")]
[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 DisableDeliveryAnimation
{
	[BepInPlugin("QuietMods.DisableDeliveryAnimation", "DisableDeliveryAnimation", "1.0.0.0")]
	public class DisableAnimation : BaseUnityPlugin
	{
		private const string modGUID = "QuietMods.DisableDeliveryAnimation";

		private const string modName = "DisableDeliveryAnimation";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("QuietMods.DisableDeliveryAnimation");

		private static DisableAnimation Instance;

		internal ManualLogSource als;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			als = Logger.CreateLogSource("QuietMods.DisableDeliveryAnimation");
			harmony.PatchAll(typeof(DisableAnimation));
			harmony.PatchAll(typeof(ItemDropshipAnimSkip));
			als.LogInfo((object)"Mod Enabled");
		}
	}
}
namespace DisableDeliveryAnimation.Patches
{
	[HarmonyPatch(typeof(ItemDropship))]
	internal class ItemDropshipAnimSkip
	{
		[HarmonyPatch("Update")]
		[HarmonyPrefix]
		private static void SkipDropship(ref float ___shipTimer, ref Terminal ___terminalScript, ref bool ___deliveringOrder, ref Animator ___shipAnimator)
		{
			if (___terminalScript.orderedItemsFromTerminal.Count > 0 && ___shipTimer < 40f && !___deliveringOrder)
			{
				___shipTimer = 41f;
				___shipAnimator.speed = 10f;
			}
		}

		[HarmonyPatch("OpenShipDoorsOnServer")]
		[HarmonyPostfix]
		private static void SendBackDropship(ref float ___shipTimer)
		{
			___shipTimer = 41f;
		}
	}
}