Decompiled source of bugle musics v1.0.0

BepInEx/plugins/bugle-musics/bugleMusics.dll

Decompiled 2 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("caca")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("caca")]
[assembly: AssemblyTitle("caca")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace caca;

[HarmonyPatch(typeof(BugleSFX))]
public class PatchClass
{
	[HarmonyPatch("Start")]
	[HarmonyPostfix]
	public static void boomBoxPatch(ref AudioClip[] ___bugle)
	{
		AudioClip[] newSFX = Plugin.newSFX;
		___bugle = newSFX;
	}
}
[BepInPlugin("com.sau6son.bugleMusics", "bugle-musics", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private Harmony _harmony;

	private static Plugin Instance;

	internal static AudioClip[] newSFX;

	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected O, but got Unknown
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Expected O, but got Unknown
		if ((Object)Instance == (Object)null)
		{
			Instance = this;
		}
		_harmony = new Harmony("com.sau6son.cacaPlugin");
		_harmony.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"sau6son.bugleMusics is loading.");
		string location = ((BaseUnityPlugin)Instance).Info.Location;
		string text = "bugleMusics.dll";
		string text2 = location.TrimEnd(text.ToCharArray());
		string text3 = text2 + "bugle-bundle";
		AssetBundle val = AssetBundle.LoadFromFile(text3);
		if ((Object)val == (Object)null)
		{
			((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load audio assets!");
			return;
		}
		AudioClip val2 = val.LoadAsset<AudioClip>("assets/fdp.mp3");
		AudioClip val3 = val.LoadAsset<AudioClip>("assets/magicSystem.mp3");
		AudioClip val4 = val.LoadAsset<AudioClip>("assets/crazy.mp3");
		AudioClip val5 = val.LoadAsset<AudioClip>("assets/mario.mp3");
		AudioClip val6 = val.LoadAsset<AudioClip>("assets/zoo.mp3");
		AudioClip val7 = val.LoadAsset<AudioClip>("assets/apt.mp3");
		AudioClip val8 = val.LoadAsset<AudioClip>("assets/freeFromDesire.mp3");
		AudioClip val9 = val.LoadAsset<AudioClip>("assets/ciel.mp3");
		AudioClip val10 = val.LoadAsset<AudioClip>("assets/reseaux.mp3");
		AudioClip val11 = val.LoadAsset<AudioClip>("assets/dolceCamara.mp3");
		AudioClip val12 = val.LoadAsset<AudioClip>("assets/laVieEnRose.mp3");
		AudioClip val13 = val.LoadAsset<AudioClip>("assets/spider.mp3");
		AudioClip val14 = val.LoadAsset<AudioClip>("assets/djadja.mp3");
		AudioClip val15 = val.LoadAsset<AudioClip>("assets/derniereDanse.mp3");
		AudioClip val16 = val.LoadAsset<AudioClip>("assets/papaoutai.mp3");
		AudioClip val17 = val.LoadAsset<AudioClip>("assets/sapeCommeJamais.mp3");
		AudioClip val18 = val.LoadAsset<AudioClip>("assets/uptownFunk.mp3");
		AudioClip val19 = val.LoadAsset<AudioClip>("assets/wakaWaka.mp3");
		AudioClip val20 = val.LoadAsset<AudioClip>("assets/jeMeTire.mp3");
		AudioClip val21 = val.LoadAsset<AudioClip>("assets/bella.mp3");
		AudioClip val22 = val.LoadAsset<AudioClip>("assets/enFeu.mp3");
		AudioClip val23 = val.LoadAsset<AudioClip>("assets/happy.mp3");
		AudioClip val24 = val.LoadAsset<AudioClip>("assets/despacito.mp3");
		AudioClip val25 = val.LoadAsset<AudioClip>("assets/gangnamStyle.mp3");
		AudioClip val26 = val.LoadAsset<AudioClip>("assets/macarena.mp3");
		AudioClip val27 = val.LoadAsset<AudioClip>("assets/maDirection.mp3");
		AudioClip val28 = val.LoadAsset<AudioClip>("assets/oldTownRoad.mp3");
		AudioClip val29 = val.LoadAsset<AudioClip>("assets/baby.mp3");
		AudioClip val30 = val.LoadAsset<AudioClip>("assets/wavinFlag.mp3");
		AudioClip val31 = val.LoadAsset<AudioClip>("assets/believer.mp3");
		AudioClip val32 = val.LoadAsset<AudioClip>("assets/diamonds.mp3");
		AudioClip val33 = val.LoadAsset<AudioClip>("assets/dior.mp3");
		AudioClip val34 = val.LoadAsset<AudioClip>("assets/inDaClub.mp3");
		AudioClip val35 = val.LoadAsset<AudioClip>("assets/loseYourself.mp3");
		AudioClip val36 = val.LoadAsset<AudioClip>("assets/inTheEnd.mp3");
		AudioClip val37 = val.LoadAsset<AudioClip>("assets/stillDre.mp3");
		if ((Object)(object)val2 == (Object)null || (Object)(object)val3 == (Object)null || (Object)(object)val4 == (Object)null || (Object)(object)val5 == (Object)null || (Object)(object)val6 == (Object)null || (Object)(object)val7 == (Object)null || (Object)(object)val8 == (Object)null || (Object)(object)val9 == (Object)null || (Object)(object)val10 == (Object)null || (Object)(object)val11 == (Object)null || (Object)(object)val12 == (Object)null || (Object)(object)val13 == (Object)null || (Object)(object)val14 == (Object)null || (Object)(object)val15 == (Object)null || (Object)(object)val16 == (Object)null || (Object)(object)val17 == (Object)null || (Object)(object)val18 == (Object)null || (Object)(object)val19 == (Object)null || (Object)(object)val20 == (Object)null || (Object)(object)val21 == (Object)null || (Object)(object)val22 == (Object)null || (Object)(object)val23 == (Object)null || (Object)(object)val24 == (Object)null || (Object)(object)val25 == (Object)null || (Object)(object)val26 == (Object)null || (Object)(object)val27 == (Object)null || (Object)(object)val28 == (Object)null || (Object)(object)val29 == (Object)null || (Object)(object)val30 == (Object)null || (Object)(object)val31 == (Object)null || (Object)(object)val32 == (Object)null || (Object)(object)val33 == (Object)null || (Object)(object)val34 == (Object)null || (Object)(object)val35 == (Object)null || (Object)(object)val36 == (Object)null || (Object)(object)val37 == (Object)null)
		{
			((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load one of the audio assets!");
			return;
		}
		newSFX = (AudioClip[])(object)new AudioClip[36]
		{
			val2, val3, val4, val5, val6, val7, val8, val9, val10, val11,
			val12, val13, val14, val15, val16, val17, val18, val19, val20, val21,
			val22, val23, val24, val25, val26, val27, val28, val29, val30, val31,
			val32, val33, val34, val35, val36, val37
		};
		_harmony.PatchAll(typeof(PatchClass));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"bugleMusics plugin loaded !");
	}
}