Decompiled source of VinsMemeSounds v1.0.5

VinsMemeSounds.dll

Decompiled 11 months ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using MemeSoundboard;
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("VinsMemeSounds")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VinsMemeSounds")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("6a06217e-3395-4f22-8775-16e362723ee9")]
[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")]
internal class Assets
{
	internal static AssetBundle mainAssetBundle;

	private static string[] assetNames = new string[0];

	internal static void LoadAssetBundle(string assetbundlePath)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		if ((Object)mainAssetBundle == (Object)null)
		{
			mainAssetBundle = AssetBundle.LoadFromFile(assetbundlePath);
		}
		assetNames = mainAssetBundle.GetAllAssetNames();
	}

	internal static AssetBundle GetBundle()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Expected O, but got Unknown
		if (!Object.op_Implicit((Object)mainAssetBundle))
		{
			Debug.LogError((object)"There is no AssetBundle to load assets from.");
			return null;
		}
		return mainAssetBundle;
	}
}
namespace VinsMemeSounds;

[BepInPlugin("vin.amongus.CustomMemeSoundboard", "Vin's Custom Meme Soundboard", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private const string modGUID = "vin.amongus.CustomMemeSoundboard";

	private const string modName = "Vin's Custom Meme Soundboard";

	private const string modVersion = "1.0.0";

	public static Plugin Instance;

	internal ManualLogSource vinLogger;

	private readonly Harmony harmony = new Harmony("vin.amongus.CustomMemeSoundboard");

	private void Awake()
	{
		Instance = this;
		string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "sounds");
		vinLogger = Logger.CreateLogSource("Vin's Custom Meme Soundboard");
		vinLogger.LogInfo((object)"Vin's custom sounds loaded!");
		vinLogger.LogInfo((object)("Path: " + text));
		Assets.LoadAssetBundle(text);
		AssetBundle bundle = Assets.GetBundle();
		MemeSoundboardBase.AddNewSound("pluh (VMS)", bundle.LoadAsset<AudioClip>("pluh"));
		MemeSoundboardBase.AddNewSound("bluetooth (VMS)", bundle.LoadAsset<AudioClip>("bluetooth"));
		MemeSoundboardBase.AddNewSound("herobrine (VMS)", bundle.LoadAsset<AudioClip>("herobrine"));
		MemeSoundboardBase.AddNewSound("hub (VMS)", bundle.LoadAsset<AudioClip>("hub"));
		MemeSoundboardBase.AddNewSound("bastard (VMS)", bundle.LoadAsset<AudioClip>("bastard"));
		MemeSoundboardBase.AddNewSound("sus (VMS)", bundle.LoadAsset<AudioClip>("sus"));
		MemeSoundboardBase.AddNewSound("da ogs (VMS)", bundle.LoadAsset<AudioClip>("ogs"));
		MemeSoundboardBase.AddNewSound("aghhh (VMS)", bundle.LoadAsset<AudioClip>("aghhh"));
		MemeSoundboardBase.AddNewSound("goofy (VMS)", bundle.LoadAsset<AudioClip>("goofy"));
		MemeSoundboardBase.AddNewSound("holy moly (VMS)", bundle.LoadAsset<AudioClip>("holymoly"));
		MemeSoundboardBase.AddNewSound("jobs done (VMS)", bundle.LoadAsset<AudioClip>("jobs_done"));
		MemeSoundboardBase.AddNewSound("lego (VMS)", bundle.LoadAsset<AudioClip>("lego"));
		MemeSoundboardBase.AddNewSound("lightskin (VMS)", bundle.LoadAsset<AudioClip>("sincity"));
		MemeSoundboardBase.AddNewSound("stinks (VMS)", bundle.LoadAsset<AudioClip>("stinks"));
		MemeSoundboardBase.AddNewSound("yay (VMS)", bundle.LoadAsset<AudioClip>("yay"));
		MemeSoundboardBase.AddNewSound("oof (VMS)", bundle.LoadAsset<AudioClip>("oof"));
		MemeSoundboardBase.AddNewSound("is that freddy (VMS)", bundle.LoadAsset<AudioClip>("freddyfazbear"));
		MemeSoundboardBase.AddNewSound("incorrect (VMS)", bundle.LoadAsset<AudioClip>("incorrect"));
		MemeSoundboardBase.AddNewSound("indian (VMS)", bundle.LoadAsset<AudioClip>("indian"));
		MemeSoundboardBase.AddNewSound("outro (VMS)", bundle.LoadAsset<AudioClip>("outro"));
		MemeSoundboardBase.AddNewSound("prowler (VMS)", bundle.LoadAsset<AudioClip>("prowler"));
		MemeSoundboardBase.AddNewSound("ack (VMS)", bundle.LoadAsset<AudioClip>("ack"));
		MemeSoundboardBase.AddNewSound("fnaf ambience (VMS)", bundle.LoadAsset<AudioClip>("fnafambience"));
		MemeSoundboardBase.AddNewSound("too bad (VMS)", bundle.LoadAsset<AudioClip>("toobad"));
		MemeSoundboardBase.AddNewSound("laughing (VMS)", bundle.LoadAsset<AudioClip>("laughing"));
		harmony.PatchAll();
	}
}