Decompiled source of Intro Company Speech Extended Remix v1.0.1

IntroSpeechRemix/IntroSpeechRemix.dll

Decompiled 4 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using IntroSpeechRemix.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("IntroSpeechRemix")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IntroSpeechRemix")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3344c1de-484f-4116-87fe-61301ca3236f")]
[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 IntroSpeechRemix
{
	[BepInPlugin("Poseidon.IntroSpeechRemix", "Intro Speech Extended Remix Mod", "1.0.0")]
	public class IntroRemixModBase : BaseUnityPlugin
	{
		private const string modGUID = "Poseidon.IntroSpeechRemix";

		private const string modName = "Intro Speech Extended Remix Mod";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Poseidon.IntroSpeechRemix");

		private static IntroRemixModBase Instance;

		internal ManualLogSource mls;

		internal static List<AudioClip> NewMusic;

		internal static AssetBundle Bundle;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Poseidon.IntroSpeechRemix");
			mls.LogInfo((object)"Loaded Mod Successfully.");
			harmony.PatchAll(typeof(StartOfRoundPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			NewMusic = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("IntroSpeechRemix.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "introspeechremix");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"Loaded Asset Bundle Successfully.");
				NewMusic = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Failed to Asset Bundle :(");
			}
		}
	}
}
namespace IntroSpeechRemix.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(StartOfRound __instance)
		{
			__instance.shipIntroSpeechSFX = IntroRemixModBase.NewMusic[0];
		}
	}
}