using System; using System.Collections.Generic; 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 Microsoft.CodeAnalysis; using TooManyEmotes; 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(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("TooManyEmotesAdditionalEmotes")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+04890f608120b2fb861ac2c4bc8454479c9448da")] [assembly: AssemblyProduct("My first plugin")] [assembly: AssemblyTitle("TooManyEmotesAdditionalEmotes")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 TooManyEmotesAdditionalEmotes { internal class EmoteLoader { public static void LoadAssets() { string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)Plugin.instance).Info.Location), "aloneemotes"); AssetBundle val = AssetBundle.LoadFromFile(text); LoadAnimationAssets(val); LoadAudioAssets(val); EmotesManager.BuildEmotesList(); AnimationClip[] array = val.LoadAllAssets(); AnimationClip[] array2 = array; foreach (AnimationClip val2 in array2) { AdditionalEmoteData.SetEmoteDoesNotUseBoombox(((Object)val2).name); } Plugin.Logger.LogInfo((object)"Loaded emotes!"); } private static void LoadAnimationAssets(AssetBundle assetBundle) { try { AnimationClip[] array = assetBundle.LoadAllAssets(); Plugin.complementaryAnimationClips.AddRange(array); Plugin.customAnimationClipsHash.UnionWith(array); Plugin.customAnimationClips.AddRange(array); } catch (Exception) { Plugin.Logger.LogError((object)$"Unable to load animations from {assetBundle}"); } } private static void LoadAudioAssets(AssetBundle assetBundle) { try { AudioClip[] array = assetBundle.LoadAllAssets(); Dictionary dictionary = (Dictionary)Traverse.CreateWithType("TooManyEmotes.Audio.AudioManager").Field("audioClipsDictDmca").GetValue(); HashSet hashSet = (HashSet)Traverse.CreateWithType("TooManyEmotes.Audio.AudioManager").Field("loadedAudioClips").GetValue(); HashSet hashSet2 = (HashSet)Traverse.CreateWithType("TooManyEmotes.Audio.AudioManager").Field("loadedAudioClipsDmca").GetValue(); if (dictionary != null && hashSet != null && hashSet2 != null) { AudioClip[] array2 = array; foreach (AudioClip val in array2) { if (!dictionary.ContainsKey(((Object)val).name)) { dictionary[((Object)val).name] = val; } if (!hashSet.Contains(val)) { hashSet.Add(val); } if (!hashSet2.Contains(val)) { hashSet2.Add(val); } } Plugin.Logger.LogInfo((object)"Loaded audio clips for emotes."); } else { Plugin.Logger.LogError((object)"Failed to retrieve Audio Dictionary or Audio Set"); } } catch (Exception) { Plugin.Logger.LogError((object)$"Unable to load audio from {assetBundle}"); } } } [BepInPlugin("luvsya.aloneemotes", "alones emotes", "1.0.3")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; public static Plugin instance; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; instance = this; EmoteLoader.LoadAssets(); Logger.LogInfo((object)"Plugin luvsya.aloneemotes is loaded!"); } } internal class PluginInfo { public const string PLUGIN_GUID = "luvsya.aloneemotes"; public const string PLUGIN_NAME = "alones emotes"; public const string PLUGIN_VERSION = "1.0.3"; } public static class MyPluginInfo { public const string PLUGIN_GUID = "TooManyEmotesAdditionalEmotes"; public const string PLUGIN_NAME = "My first plugin"; public const string PLUGIN_VERSION = "1.0.0"; } }