Decompiled source of AdamsMod v1.0.0

BepInEx/plugins/AdamsMod.dll

Decompiled a year ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using AdamsMod.Patches;
using BepInEx;
using HarmonyLib;
using LC_API.BundleAPI;
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("AdamsMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AdamsMod")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c0ea4e61-5eda-4a86-abda-63aca30bcca3")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace AdamsMod
{
	[BepInPlugin("SpicyTakis.AdamsMod", "AdamsMod", "1.0.0")]
	public class AdamsMod : BaseUnityPlugin
	{
		private const string GUID = "SpicyTakis.AdamsMod";

		private const string Name = "AdamsMod";

		private const string Version = "1.0.0";

		private Harmony harmony;

		private void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			harmony = new Harmony("SpicyTakis.AdamsMod");
			harmony.PatchAll(typeof(AdamsModPatches));
			Debug.Log((object)"[AdamsMod] AdamsMod has been succesfully loaded");
		}
	}
}
namespace AdamsMod.Patches
{
	internal class AdamsModPatches
	{
		[HarmonyPatch(typeof(BoomboxItem), "Start")]
		[HarmonyPostfix]
		private static void BoomboxMusicPatch(BoomboxItem __instance)
		{
			CollectionExtensions.AddItem<AudioClip>((IEnumerable<AudioClip>)__instance.musicAudios, BundleLoader.GetLoadedAsset<AudioClip>("assets/adamsmod/christmas1.mp3"));
			CollectionExtensions.AddItem<AudioClip>((IEnumerable<AudioClip>)__instance.musicAudios, BundleLoader.GetLoadedAsset<AudioClip>("assets/adamsmod/fellas.mp3"));
			CollectionExtensions.AddItem<AudioClip>((IEnumerable<AudioClip>)__instance.musicAudios, BundleLoader.GetLoadedAsset<AudioClip>("assets/adamsmod/msword.mp3"));
			AudioClip[] array = (AudioClip[])(object)new AudioClip[8];
			__instance.musicAudios.CopyTo(array, 0);
			array[5] = BundleLoader.GetLoadedAsset<AudioClip>("assets/adamsmod/christmas1.mp3");
			array[6] = BundleLoader.GetLoadedAsset<AudioClip>("assets/adamsmod/fellas.mp3");
			array[7] = BundleLoader.GetLoadedAsset<AudioClip>("assets/adamsmod/msword.mp3");
			__instance.musicAudios = array;
			Debug.Log((object)"[AdamsMod] Added custom audio");
			Debug.Log((object)BundleLoader.GetLoadedAsset<AudioClip>("assets/adamsmod/msword.mp3"));
			Debug.Log((object)__instance.musicAudios.Length);
		}
	}
}