Decompiled source of JoeBidenShipIntro v1.0.0

BidenIntroMod.dll

Decompiled 6 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 BidenIntroMod.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("BidenIntroMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BidenIntroMod")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9699654a-8162-4292-9ffd-bcb30b407909")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace BidenIntroMod
{
	[BepInPlugin("Tomato.BidenIntroMod", "Biden Intro Mod", "1.0.0")]
	public class BidenIntroMod : BaseUnityPlugin
	{
		private const string modGUID = "Tomato.BidenIntroMod";

		private const string modName = "Biden Intro Mod";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Tomato.BidenIntroMod");

		private static BidenIntroMod 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("Tomato.BidenIntroMod");
			mls.LogInfo((object)"Biden Intro mod loaded");
			SoundFx = new List<AudioClip>();
			harmony.PatchAll(typeof(BidenIntroMod));
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("BidenIntroMod.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "biden");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"Biden intro Asset Bundle loaded!");
				SoundFx = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogInfo((object)"Biden intro Asset Bundle failed to load!");
			}
			harmony.PatchAll(typeof(ShipIntroPatches));
		}
	}
}
namespace BidenIntroMod.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class ShipIntroPatches
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void StartPrefix(StartOfRound __instance)
		{
			__instance.shipIntroSpeechSFX = BidenIntroMod.SoundFx[0];
		}
	}
}