Decompiled source of Dreamscapes Ship Intro v1.0.0

Dreamscapes Ship Intro.dll

Decompiled 10 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 Dreamscapes_Ship_Intro.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("Dreamscapes Ship Intro")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Dreamscapes Ship Intro")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("def10996-39a3-4a29-8471-a02b7b79f031")]
[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 Dreamscapes_Ship_Intro
{
	[BepInPlugin("silverninjastar.ShipIntroBase", "Dreamscapes Ship Intro Mod", "1.0.0.0")]
	public class ShipIntroBase : BaseUnityPlugin
	{
		private const string modGUID = "silverninjastar.ShipIntroBase";

		private const string modName = "Dreamscapes Ship Intro Mod";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("silverninjastar.ShipIntroBase");

		private static ShipIntroBase Instance;

		internal ManualLogSource mls;

		internal static List<AudioClip> SoundFX;

		internal static AssetBundle Bundle;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("silverninjastar.ShipIntroBase");
			mls.LogInfo((object)"Dreamscapes Ship Intro Mod is active!");
			harmony.PatchAll(typeof(ShipIntroBase));
			harmony.PatchAll(typeof(StartOfRoundSFX));
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("Dreamscapes Ship Intro.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "dreamscapes");
			if ((Object)(object)Bundle != (Object)null)
			{
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
				mls.LogInfo((object)"~~~ Loaded trance ~~~");
			}
			else
			{
				mls.LogError((object)"Failed to load asset bundle");
			}
		}
	}
}
namespace Dreamscapes_Ship_Intro.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundSFX
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(StartOfRound __instance)
		{
			__instance.shipIntroSpeechSFX = ShipIntroBase.SoundFX[0];
		}
	}
}