Decompiled source of GreatGreatJams v1.1.0

GreatGreatJams.dll

Decompiled a year ago
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 GreatGreatJams.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("GreatGreatJams")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GreatGreatJams")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a7fe7523-9e46-442a-abfb-6c413198da0e")]
[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 GreatGreatJams
{
	[BepInPlugin("8bit.GreatGreatJams", "Great Great Jams", "1.0.0")]
	public class JamBase : BaseUnityPlugin
	{
		private const string modGUID = "8bit.GreatGreatJams";

		private const string modName = "Great Great Jams";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("8bit.GreatGreatJams");

		private static JamBase Instance;

		internal ManualLogSource mls;

		internal static AudioClip[] newSongs;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("8bit.GreatGreatJams");
			mls.LogInfo((object)"******************************************************************************");
			mls.LogInfo((object)"*************************8Bit's GreatGreatJams********************************");
			mls.LogInfo((object)"******************************************************************************");
			mls.LogInfo((object)"*************************loading audio****************************************");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "GreatGreatJams.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "greatgreatjams";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newSongs = val.LoadAllAssets<AudioClip>();
			for (int i = 0; i < newSongs.Length; i++)
			{
				mls.LogInfo((object)("[i]:" + (object)newSongs[i]));
			}
			harmony.PatchAll(typeof(boomPatch));
		}
	}
}
namespace GreatGreatJams.Patches
{
	[HarmonyPatch(typeof(BoomboxItem))]
	internal class boomPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void HeadcrabPatch(ref AudioClip[] ___musicAudios)
		{
			AudioClip[] newSongs = JamBase.newSongs;
			___musicAudios = ___musicAudios.Concat(newSongs).ToArray();
		}
	}
}