Decompiled source of MoreSoundboardSounds v1.3.0

MoreSoundboardSounds.dll

Decompiled a week ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using MemeSoundboard;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Enchanted Games")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Adds more sounds to the soundboard.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+cbc72dd4190da5e8aa88c62a08238d4a287f0ea1")]
[assembly: AssemblyProduct("MoreSoundboardSounds")]
[assembly: AssemblyTitle("MoreSoundboardSounds")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
internal class Assets
{
	internal static AssetBundle mainAssetBundle;

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

	internal static void LoadAssetBundle(string assetbundlePath)
	{
		if ((Object)(object)mainAssetBundle == (Object)null)
		{
			mainAssetBundle = AssetBundle.LoadFromFile(assetbundlePath);
		}
		assetNames = mainAssetBundle.GetAllAssetNames();
	}

	internal static AssetBundle GetBundle()
	{
		if (!Object.op_Implicit((Object)(object)mainAssetBundle))
		{
			Debug.LogError((object)"There is no AssetBundle to load assets from.");
			return null;
		}
		return mainAssetBundle;
	}
}
namespace MoreSoundboardSounds
{
	public static class PluginInfo
	{
		public const string PLUGIN_ID = "MoreSoundboardSounds";

		public const string PLUGIN_NAME = "MoreSoundboardSounds";

		public const string PLUGIN_VERSION = "1.3.0";

		public const string PLUGIN_GUID = "games.enchanted.MoreSoundboardSounds";
	}
	[BepInPlugin("games.enchanted.MoreSoundboardSounds", "MoreSoundboardSounds", "1.3.0")]
	public class Plugin : BaseUnityPlugin
	{
		public ManualLogSource PluginLogger;

		public static Plugin Instance { get; private set; }

		private void Awake()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			Instance = this;
			PluginLogger = ((BaseUnityPlugin)this).Logger;
			Harmony val = new Harmony("games.enchanted.MoreSoundboardSounds");
			val.PatchAll();
			PluginLogger.LogInfo((object)"Plugin MoreSoundboardSounds (games.enchanted.MoreSoundboardSounds) has been summoned!");
			LoadSounboardSounds();
		}

		private void LoadSounboardSounds()
		{
			string assetbundlePath = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "mss-sounds");
			Assets.LoadAssetBundle(assetbundlePath);
			AssetBundle bundle = Assets.GetBundle();
			string text = "[mss] ";
			MemeSoundboardBase.AddNewSound(text + "GET OUT", bundle.LoadAsset<AudioClip>("getout"));
			MemeSoundboardBase.AddNewSound(text + "theres an impostor among us", bundle.LoadAsset<AudioClip>("impostor"));
			MemeSoundboardBase.AddNewSound(text + "AHHH HAELP HAELP HAELP", bundle.LoadAsset<AudioClip>("haelp"));
			MemeSoundboardBase.AddNewSound(text + "WAIT WAIT WAIT", bundle.LoadAsset<AudioClip>("wait_wait_wait_wat_da_hell"));
			MemeSoundboardBase.AddNewSound(text + "keydrop.mp3", bundle.LoadAsset<AudioClip>("keydrop"));
			MemeSoundboardBase.AddNewSound(text + "although for one of you...", bundle.LoadAsset<AudioClip>("although_for_one_of_you"));
			MemeSoundboardBase.AddNewSound(text + "skidaddle", bundle.LoadAsset<AudioClip>("goofy_run"));
			MemeSoundboardBase.AddNewSound(text + "YOU'LL NEVER SEE IT COMING", bundle.LoadAsset<AudioClip>("you_never_see_it_coming"));
			MemeSoundboardBase.AddNewSound(text + "to be continued...", bundle.LoadAsset<AudioClip>("to_be_continued"));
			MemeSoundboardBase.AddNewSound(text + "i just lost my dawwwwg", bundle.LoadAsset<AudioClip>("lost_my_dawg"));
			MemeSoundboardBase.AddNewSound(text + "THIS IS A MOMENT IN HISTORY", bundle.LoadAsset<AudioClip>("take_a_picture"));
			PluginLogger.LogInfo((object)"MoreSoundboardSounds (games.enchanted.MoreSoundboardSounds) has successfully added sounds!");
		}
	}
}