Decompiled source of TacoTuesdayShipIntro v1.0.0

TacoShipIntro.dll

Decompiled 6 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 ShipIntro;
using TacoShipIntro.Patches;
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("TacoShipIntro")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TacoShipIntro")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4d9a12b3-6966-44cb-9008-1382cab78494")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ShipIntro
{
	[BepInPlugin("Ex.TacoShipIntroMod", "Ex Taco Ship Intro Replacer Mod", "1.0.0")]
	public class TacoShipIntroBase : BaseUnityPlugin
	{
		private const string modGUID = "Ex.TacoShipIntroMod";

		private const string modName = "Ex Taco Ship Intro Replacer Mod";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Ex.TacoShipIntroMod");

		private static TacoShipIntroBase Instance;

		internal ManualLogSource mls;

		internal static AudioClip newShipIntroSFX;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Ex.TacoShipIntroMod");
			mls.LogInfo((object)"Taco Ship Intro SFX mod has initiated");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "TacoShipIntro.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "TacoTuesdaySFX";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newShipIntroSFX = val.LoadAsset<AudioClip>("Assets/TacoTuesday.mp3");
			harmony.PatchAll(typeof(TacoShipIntroBase));
			harmony.PatchAll(typeof(TacoShipIntroPatch));
			mls.LogInfo((object)"Taco Ship Intro mod has loaded.");
		}
	}
}
namespace TacoShipIntro.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class TacoShipIntroPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void ShipIntroSFXPatch(ref AudioClip ___shipIntroSpeechSFX)
		{
			___shipIntroSpeechSFX = TacoShipIntroBase.newShipIntroSFX;
		}
	}
}