Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of MegaEmotes KpopAndAnime v1.0.4
BepInEx/plugins/MegaEmotes_KpopAndAnime/MegaEmotes_KpopAndAnime.dll
Decompiled 9 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using MegaTooManyEmotes.Shared; using Microsoft.CodeAnalysis; using TMPro; using TooManyEmotes; using TooManyEmotes.Audio; using TooManyEmotes.UI; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("exeryze")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Adds HEARTSTEEL - PARANOIA, K/DA - Firestarter, BLACKPINK, BTS, TWICE, LE SSERAFIM, anime, and viral dances natively to TooManyEmotes with full music, a dedicated K-Pop & Anime wheel tab, and no LethalEmotesAPI.")] [assembly: AssemblyFileVersion("1.0.4.0")] [assembly: AssemblyInformationalVersion("1.0.4")] [assembly: AssemblyProduct("MegaEmotes_KpopAndAnime")] [assembly: AssemblyTitle("MegaEmotes_KpopAndAnime")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.4.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 MegaTooManyEmotes.Shared { internal static class MegaEmoteConfig { internal static ConfigEntry<bool> UnlockAllByDefault { get; private set; } internal static ConfigEntry<bool> PlayAudioWithoutBoombox { get; private set; } internal static ConfigEntry<bool> IncludeBaseTooManyEmotesOverlaps { get; private set; } internal static ConfigEntry<bool> EnableTraversalEmotes { get; private set; } internal static ConfigEntry<bool> AddCustomCategoryTab { get; private set; } internal static void Bind(ConfigFile config) { UnlockAllByDefault = config.Bind<bool>("General", "UnlockAllByDefault", true, "When true, all dances in this pack are placed in TooManyEmotes' Complementary category and unlocked immediately by default."); PlayAudioWithoutBoombox = config.Bind<bool>("Audio", "PlayAudioWithoutBoombox", true, "When true, dances in this pack play their audio directly without requiring a Boombox."); IncludeBaseTooManyEmotesOverlaps = config.Bind<bool>("Emotes", "IncludeBaseTooManyEmotesOverlaps", true, "When true, includes dances that overlap with base TooManyEmotes or ValikTooManyEmotes (labeled with their source pack name)."); EnableTraversalEmotes = config.Bind<bool>("Emotes", "EnableTraversalEmotes", true, "When true, allows moving while performing traversal/walking emotes in this pack."); AddCustomCategoryTab = config.Bind<bool>("UI", "AddCustomCategoryTab", true, "When true, adds a dedicated category tab for this pack to TooManyEmotes' emote wheel."); } } internal static class MegaEmoteLoader { private readonly record struct RegisteredEmoteMeta(string Key, string DisplayName, bool CanMove, string EmoteKey, string? PrimaryAudioKey, string? LoopAudioKey); private static readonly Dictionary<string, AssetBundle> LoadedBundles = new Dictionary<string, AssetBundle>(StringComparer.OrdinalIgnoreCase); private static readonly Dictionary<string, Dictionary<string, string>> BundleLookups = new Dictionary<string, Dictionary<string, string>>(StringComparer.OrdinalIgnoreCase); private static readonly Dictionary<string, AudioClip> AudioByKey = new Dictionary<string, AudioClip>(StringComparer.Ordinal); private static readonly HashSet<string> PendingAudioKeys = new HashSet<string>(StringComparer.Ordinal); private static readonly List<RegisteredEmoteMeta> RegisteredEmotes = new List<RegisteredEmoteMeta>(); private static readonly List<UnlockableEmote> PackTabEmotes = new List<UnlockableEmote>(); private static FieldInfo? _loadedAudioClipsField; private static FieldInfo? _loadedAudioClipsDmcaFreeField; private static FieldInfo? _audioClipsDictDmcaField; private static FieldInfo? _audioClipsDictDmcaFreeField; private static FieldInfo? _complementaryEmotesDefaultField; private static bool _initialized; private static bool _isApplyingMetadata; private static string _tabDisplayName = string.Empty; private static ManualLogSource? _log; internal static void Initialize(string pluginDirectory, string tabDisplayName, IEnumerable<string> bundleFiles, IEnumerable<MegaEmoteDef> catalog, IEnumerable<VmdEmoteDef> vmdCatalog, MonoBehaviour coroutineHost, ManualLogSource log) { if (_initialized) { return; } _initialized = true; _tabDisplayName = tabDisplayName; _log = log; VmdEmotePlayer.SetLogger(log); ResolveReflectionFields(); string path = Path.Combine(pluginDirectory, "assetbundles"); foreach (string bundleFile in bundleFiles) { string text = Path.Combine(path, bundleFile); if (!File.Exists(text)) { _log.LogError((object)("Missing AssetBundle '" + text + "'.")); continue; } AssetBundle val = AssetBundle.LoadFromFile(text); if ((Object)(object)val == (Object)null) { _log.LogError((object)("Failed to load AssetBundle '" + text + "'.")); continue; } LoadedBundles[bundleFile] = val; BundleLookups[bundleFile] = BuildBundleAssetLookup(val); } ICollection<VmdEmoteDef> collection = (vmdCatalog as ICollection<VmdEmoteDef>) ?? vmdCatalog.ToList(); if (LoadedBundles.Count == 0 && collection.Count == 0) { _log.LogError((object)"No AssetBundles or VMD emotes could be loaded. Aborting emote registration."); return; } bool value = MegaEmoteConfig.UnlockAllByDefault.Value; bool value2 = MegaEmoteConfig.IncludeBaseTooManyEmotesOverlaps.Value; int num = 0; foreach (MegaEmoteDef item in catalog.OrderBy<MegaEmoteDef, string>((MegaEmoteDef d) => d.DisplayName, StringComparer.OrdinalIgnoreCase)) { if ((!item.IsBaseOverlap || value2) && TryRegisterEmote(item, value)) { num++; } } string vmdDir = Path.Combine(pluginDirectory, "vmd"); foreach (VmdEmoteDef item2 in collection.OrderBy<VmdEmoteDef, string>((VmdEmoteDef d) => d.DisplayName, StringComparer.OrdinalIgnoreCase)) { if ((!item2.IsBaseOverlap || value2) && TryRegisterVmdEmote(item2, vmdDir, value, coroutineHost)) { num++; } } RegisterAllAudioInManager(); _log.LogInfo((object)$"Registered {num} emotes across {LoadedBundles.Count} bundles and {collection.Count} VMD clips. Rebuilding TooManyEmotes list..."); EmotesManager.BuildEmotesList(); ApplyMetadataToEmotes(); AdditionalEmoteData.SetAdditionalEmoteData(); AdditionalEmoteData.SetAdditionalPropData(); AdditionalEmoteData.SetAdditionalMusicData(); _log.LogInfo((object)$"Initialization complete with {RegisteredEmotes.Count} active emotes."); } internal static void ApplyMetadataToEmotes() { if (_isApplyingMetadata || RegisteredEmotes.Count == 0) { return; } _isApplyingMetadata = true; try { bool value = MegaEmoteConfig.EnableTraversalEmotes.Value; bool value2 = MegaEmoteConfig.PlayAudioWithoutBoombox.Value; bool value3 = MegaEmoteConfig.UnlockAllByDefault.Value; List<UnlockableEmote> list = _complementaryEmotesDefaultField?.GetValue(null) as List<UnlockableEmote>; foreach (RegisteredEmoteMeta registeredEmote in RegisteredEmotes) { if (!EmotesManager.allUnlockableEmotesDict.TryGetValue(registeredEmote.EmoteKey, out var value4) || value4 == null) { continue; } value4.displayName = registeredEmote.DisplayName; value4.complementary = value3; value4.overrideAudioClipName = registeredEmote.PrimaryAudioKey ?? string.Empty; value4.overrideAudioLoopClipName = registeredEmote.LoopAudioKey ?? string.Empty; if (value3) { if (list != null && !list.Contains(value4)) { list.Add(value4); } if (EmotesManager.complementaryEmotes != null && !EmotesManager.complementaryEmotes.Contains(value4)) { EmotesManager.complementaryEmotes.Add(value4); } EmotesManager.allEmotesTier0?.Remove(value4); EmotesManager.allEmotesTier1?.Remove(value4); EmotesManager.allEmotesTier2?.Remove(value4); EmotesManager.allEmotesTier3?.Remove(value4); } if (registeredEmote.CanMove && value) { value4.canMoveWhileEmoting = true; AdditionalEmoteData.SetCanMoveWhileEmoting(registeredEmote.EmoteKey); } if (value2 && registeredEmote.PrimaryAudioKey != null) { value4.isBoomboxAudio = false; AdditionalEmoteData.SetEmoteDoesNotUseBoombox(registeredEmote.EmoteKey); } } RefreshPackTabEmotes(); } catch (Exception arg) { ManualLogSource? log = _log; if (log != null) { log.LogError((object)$"Error applying emote metadata: {arg}"); } } finally { _isApplyingMetadata = false; } } internal static void RefreshPackTabEmotes() { PackTabEmotes.Clear(); if (EmotesManager.allUnlockableEmotesDict == null || RegisteredEmotes.Count == 0) { return; } bool value = MegaEmoteConfig.UnlockAllByDefault.Value; foreach (RegisteredEmoteMeta registeredEmote in RegisteredEmotes) { if (EmotesManager.allUnlockableEmotesDict.TryGetValue(registeredEmote.EmoteKey, out var value2) && value2 != null && (value || SessionManager.IsEmoteUnlocked(value2, ""))) { PackTabEmotes.Add(value2); } } PackTabEmotes.Sort((UnlockableEmote a, UnlockableEmote b) => string.Compare(a.displayName, b.displayName, StringComparison.OrdinalIgnoreCase)); } internal static void EnsureCustomLoadoutTabRegistered() { try { if (!MegaEmoteConfig.AddCustomCategoryTab.Value || string.IsNullOrEmpty(_tabDisplayName) || PackTabEmotes.Count == 0 || (Object)(object)EmoteMenu.menuGameObject == (Object)null || EmoteMenu.emoteLoadoutUIElementsList == null || EmoteMenu.emoteLoadoutUIElementsList.Count == 0 || EmoteMenu.emoteLoadouts == null) { return; } if (EmoteMenu.emoteLoadoutUIElementsList.Count != EmoteMenu.emoteLoadouts.Count) { ManualLogSource? log = _log; if (log != null) { log.LogWarning((object)$"Skipping custom tab '{_tabDisplayName}': EmoteMenu UI count ({EmoteMenu.emoteLoadoutUIElementsList.Count}) != loadout list count ({EmoteMenu.emoteLoadouts.Count})."); } return; } for (int i = 0; i < EmoteMenu.emoteLoadoutUIElementsList.Count; i++) { EmoteLoadoutUIElement val = EmoteMenu.emoteLoadoutUIElementsList[i]; if ((Object)(object)val != (Object)null && string.Equals(val.loadoutName, _tabDisplayName, StringComparison.Ordinal)) { return; } } EmoteLoadoutUIElement val2 = EmoteMenu.emoteLoadoutUIElementsList[0]; if ((Object)(object)val2 == (Object)null || (Object)(object)((Component)val2).transform.parent == (Object)null) { return; } Transform parent = ((Component)val2).transform.parent; int count = EmoteMenu.emoteLoadoutUIElementsList.Count; bool activeSelf = EmoteMenu.menuGameObject.activeSelf; EmoteLoadoutUIElement val3 = null; try { if (!activeSelf) { EmoteMenu.menuGameObject.SetActive(true); } EmoteLoadoutUIElement.uiCount = count; val3 = Object.Instantiate<EmoteLoadoutUIElement>(val2, parent); } finally { if (!activeSelf && (Object)(object)EmoteMenu.menuGameObject != (Object)null) { EmoteMenu.menuGameObject.SetActive(false); } } if (!((Object)(object)val3 == (Object)null)) { val3.id = count; ((Object)val3).name = $"EmoteLoadout_{count}"; val3.loadoutName = _tabDisplayName; EmoteLoadoutUIElement val4 = val3; if (val4.backgroundImage == null) { val4.backgroundImage = ((Component)val3).GetComponentInChildren<Image>(true); } val4 = val3; if (val4.textContainer == null) { val4.textContainer = ((Component)val3).GetComponentInChildren<TextMeshPro>(true); } if ((Object)(object)val3.textContainer != (Object)null) { ((TMP_Text)val3.textContainer).text = _tabDisplayName; } EmoteLoadoutUIElement.uiCount = count + 1; EmoteMenu.emoteLoadoutUIElementsList.Add(val3); EmoteMenu.emoteLoadouts.Add(PackTabEmotes); if ((Object)(object)val3.backgroundImage != (Object)null) { val3.OnHover(false); } AdjustLoadoutListLayout(parent); } } catch (Exception arg) { ManualLogSource? log2 = _log; if (log2 != null) { log2.LogError((object)$"Error registering custom emote wheel tab '{_tabDisplayName}': {arg}"); } } } private static void AdjustLoadoutListLayout(Transform loadoutsParent) { //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) int count = EmoteMenu.emoteLoadoutUIElementsList.Count; if (count <= 7) { return; } float num = Mathf.Clamp(7.5f / (float)count, 0.58f, 1f); Transform val = (((Object)(object)Plugin.radialMenuPrefab != (Object)null) ? Plugin.radialMenuPrefab.transform.Find("MenuUI/EmoteLoadouts") : null); VerticalLayoutGroup component = ((Component)loadoutsParent).GetComponent<VerticalLayoutGroup>(); VerticalLayoutGroup val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent<VerticalLayoutGroup>() : null); if ((Object)(object)component != (Object)null && (Object)(object)val2 != (Object)null) { ((HorizontalOrVerticalLayoutGroup)component).spacing = ((HorizontalOrVerticalLayoutGroup)val2).spacing * num; } RectTransform val3 = (((Object)(object)val != (Object)null && val.childCount > 0) ? ((Component)val.GetChild(0)).GetComponent<RectTransform>() : null); LayoutElement val4 = (((Object)(object)val3 != (Object)null) ? ((Component)val3).GetComponent<LayoutElement>() : null); TextMeshPro val5 = (((Object)(object)val3 != (Object)null) ? ((Component)val3).GetComponentInChildren<TextMeshPro>(true) : null); for (int i = 0; i < EmoteMenu.emoteLoadoutUIElementsList.Count; i++) { EmoteLoadoutUIElement val6 = EmoteMenu.emoteLoadoutUIElementsList[i]; if ((Object)(object)val6 == (Object)null) { continue; } RectTransform component2 = ((Component)val6).GetComponent<RectTransform>(); if ((Object)(object)component2 != (Object)null && (Object)(object)val3 != (Object)null) { component2.sizeDelta = new Vector2(val3.sizeDelta.x, val3.sizeDelta.y * num); LayoutElement component3 = ((Component)val6).GetComponent<LayoutElement>(); if ((Object)(object)component3 != (Object)null && (Object)(object)val4 != (Object)null) { if (val4.preferredHeight > 0f) { component3.preferredHeight = val4.preferredHeight * num; } if (val4.minHeight > 0f) { component3.minHeight = val4.minHeight * num; } } } TextMeshPro textContainer = val6.textContainer; if ((Object)(object)textContainer != (Object)null) { float num2 = (((Object)(object)val5 != (Object)null && ((TMP_Text)val5).enableAutoSizing && ((TMP_Text)val5).fontSizeMax > 0f) ? ((TMP_Text)val5).fontSizeMax : ((!((Object)(object)val5 != (Object)null) || !(((TMP_Text)val5).fontSize > 0f)) ? ((((TMP_Text)textContainer).fontSize > 0f) ? ((TMP_Text)textContainer).fontSize : 16f) : ((TMP_Text)val5).fontSize)); ((TMP_Text)textContainer).enableWordWrapping = false; ((TMP_Text)textContainer).overflowMode = (TextOverflowModes)1; ((TMP_Text)textContainer).enableAutoSizing = true; ((TMP_Text)textContainer).fontSizeMin = Mathf.Max(4f, num2 * 0.45f); ((TMP_Text)textContainer).fontSizeMax = num2 * Mathf.Lerp(1f, num, 0.65f); if ((Object)(object)val5 != (Object)null && Mathf.Approximately(((TMP_Text)val5).rectTransform.anchorMin.y, ((TMP_Text)val5).rectTransform.anchorMax.y)) { ((TMP_Text)textContainer).rectTransform.sizeDelta = new Vector2(((TMP_Text)val5).rectTransform.sizeDelta.x, ((TMP_Text)val5).rectTransform.sizeDelta.y * num); } } } if ((Object)(object)component == (Object)null && (Object)(object)val != (Object)null) { loadoutsParent.localScale = val.localScale * Mathf.Clamp(7.5f / (float)count, 0.72f, 1f); } RectTransform val7 = (RectTransform)(object)((loadoutsParent is RectTransform) ? loadoutsParent : null); if (val7 != null) { LayoutRebuilder.ForceRebuildLayoutImmediate(val7); } } internal static void RegisterAllAudioInManager() { if (AudioByKey.Count == 0) { return; } HashSet<AudioClip> hashSet = _loadedAudioClipsField?.GetValue(null) as HashSet<AudioClip>; HashSet<AudioClip> hashSet2 = _loadedAudioClipsDmcaFreeField?.GetValue(null) as HashSet<AudioClip>; Dictionary<string, AudioClip> dictionary = _audioClipsDictDmcaField?.GetValue(null) as Dictionary<string, AudioClip>; Dictionary<string, AudioClip> dictionary2 = _audioClipsDictDmcaFreeField?.GetValue(null) as Dictionary<string, AudioClip>; foreach (var (key, val2) in AudioByKey) { if (!((Object)(object)val2 == (Object)null)) { hashSet?.Add(val2); hashSet2?.Add(val2); if (dictionary != null) { dictionary[key] = val2; } if (dictionary2 != null) { dictionary2[key] = val2; } } } } internal static bool TryGetAudioClip(string? clipName, out AudioClip? clip) { if (!string.IsNullOrEmpty(clipName) && AudioByKey.TryGetValue(clipName, out AudioClip value) && (Object)(object)value != (Object)null) { clip = value; return true; } clip = null; return false; } internal static bool HasAudioClip(string? clipName) { if (!string.IsNullOrEmpty(clipName)) { if (!AudioByKey.ContainsKey(clipName)) { return PendingAudioKeys.Contains(clipName); } return true; } return false; } private static bool TryRegisterEmote(MegaEmoteDef def, bool unlockByDefault) { //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) if (!LoadedBundles.TryGetValue(def.AnimBundle, out AssetBundle value) || !BundleLookups.TryGetValue(def.AnimBundle, out Dictionary<string, string> value2)) { ManualLogSource? log = _log; if (log != null) { log.LogWarning((object)("Animation bundle '" + def.AnimBundle + "' not loaded for '" + def.DisplayName + "'.")); } return false; } AnimationClip val = LoadAssetCaseInsensitive<AnimationClip>(value, value2, def.PrimaryAnimPath); if ((Object)(object)val == (Object)null) { ManualLogSource? log2 = _log; if (log2 != null) { log2.LogWarning((object)("Could not load primary animation '" + def.PrimaryAnimPath + "' from '" + def.AnimBundle + "' for '" + def.DisplayName + "'.")); } return false; } bool flag = def.LoopAnimPath != null || def.LoopAudioPath != null; AnimationClip val2 = null; if (def.LoopAnimPath != null) { val2 = LoadAssetCaseInsensitive<AnimationClip>(value, value2, def.LoopAnimPath); if ((Object)(object)val2 == (Object)null) { ManualLogSource? log3 = _log; if (log3 != null) { log3.LogWarning((object)("Could not load loop animation '" + def.LoopAnimPath + "' from '" + def.AnimBundle + "' for '" + def.DisplayName + "'. Falling back to clone.")); } val2 = Object.Instantiate<AnimationClip>(val); } } else if (def.LoopAudioPath != null) { val2 = Object.Instantiate<AnimationClip>(val); } AudioClip val3 = null; AudioClip val4 = null; if (def.PrimaryAudioPath != null) { if (LoadedBundles.TryGetValue(def.AudioBundle, out AssetBundle value3) && BundleLookups.TryGetValue(def.AudioBundle, out Dictionary<string, string> value4)) { val3 = LoadAssetCaseInsensitive<AudioClip>(value3, value4, def.PrimaryAudioPath); if ((Object)(object)val3 == (Object)null) { ManualLogSource? log4 = _log; if (log4 != null) { log4.LogWarning((object)("Could not load primary audio '" + def.PrimaryAudioPath + "' from '" + def.AudioBundle + "' for '" + def.DisplayName + "'.")); } } else if ((int)val3.loadState == 0) { val3.LoadAudioData(); } if (def.LoopAudioPath != null) { val4 = LoadAssetCaseInsensitive<AudioClip>(value3, value4, def.LoopAudioPath); if ((Object)(object)val4 == (Object)null) { ManualLogSource? log5 = _log; if (log5 != null) { log5.LogWarning((object)("Could not load loop audio '" + def.LoopAudioPath + "' from '" + def.AudioBundle + "' for '" + def.DisplayName + "'.")); } } else if ((int)val4.loadState == 0) { val4.LoadAudioData(); } } } else { ManualLogSource? log6 = _log; if (log6 != null) { log6.LogWarning((object)("Audio bundle '" + def.AudioBundle + "' not loaded for '" + def.DisplayName + "'.")); } } } string key = def.Key; string text = (((Object)val).name = (flag ? (key + "_start") : key)); if (Plugin.customAnimationClips == null) { Plugin.customAnimationClips = new List<AnimationClip>(); } if (Plugin.customAnimationClipsHash == null) { Plugin.customAnimationClipsHash = new HashSet<AnimationClip>(); } if (Plugin.customAnimationClipsLoopDict == null) { Plugin.customAnimationClipsLoopDict = new Dictionary<string, AnimationClip>(); } if (Plugin.complementaryAnimationClips == null) { Plugin.complementaryAnimationClips = new List<AnimationClip>(); } if (!Plugin.customAnimationClipsHash.Contains(val)) { Plugin.customAnimationClips.Add(val); Plugin.customAnimationClipsHash.Add(val); } if (unlockByDefault && !Plugin.complementaryAnimationClips.Contains(val)) { Plugin.complementaryAnimationClips.Add(val); } if (flag && (Object)(object)val2 != (Object)null) { string key2 = (((Object)val2).name = key + "_loop"); Plugin.customAnimationClipsLoopDict[key2] = val2; } string text4 = null; if ((Object)(object)val3 != (Object)null) { text4 = (((Object)val3).name = text); AudioByKey[text4] = val3; } string text6 = null; if ((Object)(object)val4 != (Object)null) { text6 = (((Object)val4).name = key + "_loop"); AudioByKey[text6] = val4; } RegisteredEmotes.Add(new RegisteredEmoteMeta(def.Key, def.DisplayName, def.CanMove, key, text4, text6)); return true; } private static AnimationClip? FindLoopingHumanoidTemplateClip() { return Search(Plugin.customAnimationClips, requireHumanoid: true, requireLooping: true) ?? Search(Plugin.complementaryAnimationClips, requireHumanoid: true, requireLooping: true) ?? Search(Plugin.customAnimationClips, requireHumanoid: true, requireLooping: false) ?? Search(Plugin.complementaryAnimationClips, requireHumanoid: true, requireLooping: false) ?? Search(Plugin.customAnimationClips, requireHumanoid: false, requireLooping: false) ?? Search(Plugin.complementaryAnimationClips, requireHumanoid: false, requireLooping: false); static AnimationClip? Search(IEnumerable<AnimationClip>? source, bool requireHumanoid, bool requireLooping) { if (source == null) { return null; } foreach (AnimationClip item in source) { if (!((Object)(object)item == (Object)null) && !(item.length <= 0.5f) && (!requireHumanoid || ((Motion)item).isHumanMotion) && (!requireLooping || ((Motion)item).isLooping)) { return item; } } return null; } } private static bool TryRegisterVmdEmote(VmdEmoteDef def, string vmdDir, bool unlockByDefault, MonoBehaviour coroutineHost) { string text = Path.Combine(vmdDir, def.MotionFile); if (!File.Exists(text)) { ManualLogSource? log = _log; if (log != null) { log.LogWarning((object)("Missing VMD motion file '" + text + "' for '" + def.DisplayName + "'.")); } return false; } VmdClipData vmdClipData = VmdEmotePlayer.LoadVmdBinary(text); if (vmdClipData == null) { return false; } AnimationClip val = FindLoopingHumanoidTemplateClip(); if ((Object)(object)val == (Object)null) { ManualLogSource? log2 = _log; if (log2 != null) { log2.LogError((object)("No template AnimationClip available for VMD emote '" + def.DisplayName + "'.")); } return false; } string key = def.Key; AnimationClip val2 = Object.Instantiate<AnimationClip>(val); ((Object)val2).name = key; if (Plugin.customAnimationClips == null) { Plugin.customAnimationClips = new List<AnimationClip>(); } if (Plugin.customAnimationClipsHash == null) { Plugin.customAnimationClipsHash = new HashSet<AnimationClip>(); } if (Plugin.complementaryAnimationClips == null) { Plugin.complementaryAnimationClips = new List<AnimationClip>(); } if (!Plugin.customAnimationClipsHash.Contains(val2)) { Plugin.customAnimationClips.Add(val2); Plugin.customAnimationClipsHash.Add(val2); } if (unlockByDefault && !Plugin.complementaryAnimationClips.Contains(val2)) { Plugin.complementaryAnimationClips.Add(val2); } VmdEmotePlayer.RegisterClip(key, vmdClipData); string text2 = null; if (!string.IsNullOrEmpty(def.AudioFile)) { string text3 = Path.Combine(vmdDir, def.AudioFile); if (File.Exists(text3)) { text2 = key; PendingAudioKeys.Add(text2); coroutineHost.StartCoroutine(LoadOggAudioCoroutine(text3, text2)); } else { ManualLogSource? log3 = _log; if (log3 != null) { log3.LogWarning((object)("Missing VMD audio file '" + text3 + "' for '" + def.DisplayName + "'.")); } } } RegisteredEmotes.Add(new RegisteredEmoteMeta(def.Key, def.DisplayName, def.CanMove, key, text2, null)); return true; } private static IEnumerator LoadOggAudioCoroutine(string oggPath, string audioKey) { UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip(new Uri(oggPath).AbsoluteUri, (AudioType)14); try { DownloadHandler downloadHandler = request.downloadHandler; DownloadHandlerAudioClip val = (DownloadHandlerAudioClip)(object)((downloadHandler is DownloadHandlerAudioClip) ? downloadHandler : null); if (val != null) { val.streamAudio = false; } yield return request.SendWebRequest(); PendingAudioKeys.Remove(audioKey); if ((int)request.result != 1) { ManualLogSource? log = _log; if (log != null) { log.LogError((object)("Failed to load OGG audio '" + oggPath + "' for '" + audioKey + "': " + request.error)); } yield break; } AudioClip content = DownloadHandlerAudioClip.GetContent(request); if ((Object)(object)content == (Object)null) { ManualLogSource? log2 = _log; if (log2 != null) { log2.LogError((object)("Decoded AudioClip was null for '" + oggPath + "'.")); } yield break; } if ((int)content.loadState == 0) { content.LoadAudioData(); } ((Object)content).name = audioKey; AudioByKey[audioKey] = content; RegisterAllAudioInManager(); ManualLogSource? log3 = _log; if (log3 != null) { log3.LogInfo((object)$"Loaded OGG audio '{audioKey}' ({content.length:F2}s)."); } } finally { ((IDisposable)request)?.Dispose(); } } private static Dictionary<string, string> BuildBundleAssetLookup(AssetBundle bundle) { Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); string[] allAssetNames = bundle.GetAllAssetNames(); foreach (string text in allAssetNames) { dictionary[text] = text; } return dictionary; } private static T? LoadAssetCaseInsensitive<T>(AssetBundle bundle, Dictionary<string, string> lookup, string requestedPath) where T : Object { string value; string text = (lookup.TryGetValue(requestedPath, out value) ? value : requestedPath); return bundle.LoadAsset<T>(text); } private static void ResolveReflectionFields() { Type? typeFromHandle = typeof(AudioManager); _loadedAudioClipsField = AccessTools.Field(typeFromHandle, "loadedAudioClips"); _loadedAudioClipsDmcaFreeField = AccessTools.Field(typeFromHandle, "loadedAudioClipsDmcaFree"); _audioClipsDictDmcaField = AccessTools.Field(typeFromHandle, "audioClipsDictDmca"); _audioClipsDictDmcaFreeField = AccessTools.Field(typeFromHandle, "audioClipsDictDmcaFree"); _complementaryEmotesDefaultField = AccessTools.Field(typeof(EmotesManager), "complementaryEmotesDefault"); } } [HarmonyPatch] internal static class MegaEmotePatches { [HarmonyPatch(typeof(EmotesManager), "BuildEmotesList")] [HarmonyPostfix] private static void AfterBuildEmotesList() { MegaEmoteLoader.ApplyMetadataToEmotes(); } [HarmonyPatch(typeof(AudioManager), "ClearAudioClipCache")] [HarmonyPostfix] private static void AfterClearAudioClipCache() { MegaEmoteLoader.RegisterAllAudioInManager(); } [HarmonyPatch(typeof(AudioManager), "LoadAudioClip")] [HarmonyPrefix] private static bool PrefixLoadAudioClip(string clipName, ref AudioClip? __result) { if (!MegaEmoteLoader.TryGetAudioClip(clipName, out AudioClip clip) || (Object)(object)clip == (Object)null) { return true; } __result = clip; return false; } [HarmonyPatch(typeof(AudioManager), "AudioExists")] [HarmonyPrefix] private static bool PrefixAudioExists(string audioName, ref bool __result) { if (!MegaEmoteLoader.HasAudioClip(audioName)) { return true; } __result = true; return false; } [HarmonyPatch(typeof(EmoteMenu), "InitializeUI")] [HarmonyPostfix] private static void AfterInitializeUI() { MegaEmoteLoader.EnsureCustomLoadoutTabRegistered(); } [HarmonyPatch(typeof(EmoteMenu), "OpenEmoteMenu")] [HarmonyPrefix] private static void BeforeOpenEmoteMenu() { MegaEmoteLoader.EnsureCustomLoadoutTabRegistered(); MegaEmoteLoader.RefreshPackTabEmotes(); } [HarmonyPatch(typeof(EmoteController), "TranslateAnimation")] [HarmonyPrefix] private static void BeforeTranslateAnimation(EmoteController __instance) { VmdEmotePlayer.OnBeforeTranslateAnimation(__instance); } [HarmonyPatch(typeof(EmoteController), "PerformEmote")] [HarmonyPrefix] private static void BeforePerformEmote(EmoteController __instance, UnlockableEmote emote) { VmdEmotePlayer.OnBeforePerformEmote(__instance, emote); } [HarmonyPatch(typeof(EmoteController), "SyncWithEmoteController")] [HarmonyPrefix] private static void BeforeSyncWithEmoteController(EmoteController __instance, EmoteController emoteController) { VmdEmotePlayer.OnBeforeSyncWithEmoteController(__instance, emoteController); } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPrefix] private static bool BeforeGetCurrentAnimationTime(EmoteController __instance, ref float __result) { return VmdEmotePlayer.OnGetCurrentAnimationTime(__instance, ref __result); } } internal readonly record struct MegaEmoteDef(string Key, string DisplayName, string AnimBundle, string PrimaryAnimPath, string? LoopAnimPath, string AudioBundle, string? PrimaryAudioPath, string? LoopAudioPath, bool CanMove, bool IsBaseOverlap); internal readonly record struct VmdEmoteDef(string Key, string DisplayName, string MotionFile, string? AudioFile, bool CanMove, bool IsBaseOverlap); internal sealed class VmdClipData { internal readonly int BoneCount; internal readonly int FrameCount; internal readonly float Fps; internal readonly float Duration; internal readonly HumanBodyBones[] BoneIds; internal readonly float[] HipsPos; internal readonly short[] BoneQuats; internal VmdClipData(int boneCount, int frameCount, float fps, float duration, HumanBodyBones[] boneIds, float[] hipsPos, short[] boneQuats) { BoneCount = boneCount; FrameCount = frameCount; Fps = fps; Duration = duration; BoneIds = boneIds; HipsPos = hipsPos; BoneQuats = boneQuats; } } internal static class VmdEmotePlayer { private sealed class VmdPlaybackClock { internal float StartTime; } private sealed class SkeletonCalibration { internal bool[] HasBone = new bool[55]; internal Quaternion[] RestWorldRot = (Quaternion[])(object)new Quaternion[55]; internal Quaternion[] InvRestParentWorldRot = (Quaternion[])(object)new Quaternion[55]; internal Vector3 HipsRestRootPos; internal Vector3 CharRightLocal = Vector3.right; internal Vector3 CharUpLocal = Vector3.up; internal Vector3 CharForwardLocal = Vector3.forward; internal float MmdToRootScale = 0.08f; } private const int BoneSlotCount = 55; private static readonly Dictionary<string, VmdClipData> ClipsByEmoteKey = new Dictionary<string, VmdClipData>(StringComparer.Ordinal); private static readonly ConditionalWeakTable<EmoteController, Transform?[]> ControllerBoneCache = new ConditionalWeakTable<EmoteController, Transform[]>(); private static readonly ConditionalWeakTable<EmoteController, VmdPlaybackClock> ControllerClocks = new ConditionalWeakTable<EmoteController, VmdPlaybackClock>(); private static readonly Quaternion[] FrameQuats = (Quaternion[])(object)new Quaternion[55]; private static SkeletonCalibration? _calibration; private static bool _calibrationAttempted; private static ManualLogSource? _log; internal static void SetLogger(ManualLogSource log) { _log = log; } internal static void RegisterClip(string emoteKey, VmdClipData data) { ClipsByEmoteKey[emoteKey] = data; } internal static VmdClipData? LoadVmdBinary(string path) { try { using FileStream stream = File.OpenRead(path); using GZipStream input = new GZipStream(stream, CompressionMode.Decompress); using BinaryReader binaryReader = new BinaryReader(input, Encoding.ASCII, leaveOpen: false); byte[] array = binaryReader.ReadBytes(4); if (array.Length != 4 || array[0] != 86 || array[1] != 77 || array[2] != 68 || array[3] != 66) { ManualLogSource? log = _log; if (log != null) { log.LogError((object)("Invalid VMDB magic header in '" + path + "'.")); } return null; } ushort num = binaryReader.ReadUInt16(); if (num != 1) { ManualLogSource? log2 = _log; if (log2 != null) { log2.LogError((object)$"Unsupported VMDB version {num} in '{path}'."); } return null; } ushort num2 = binaryReader.ReadUInt16(); int num3 = (int)binaryReader.ReadUInt32(); float num4 = binaryReader.ReadSingle(); if (num2 == 0 || num3 <= 0 || num4 <= 0f) { ManualLogSource? log3 = _log; if (log3 != null) { log3.LogError((object)$"Corrupt VMDB metadata in '{path}' (bones={num2}, frames={num3}, fps={num4})."); } return null; } HumanBodyBones[] array2 = (HumanBodyBones[])(object)new HumanBodyBones[num2]; for (int i = 0; i < num2; i++) { array2[i] = (HumanBodyBones)binaryReader.ReadInt32(); } float[] array3 = new float[num3 * 3]; short[] array4 = new short[num3 * num2 * 4]; int num5 = num2 * 4; for (int j = 0; j < num3; j++) { int num6 = j * 3; array3[num6] = binaryReader.ReadSingle(); array3[num6 + 1] = binaryReader.ReadSingle(); array3[num6 + 2] = binaryReader.ReadSingle(); int num7 = j * num5; for (int k = 0; k < num5; k++) { array4[num7 + k] = binaryReader.ReadInt16(); } } float duration = ((num3 > 1) ? ((float)(num3 - 1) / num4) : (1f / num4)); return new VmdClipData(num2, num3, num4, duration, array2, array3, array4); } catch (Exception arg) { ManualLogSource? log4 = _log; if (log4 != null) { log4.LogError((object)$"Failed to read VMDB file '{path}': {arg}"); } return null; } } private static VmdPlaybackClock GetOrCreateClock(EmoteController controller) { if (ControllerClocks.TryGetValue(controller, out VmdPlaybackClock value)) { return value; } value = new VmdPlaybackClock { StartTime = Time.time }; ControllerClocks.Add(controller, value); return value; } internal static void OnBeforePerformEmote(EmoteController? controller, UnlockableEmote? emote) { if (!((Object)(object)controller == (Object)null) && emote != null && !string.IsNullOrEmpty(emote.emoteName) && ClipsByEmoteKey.ContainsKey(emote.emoteName)) { GetOrCreateClock(controller).StartTime = Time.time; } } internal static void OnBeforeSyncWithEmoteController(EmoteController? controller, EmoteController? target) { if (!((Object)(object)controller == (Object)null) && !((Object)(object)target == (Object)null) && target.performingEmote != null && !string.IsNullOrEmpty(target.performingEmote.emoteName) && ClipsByEmoteKey.ContainsKey(target.performingEmote.emoteName)) { GetOrCreateClock(controller).StartTime = GetOrCreateClock(target).StartTime; } } internal static bool OnGetCurrentAnimationTime(EmoteController? controller, ref float result) { if ((Object)(object)controller == (Object)null || !controller.isPerformingEmote || controller.performingEmote == null || string.IsNullOrEmpty(controller.performingEmote.emoteName)) { return true; } if (!ClipsByEmoteKey.TryGetValue(controller.performingEmote.emoteName, out VmdClipData value)) { return true; } float num = Mathf.Max(0f, Time.time - GetOrCreateClock(controller).StartTime); result = ((value.Duration > 0f) ? (num % value.Duration) : 0f); return false; } internal static void OnBeforeTranslateAnimation(EmoteController? controller) { if (!((Object)(object)controller == (Object)null) && controller.initialized && controller.isPerformingEmote) { UnlockableEmote performingEmote = controller.performingEmote; if (performingEmote != null && !string.IsNullOrEmpty(performingEmote.emoteName) && ClipsByEmoteKey.TryGetValue(performingEmote.emoteName, out VmdClipData value)) { ApplyFrameToController(controller, value); } } } private static void ApplyFrameToController(EmoteController controller, VmdClipData data) { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)controller.humanoidSkeleton == (Object)null || (Object)(object)controller.animator == (Object)null) { return; } SkeletonCalibration skeletonCalibration = EnsureCalibration(); if (skeletonCalibration == null) { return; } Transform[] orCreateBoneArray = GetOrCreateBoneArray(controller, data); if (orCreateBoneArray == null) { return; } float num = Mathf.Max(0f, Time.time - GetOrCreateClock(controller).StartTime); float num2 = Mathf.Clamp(((data.Duration > 0f) ? (num % data.Duration) : 0f) * data.Fps, 0f, (float)(data.FrameCount - 1)); int num3 = Mathf.Min((int)num2, data.FrameCount - 1); int num4 = Mathf.Min(num3 + 1, data.FrameCount - 1); float num5 = num2 - (float)num3; for (int i = 0; i < 55; i++) { FrameQuats[i] = Quaternion.identity; } int num6 = data.BoneCount * 4; int num7 = num3 * num6; int num8 = num4 * num6; Quaternion val = default(Quaternion); Quaternion val2 = default(Quaternion); for (int j = 0; j < data.BoneCount; j++) { int num9 = (int)data.BoneIds[j]; if ((uint)num9 < 55u) { int num10 = num7 + j * 4; int num11 = num8 + j * 4; ((Quaternion)(ref val))..ctor((float)data.BoneQuats[num10] * 3.051851E-05f, (float)data.BoneQuats[num10 + 1] * 3.051851E-05f, (float)data.BoneQuats[num10 + 2] * 3.051851E-05f, (float)data.BoneQuats[num10 + 3] * 3.051851E-05f); ((Quaternion)(ref val2))..ctor((float)data.BoneQuats[num11] * 3.051851E-05f, (float)data.BoneQuats[num11 + 1] * 3.051851E-05f, (float)data.BoneQuats[num11 + 2] * 3.051851E-05f, (float)data.BoneQuats[num11 + 3] * 3.051851E-05f); FrameQuats[num9] = ((num5 > 0f) ? Quaternion.Slerp(val, val2, num5) : val); } } ComposeMissingBone(skeletonCalibration, (HumanBodyBones)54, (HumanBodyBones)8); ComposeMissingBone(skeletonCalibration, (HumanBodyBones)9, (HumanBodyBones)10); ComposeMissingBone(skeletonCalibration, (HumanBodyBones)11, (HumanBodyBones)13); ComposeMissingBone(skeletonCalibration, (HumanBodyBones)12, (HumanBodyBones)14); ComposeMissingDistalFingers(skeletonCalibration); int num12 = num3 * 3; int num13 = num4 * 3; Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(Mathf.Lerp(data.HipsPos[num12], data.HipsPos[num13], num5), Mathf.Lerp(data.HipsPos[num12 + 1], data.HipsPos[num13 + 1], num5), Mathf.Lerp(data.HipsPos[num12 + 2], data.HipsPos[num13 + 2], num5)); Transform val4 = orCreateBoneArray[0]; if ((Object)(object)val4 != (Object)null) { Vector3 val5 = skeletonCalibration.HipsRestRootPos + (skeletonCalibration.CharRightLocal * val3.x + skeletonCalibration.CharUpLocal * val3.y + skeletonCalibration.CharForwardLocal * val3.z) * skeletonCalibration.MmdToRootScale; val4.position = controller.humanoidSkeleton.TransformPoint(val5); } for (int k = 0; k < data.BoneCount; k++) { int num14 = (int)data.BoneIds[k]; if ((uint)num14 < 55u && skeletonCalibration.HasBone[num14]) { Transform val6 = orCreateBoneArray[num14]; if (!((Object)(object)val6 == (Object)null)) { val6.localRotation = skeletonCalibration.InvRestParentWorldRot[num14] * FrameQuats[num14] * skeletonCalibration.RestWorldRot[num14]; } } } } private static void ComposeMissingBone(SkeletonCalibration cal, HumanBodyBones missing, HumanBodyBones parentOrChild) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Expected I4, but got Unknown //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Expected I4, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) int num = (int)missing; int num2 = (int)parentOrChild; if (!cal.HasBone[num] && cal.HasBone[num2]) { FrameQuats[num2] = (((int)missing == 54) ? (FrameQuats[num2] * FrameQuats[num]) : (FrameQuats[num] * FrameQuats[num2])); } } private static void ComposeMissingDistalFingers(SkeletonCalibration cal) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) ReadOnlySpan<int> readOnlySpan = stackalloc int[10] { 26, 29, 32, 35, 38, 41, 44, 47, 50, 53 }; for (int i = 0; i < readOnlySpan.Length; i++) { int num = readOnlySpan[i]; int num2 = num - 1; if (!cal.HasBone[num] && cal.HasBone[num2]) { FrameQuats[num2] *= FrameQuats[num]; } } } private static Transform?[]? GetOrCreateBoneArray(EmoteController controller, VmdClipData data) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected I4, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (ControllerBoneCache.TryGetValue(controller, out Transform[] value)) { return value; } Animator animator = controller.animator; if ((Object)(object)animator == (Object)null || !animator.isHuman) { return null; } Transform[] array = (Transform[])(object)new Transform[55]; for (int i = 0; i < data.BoneCount; i++) { HumanBodyBones val = data.BoneIds[i]; int num = (int)val; if ((uint)num < 55u) { array[num] = animator.GetBoneTransform(val); } } ControllerBoneCache.Add(controller, array); return array; } private static SkeletonCalibration? EnsureCalibration() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) if (_calibration != null) { return _calibration; } if (_calibrationAttempted) { return null; } _calibrationAttempted = true; if ((Object)(object)Plugin.humanoidSkeletonPrefab == (Object)null) { ManualLogSource? log = _log; if (log != null) { log.LogError((object)"TooManyEmotes.Plugin.humanoidSkeletonPrefab is null; cannot calibrate VMD skeleton."); } return null; } GameObject val = null; try { val = Object.Instantiate<GameObject>(Plugin.humanoidSkeletonPrefab); val.transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity); val.transform.localScale = Vector3.one; Animator componentInChildren = val.GetComponentInChildren<Animator>(true); if ((Object)(object)componentInChildren == (Object)null || !componentInChildren.isHuman) { ManualLogSource? log2 = _log; if (log2 != null) { log2.LogError((object)"Cloned humanoidSkeletonPrefab lacks a Humanoid Animator."); } return null; } ((Behaviour)componentInChildren).enabled = false; Transform[] array = (Transform[])(object)new Transform[55]; for (int i = 0; i < 55; i++) { array[i] = componentInChildren.GetBoneTransform((HumanBodyBones)i); } Transform val2 = array[0]; Transform val3 = array[13]; Transform val4 = array[14]; Transform val5 = array[5]; Transform val6 = array[6]; if ((Object)(object)val2 == (Object)null) { ManualLogSource? log3 = _log; if (log3 != null) { log3.LogError((object)"Humanoid skeleton prefab is missing Hips bone."); } return null; } Vector3 val7 = (((Object)(object)val3 != (Object)null && (Object)(object)val4 != (Object)null) ? Vector3.ProjectOnPlane(val4.position - val3.position, Vector3.up) : Vector3.right); if (((Vector3)(ref val7)).sqrMagnitude < 1E-06f) { val7 = Vector3.right; } ((Vector3)(ref val7)).Normalize(); Vector3 up = Vector3.up; Vector3 val8 = Vector3.Cross(val7, up); Vector3 normalized = ((Vector3)(ref val8)).normalized; Quaternion val9 = Quaternion.Inverse(Quaternion.LookRotation(normalized, up)); AlignBone(array[13], array[15], -val7); AlignBone(array[15], array[17], -val7); AlignFingerChain(array, (HumanBodyBones)27, -val7); AlignFingerChain(array, (HumanBodyBones)30, -val7); AlignFingerChain(array, (HumanBodyBones)33, -val7); AlignFingerChain(array, (HumanBodyBones)36, -val7); AlignBone(array[14], array[16], val7); AlignBone(array[16], array[18], val7); AlignFingerChain(array, (HumanBodyBones)42, val7); AlignFingerChain(array, (HumanBodyBones)45, val7); AlignFingerChain(array, (HumanBodyBones)48, val7); AlignFingerChain(array, (HumanBodyBones)51, val7); AlignBone(array[1], array[3], Vector3.down); AlignBone(array[3], array[5], Vector3.down); AlignBone(array[2], array[4], Vector3.down); AlignBone(array[4], array[6], Vector3.down); SkeletonCalibration obj = new SkeletonCalibration { HipsRestRootPos = val.transform.InverseTransformPoint(val2.position) }; val8 = val.transform.InverseTransformDirection(val7); obj.CharRightLocal = ((Vector3)(ref val8)).normalized; val8 = val.transform.InverseTransformDirection(up); obj.CharUpLocal = ((Vector3)(ref val8)).normalized; val8 = val.transform.InverseTransformDirection(normalized); obj.CharForwardLocal = ((Vector3)(ref val8)).normalized; SkeletonCalibration skeletonCalibration = obj; if ((Object)(object)val5 != (Object)null && (Object)(object)val6 != (Object)null) { float num = Mathf.Min(val.transform.InverseTransformPoint(val5.position).y, val.transform.InverseTransformPoint(val6.position).y); float num2 = Mathf.Max(0.1f, skeletonCalibration.HipsRestRootPos.y - num); skeletonCalibration.MmdToRootScale = num2 / 10.5f; } for (int j = 0; j < 55; j++) { Transform val10 = array[j]; if (!((Object)(object)val10 == (Object)null)) { skeletonCalibration.HasBone[j] = true; skeletonCalibration.RestWorldRot[j] = val9 * val10.rotation; Quaternion val11 = (((Object)(object)val10.parent != (Object)null) ? (val9 * val10.parent.rotation) : Quaternion.identity); skeletonCalibration.InvRestParentWorldRot[j] = Quaternion.Inverse(val11); } } _calibration = skeletonCalibration; return _calibration; } catch (Exception arg) { ManualLogSource? log4 = _log; if (log4 != null) { log4.LogError((object)$"Error calibrating humanoid skeleton for VMD playback: {arg}"); } return null; } finally { if ((Object)(object)val != (Object)null) { val.SetActive(false); Object.Destroy((Object)(object)val); } } } private static void AlignBone(Transform? bone, Transform? child, Vector3 targetDir) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bone == (Object)null || (Object)(object)child == (Object)null) { return; } Vector3 val = child.position - bone.position; if (!(((Vector3)(ref val)).sqrMagnitude < 1E-08f)) { Vector3 normalized = ((Vector3)(ref val)).normalized; if (Vector3.Angle(normalized, targetDir) > 0.5f) { bone.rotation = Quaternion.FromToRotation(normalized, targetDir) * bone.rotation; } } } private static void AlignFingerChain(Transform?[] bones, HumanBodyBones proximal, Vector3 targetDir) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Expected I4, but got Unknown //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) int num = (int)proximal; AlignBone(bones[num], bones[num + 1], targetDir); AlignBone(bones[num + 1], bones[num + 2], targetDir); } } } namespace System.Runtime.CompilerServices { internal static class IsExternalInit { } } namespace MegaEmotes_KpopAndAnime { internal static class GeneratedCatalog { internal const string TabDisplayName = "<color=#FF77CC>K-Pop & Anime</color>"; internal static readonly string[] BundleFiles = new string[5] { "bbing_motion", "broiiler_anim", "broiiler_audio", "randomlyripped_funstuff", "angeldance" }; internal static readonly MegaEmoteDef[] All = new MegaEmoteDef[77] { new MegaEmoteDef("mkp_bts_mic_drop", "BTS - MIC Drop", "bbing_motion", "assets/d-001.anim", null, "bbing_motion", "assets/m-001.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_g_idle_oh_my_gods", "(G)Idle - Oh My Gods", "bbing_motion", "assets/d-002.anim", null, "bbing_motion", "assets/m-002.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_kda_the_baddest", "KDA - The Baddest", "bbing_motion", "assets/d-003.anim", null, "bbing_motion", "assets/m-003.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_blackpink_howyoulikethat", "Blackpink - HowYouLikeThat", "bbing_motion", "assets/d-004.anim", null, "bbing_motion", "assets/m-004.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_meme_tokatoka", "Meme - TokaToka", "bbing_motion", "assets/d-005.anim", null, "bbing_motion", "assets/m-005.wav", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_meme_knockknock", "Meme - KnockKnock", "bbing_motion", "assets/d-006.anim", null, "bbing_motion", "assets/m-006.wav", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_pubg_roll_n_rock", "PUBG - Roll n Rock", "bbing_motion", "assets/d-007.anim", null, "bbing_motion", "assets/m-007.wav", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_meme_dreams_come_true", "Meme - Dreams Come True", "bbing_motion", "assets/d-008.anim", null, "bbing_motion", "assets/m-008.wav", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_pubg_the_magic_bomb", "PUBG - The Magic Bomb", "bbing_motion", "assets/d-009.anim", null, "bbing_motion", "assets/m-009.wav", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_meme_sad_cat_dance", "Meme - Sad Cat Dance", "bbing_motion", "assets/d-010.anim", null, "bbing_motion", "assets/m-010.wav", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_lesserafim_fearless", "LESSERAFIM - Fearless", "bbing_motion", "assets/d-011.anim", null, "bbing_motion", "assets/m-011.wav", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_bts_dna", "BTS - DNA", "bbing_motion", "assets/d-012.anim", null, "bbing_motion", "assets/m-012.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_itzy_wannabe", "ITZY - Wannabe", "bbing_motion", "assets/d-013.anim", null, "bbing_motion", "assets/m-013.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_twice_likey", "TWICE - LIKEY", "bbing_motion", "assets/d-014.anim", null, "bbing_motion", "assets/m-014.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_blackpink_lovesickgirls", "Blackpink - LoveSickGirls", "bbing_motion", "assets/d-015.anim", null, "bbing_motion", "assets/m-015.wav", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_kda_pop_star", "KDA - POP Star", "bbing_motion", "assets/d-016.anim", null, "bbing_motion", "assets/m-016.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_everglow_ladida", "Everglow - Ladida", "bbing_motion", "assets/d-017.anim", null, "bbing_motion", "assets/m-017.wav", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_everglow_adios", "Everglow - Adios", "bbing_motion", "assets/d-018.anim", null, "bbing_motion", "assets/m-018.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_blackpink_playing_with_fire", "Blackpink - Playing with Fire", "bbing_motion", "assets/d-019.anim", null, "bbing_motion", "assets/m-019.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_blankpink_aiiyl", "Blankpink - AIIYL", "bbing_motion", "assets/d-020.anim", null, "bbing_motion", "assets/m-020.wav", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_mamamoo_hip", "MAMAMOO - HIP", "bbing_motion", "assets/d-021.anim", null, "bbing_motion", "assets/m-021.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_somi_birthday", "SOMI - Birthday", "bbing_motion", "assets/d-022.anim", null, "bbing_motion", "assets/m-022.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_miku_alien_alien", "Miku - Alien Alien", "bbing_motion", "assets/d-023.anim", null, "bbing_motion", "assets/m-023.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_miku_hibana", "Miku - Hibana", "bbing_motion", "assets/d-024.anim", null, "bbing_motion", "assets/m-024.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_momoland_baam", "Momoland - BAAM", "bbing_motion", "assets/d-025.anim", null, "bbing_motion", "assets/m-025.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_t_ara_no9", "T.ARA - No9", "bbing_motion", "assets/d-026.anim", null, "bbing_motion", "assets/m-026.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_twice_fancy", "TWICE - FANCY", "bbing_motion", "assets/d-027.anim", null, "bbing_motion", "assets/m-027.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_bts_on", "BTS - ON", "bbing_motion", "assets/d-028.anim", null, "bbing_motion", "assets/m-028.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_bts_not_today", "BTS - Not Today", "bbing_motion", "assets/d-029.anim", null, "bbing_motion", "assets/m-029.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_twice_more_more", "TWICE - More & More", "bbing_motion", "assets/d-030.anim", null, "bbing_motion", "assets/m-030.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_chungha_stay_tonight", "ChungHa - Stay Tonight", "bbing_motion", "assets/d-031.anim", null, "bbing_motion", "assets/m-031.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_everglow_dun_dun", "Everglow - Dun Dun", "bbing_motion", "assets/d-032.anim", null, "bbing_motion", "assets/m-032.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_bts_bloodsweat_tears", "BTS - BloodSweat & Tears", "bbing_motion", "assets/d-033.anim", null, "bbing_motion", "assets/m-033.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_somi_whatyouwaiting", "SOMI - WhatYouWaiting", "bbing_motion", "assets/d-034.anim", null, "bbing_motion", "assets/m-034.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_kara_step", "KARA - Step", "bbing_motion", "assets/d-035.anim", null, "bbing_motion", "assets/m-035.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_gmod_default_dance", "GMOD Default Dance", "broiiler_anim", "assets/gmod default dance.anim", null, "broiiler_audio", "assets/gmodad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_9mm_go_bang", "9mm go Bang", "broiiler_anim", "assets/assets/9mma.anim", null, "broiiler_audio", "assets/assets/9mmab.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_jjk_lost_in_paradise", "JJK Lost in Paradise", "broiiler_anim", "assets/assets/jjked1a.anim", null, "broiiler_audio", "assets/assets/jjked.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_whip_nae_nae", "Whip & Nae Nae", "broiiler_anim", "assets/assets/naenaea.anim", null, "broiiler_audio", "assets/assets/naenaecutaudio.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_hit_or_miss", "Hit or Miss", "broiiler_anim", "assets/assets/hitormissa.anim", null, "broiiler_audio", "assets/assets/hit or miss.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_bring_it_back", "Bring it Back", "broiiler_anim", "assets/assets/bringitbacka.anim", null, "broiiler_audio", "assets/assets/bringitbackad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_crank_that_soulja_boy", "Crank that Soulja Boy", "broiiler_anim", "assets/assets/crankthata.anim", null, "broiiler_audio", "assets/assets/crankthatad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_2_phut_hon", "2 Phut Hon", "broiiler_anim", "assets/assets/phuthona.anim", null, "broiiler_audio", "assets/assets/phuthonad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_car_shearer", "Car Shearer", "broiiler_anim", "assets/assets/carshearera.anim", null, "broiiler_audio", "assets/assets/carshearerad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_everybody_do_the_flop", "Everybody do the flop", "broiiler_anim", "assets/assets/theflopa.anim", null, "broiiler_audio", "assets/assets/flopad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_dame_tu_cosita", "Dame tu Cosita", "broiiler_anim", "assets/assets/dame/dametucosita.anim", null, "broiiler_audio", "assets/assets/dame/dametucosita_audio.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_bla_bla_bla_dance", "bla bla bla dance", "broiiler_anim", "assets/blabla/blablaani.anim", null, "broiiler_audio", "assets/blabla/bla bla bla.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_caramel_dansen_broiiler", "Caramel Dansen (broiiler)", "broiiler_anim", "assets/carameldansen2/carameldansennewani.anim", null, "broiiler_audio", "assets/carameldansen2/audiotest2.ogg", null, CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mkp_livsey_walk_broiiler", "Livsey Walk (broiiler)", "broiiler_anim", "assets/assets/livesywalka.anim", null, "broiiler_audio", "assets/assets/dr. livesey.ogg", null, CanMove: true, IsBaseOverlap: true), new MegaEmoteDef("mkp_gentlemen", "Gentlemen", "broiiler_anim", "assets/gentlemen/gentlemenani.anim", null, "broiiler_audio", "assets/gentlemen/gentlemenad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_jojo_poses", "JOJO Poses", "broiiler_anim", "assets/jojo poses/jojoposes.anim", null, "broiiler_audio", "assets/jojo poses/jojoposes.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_jojo_eyes_of_heaven", "JOJO Eyes of Heaven", "broiiler_anim", "assets/eyes of heaven/eyesofheaven.anim", null, "broiiler_audio", "assets/eyes of heaven/eyesofheavenwomen.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_hakari_dance", "Hakari Dance", "broiiler_anim", "assets/hakari dance/hakaridance.anim", null, "broiiler_audio", "assets/hakari dance/hakariad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_last_suprise_persona_5", "Last Suprise Persona 5", "broiiler_anim", "assets/last suprise/lastsuprise.anim", null, "broiiler_audio", "assets/last suprise/lastsuprisead.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_world_is_mine", "World is Mine", "broiiler_anim", "assets/world is mine/worldismine.anim", null, "broiiler_audio", "assets/world is mine/worldismine.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_montagem_pr_funk", "Montagem PR Funk", "broiiler_anim", "assets/montagem pr funk - motion/montagem pr funk.anim", null, "broiiler_audio", "assets/montagem pr funk - motion/montag.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_moves_like_jagger", "Moves like Jagger", "broiiler_anim", "assets/moveslikejagger/moveslikejaggera.anim", null, "broiiler_audio", "assets/moveslikejagger/moveslikejaggerad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_wednesday_dance", "Wednesday Dance", "broiiler_anim", "assets/wednes day/wednesdaydancea.anim", null, "broiiler_audio", "assets/wednes day/wednesdayfix2.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_fansa_honeyworks", "Fansa Honeyworks", "broiiler_anim", "assets/fansa/fansa.anim", null, "broiiler_audio", "assets/fansa/fansa.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_kawaikute_gomen", "Kawaikute Gomen", "broiiler_anim", "assets/kawaikute/kawaikute gomen.anim", null, "broiiler_audio", "assets/kawaikute/kawaikutead.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_chitty_chitty_bang_bang", "Chitty Chitty Bang Bang", "broiiler_anim", "assets/chitty chitty bang bang/chittychittybangbanga.anim", null, "broiiler_audio", "assets/chitty chitty bang bang/chittychittybangbangad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_bumblebee", "Bumblebee", "broiiler_anim", "assets/bumblebee/bumblebeea.anim", null, "broiiler_audio", "assets/bumblebee/bumblebeeadfix.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_slowmotion", "Slowmotion", "broiiler_anim", "assets/slowmotion/slowmotiona.anim", null, "broiiler_audio", "assets/slowmotion/slowmotionadnameless.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_ganbare_ganbare_senpai", "Ganbare! Ganbare! Senpai", "broiiler_anim", "assets/ganbare/ganbareganbarea.anim", null, "broiiler_audio", "assets/ganbare/ganbareadfix.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_chipi_chipi_chapa_chapa", "CHIPI CHIPI CHAPA CHAPA", "broiiler_anim", "assets/chippychappa/chippychappa.anim", null, "broiiler_audio", "assets/chippychappa/chipi chipi chapa chapa cat.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_snow_princess_nakiri_ayame", "Snow Princess Nakiri Ayame", "broiiler_anim", "assets/snowprincess/snowprincess.anim", null, "broiiler_audio", "assets/snowprincess/snowprincess.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_subject_3_dance", "Subject 3 Dance", "broiiler_anim", "assets/subject 3/subject3.anim", null, "broiiler_audio", "assets/subject 3/prayge.mp3", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_bling_bang_bang_born", "Bling-Bang-Bang-Born", "broiiler_anim", "assets/bling bang bang born/testbing.anim", null, "broiiler_audio", "assets/bling bang bang born/blingbangbornad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_bubble_butt_dance", "Bubble Butt Dance", "broiiler_anim", "assets/bubblebutt dance/bubblebutt.anim", null, "broiiler_audio", "assets/bubblebutt dance/bubblebuttad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_pimp_named_slickback", "Pimp named Slickback", "broiiler_anim", "assets/slickback/slickback.anim", null, "broiiler_audio", "assets/slickback/pimpslick.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_i_just_wanna_dance", "I just Wanna Dance", "broiiler_anim", "assets/justwannadance/ijustwannadance.anim", null, "broiiler_audio", "assets/justwannadance/ijustwannadancead.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_kuru_kuru_kuru", "KURU KURU KURU", "broiiler_anim", "assets/kuruin/kuru.anim", null, "broiiler_audio", "assets/kuruin/kuru.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_supershy", "Supershy", "broiiler_anim", "assets/supershy/supershynew.anim", null, "broiiler_audio", "assets/supershy/new jeans super shy.wav", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_waltz", "Waltz", "broiiler_anim", "assets/waltz/followerani.anim", null, "broiiler_audio", "assets/waltz/waltzad.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_arona_dance", "Arona Dance", "randomlyripped_funstuff", "assets/arona dance.anim", null, "randomlyripped_funstuff", "assets/aronahd.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mkp_robot_waifu_stroll", "Robot Waifu Stroll", "randomlyripped_funstuff", "assets/walky.anim", null, "randomlyripped_funstuff", "assets/metallurgy.ogg", null, CanMove: true, IsBaseOverlap: false), new MegaEmoteDef("mkp_angel_dance", "Angel Dance", "angeldance", "assets/angeldance/bundlecontent/angeldance_loop.anim", null, "angeldance", "assets/angeldance/bundlecontent/angeldance_music.ogg", null, CanMove: false, IsBaseOverlap: false) }; internal static readonly VmdEmoteDef[] VmdEmotes = new VmdEmoteDef[2] { new VmdEmoteDef("mkp_kda_firestarter", "K/DA - Firestarter", "mkp_kda_firestarter.vmdb", "mkp_kda_firestarter.ogg", CanMove: false, IsBaseOverlap: false), new VmdEmoteDef("mkp_heartsteel_paranoia", "HEARTSTEEL - PARANOIA", "mkp_heartsteel_paranoia.vmdb", "mkp_heartsteel_paranoia.ogg", CanMove: false, IsBaseOverlap: false) }; } [BepInPlugin("MegaEmotes.KpopAndAnime", "MegaEmotes_KpopAndAnime", "1.0.4")] [BepInDependency(/*Could not decode attribute arguments.*/)] public sealed class Plugin : BaseUnityPlugin { public const string PluginGuid = "MegaEmotes.KpopAndAnime"; public const string PluginName = "MegaEmotes_KpopAndAnime"; public const string PluginVersion = "1.0.4"; private Harmony? _harmony; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown MegaEmoteConfig.Bind(((BaseUnityPlugin)this).Config); _harmony = new Harmony("MegaEmotes.KpopAndAnime"); _harmony.PatchAll(typeof(MegaEmotePatches)); MegaEmoteLoader.Initialize(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location) ?? Paths.PluginPath, "<color=#FF77CC>K-Pop & Anime</color>", GeneratedCatalog.BundleFiles, GeneratedCatalog.All, GeneratedCatalog.VmdEmotes, (MonoBehaviour)(object)this, ((BaseUnityPlugin)this).Logger); } } }