Decompiled source of DonaldTrumpShipIntro v1.0.0

TrumpIntroMod.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 HarmonyLib;
using TrumpIntroMod.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("TrumpIntroMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TrumpIntroMod")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("aa20b6a7-1135-4a42-a5c9-fdced26f9ade")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace TrumpIntroMod
{
	[BepInPlugin("Tomato.TrumpIntroMod", "Trump Intro Mod", "1.0.0")]
	public class TrumpIntroMod : BaseUnityPlugin
	{
		private const string modGUID = "Tomato.TrumpIntroMod";

		private const string modName = "Trump Intro Mod";

		private const string modVersion = "1.0.0";

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

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