Decompiled source of DacneEmotesBundle v1.2.0

DanceEmotesBundleByMK.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using CustomEmotesAPI_Template_Mod;
using EmotesAPI;
using Lethal_Company_CustomEmotesAPI_Template_Mod;
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: AssemblyTitle("Lethal Company CustomEmotesAPI Template Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Lethal Company CustomEmotesAPI Template Mod")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("199912ba-43b6-4276-b420-7bfaa3eedbe5")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[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;
		}
	}
}
namespace Lethal_Company_CustomEmotesAPI_Template_Mod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("mkmods.DanceEmotesBundle", "DanceEmotesBundleByMK", "1.1.0")]
	public class DanceEmotesBundle : BaseUnityPlugin
	{
		public const string PluginGUID = "mkmods.DanceEmotesBundle";

		public const string PluginName = "DanceEmotesBundleByMK";

		public const string PluginVersion = "1.1.0";

		public static DanceEmotesBundle instance;

		public static ConfigFile config;

		public static PluginInfo PInfo { get; private set; }

		public static ConfigEntry<bool> canMoveWhileDancing { get; private set; }

		private static void InitConfig()
		{
			canMoveWhileDancing = config.Bind<bool>("Setting", "Can not move while dancing?", true, "");
		}

		public void Awake()
		{
			//IL_0924: Unknown result type (might be due to invalid IL or missing references)
			//IL_092e: Expected O, but got Unknown
			config = ((BaseUnityPlugin)this).Config;
			InitConfig();
			instance = this;
			PInfo = ((BaseUnityPlugin)this).Info;
			Assets.LoadAssetBundlesFromFolder("assetbundles");
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("shewolf.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("shewolfsound.ogg") }, sync: false, "She Wolf", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("BrooklynBloodPop1.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("BrooklynBloodPop.ogg") }, sync: false, "Brooklyn Blood Pop 1", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("BrooklynBloodPop2.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("BrooklynBloodPop.ogg") }, sync: false, "Brooklyn Blood Pop 2", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("Cute Oui Dance Trend 1.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("Cute Oui Dance Trend.ogg") }, sync: false, "Cute Oui Dance Trend 1", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("Cute Oui Dance Trend 2.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("Cute Oui Dance Trend.ogg") }, sync: false, "Cute Oui Dance Trend 2", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("baby you challenge.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("baby you challenge.ogg") }, sync: false, "baby you challenge", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("bubblepop.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("bubblepop.ogg") }, sync: false, "bubblepop", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("cure for me challenge.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("cure for me challenge.ogg") }, sync: false, "cure for me challenge", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("Jojo Pose Challenge.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("Jojo Pose Challenge.ogg") }, sync: false, "Jojo Pose Challenge", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("Kiss Me More.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("Kiss Me More.ogg") }, sync: false, "Kiss Me More", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("No way.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("No way.ogg") }, sync: false, "No way", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("PUBG_RollnRock_loop.anim") }, null, looping: true, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("PUBG_RollnRock_loop.ogg") }, sync: false, "Roll n Rock(PUBG)", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("Roll n Rock.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("Roll n Rock.ogg") }, sync: false, "Roll n Rock", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("gambare gambare senpai.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("gambare gambare senpai.ogg") }, sync: false, "gambare gambare senpai", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("gambare gambare senpai 2.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("gambare gambare senpai 2.ogg") }, sync: false, "gambare gambare senpai 2 min", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("ke mu san.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("ke mu san.ogg") }, sync: false, "ke mu san", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("qing hai yao.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("qing hai yao.ogg") }, sync: false, "qing hai yao", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("xinbaodao zhong.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("xinbaodao.ogg") }, sync: false, "xinbaodao(zhong)", dmca: false, cantMove: false, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("xinbaodao zuo.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("xinbaodao.ogg") }, sync: false, "xinbaodao(zuo)", dmca: false, cantMove: false, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("xinbaodao zuozuo.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("xinbaodao.ogg") }, sync: false, "xinbaodao(zuozuo)", dmca: false, cantMove: false, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("xinbaodao you.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("xinbaodao.ogg") }, sync: false, "xinbaodao(you)", dmca: false, cantMove: false, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("xinbaodao hou.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("xinbaodao.ogg") }, sync: false, "xinbaodao(hou)", dmca: false, cantMove: false, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("xinbaodao youyou.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("xinbaodao.ogg") }, sync: false, "xinbaodao(youyou)", dmca: false, cantMove: false, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("all my people.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("all my people.ogg") }, sync: false, "all my people", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("CaliforniaGurls.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("CaliforniaGurls.ogg") }, sync: false, "California Gurls", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("Fortnite_Frolic.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("Fortnite_Frolic.ogg") }, sync: false, "Frolic(Fortnite)", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("Instant21.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("Instant21.ogg") }, sync: false, "Instant21", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("P3DMN_LightTheFireUpInTheNight.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("P3DMN_LightTheFireUpInTheNight.ogg") }, sync: false, "LightTheFireUpInTheNight(P3DMN)", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("PUBG_2PhutHon_loop.anim") }, null, looping: true, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("PUBG_2PhutHon_loop.ogg") }, sync: false, "2PhutHon(PUBG)", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("PUBG_BBoomBBoom.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("PUBG_BBoomBBoom.ogg") }, sync: false, "BBoomBBoom(PUBG)", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("PUBG_Poppy.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("PUBG_Poppy.ogg") }, sync: false, "Poppy(PUBG)", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("PUBG_Samsara.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("PUBG_Samsara.ogg") }, sync: false, "Samsara(PUBG)", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("PUBG_SeeTinh.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("PUBG_SeeTinh.ogg") }, sync: false, "SeeTinh(PUBG)", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("PUBG_VictoryDance61.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("PUBG_VictoryDance61.ogg") }, sync: false, "PUBG_VictoryDance61", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("PUBG_VictoryDance85.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("PUBG_VictoryDance85.ogg") }, sync: false, "PUBG_VictoryDance85", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Assets.Load<AnimationClip>("PUBG_VictoryDance102.anim") }, null, looping: false, (AudioClip[])(object)new AudioClip[1] { Assets.Load<AudioClip>("PUBG_VictoryDance102.ogg") }, sync: false, "PUBG_VictoryDance102", dmca: false, canMoveWhileDancing.Value, thirdPerson: false);
			CustomEmotesAPI.animChanged += new AnimationChanged(CustomEmotesAPI_animChanged);
		}

		public void ImportAnimation(AnimationClip[] primaryClips, AnimationClip[] secondaryClips, bool looping, AudioClip[] primaryAudioClips, bool sync, string customName, bool dmca, bool cantMove, bool thirdPerson)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			AnimationClipParams val = new AnimationClipParams();
			val.animationClip = primaryClips;
			val.secondaryAnimation = secondaryClips;
			val.looping = looping;
			val._primaryAudioClips = primaryAudioClips;
			val._secondaryAudioClips = null;
			val._primaryDMCAFreeAudioClips = null;
			val._secondaryDMCAFreeAudioClips = null;
			val.visible = true;
			val.syncAnim = sync;
			val.syncAudio = sync;
			val.startPref = -1;
			val.joinPref = -1;
			val.joinSpots = null;
			val.customName = customName;
			val.lockType = (LockType)1;
			val.willGetClaimedByDMCA = dmca;
			val.audioLevel = 0.3f;
			val.rootBonesToIgnore = null;
			val.soloBonesToIgnore = null;
			val.stopWhenMove = cantMove;
			val.thirdPerson = thirdPerson;
			val.displayName = "";
			CustomEmotesAPI.AddCustomAnimation(val);
		}

		private void CustomEmotesAPI_animChanged(string newAnimation, BoneMapper mapper)
		{
		}
	}
}
namespace CustomEmotesAPI_Template_Mod
{
	internal static class Assets
	{
		internal static readonly List<AssetBundle> AssetBundles = new List<AssetBundle>();

		private static readonly Dictionary<string, int> AssetIndices = new Dictionary<string, int>();

		internal static void LoadAssetBundlesFromFolder(string folderName)
		{
			folderName = Path.Combine(Path.GetDirectoryName(DanceEmotesBundle.PInfo.Location), folderName);
			string[] files = Directory.GetFiles(folderName);
			foreach (string text in files)
			{
				AssetBundle val = AssetBundle.LoadFromFile(text);
				int count = AssetBundles.Count;
				AssetBundles.Add(val);
				string[] allAssetNames = val.GetAllAssetNames();
				foreach (string text2 in allAssetNames)
				{
					string text3 = text2.ToLowerInvariant();
					if (text3.StartsWith("assets/"))
					{
						text3 = text3.Remove(0, "assets/".Length);
					}
					AssetIndices[text3] = count;
				}
				DebugClass.Log((object)("Loaded AssetBundle: " + Path.GetFileName(text)));
			}
		}

		internal static T Load<T>(string assetName) where T : Object
		{
			try
			{
				assetName = assetName.ToLowerInvariant();
				if (assetName.Contains(":"))
				{
					string[] array = assetName.Split(':');
					assetName = array[1].ToLowerInvariant();
				}
				if (assetName.StartsWith("assets/"))
				{
					assetName = assetName.Remove(0, "assets/".Length);
				}
				int index = AssetIndices[assetName];
				return AssetBundles[index].LoadAsset<T>("assets/" + assetName);
			}
			catch (Exception arg)
			{
				DebugClass.Log((object)$"Couldn't load asset [{assetName}] reason: {arg}");
				return default(T);
			}
		}
	}
}