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 FortniteAndViral v1.0.1
BepInEx/plugins/MegaEmotes_FortniteAndViral/MegaEmotes_FortniteAndViral.dll
Decompiled 15 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 ILLIT Magnetic, Idol, Apple, Splatoon songs, PUBG/TikTok viral dances, and Fortnite emotes natively to TooManyEmotes with full audio and a dedicated Fortnite & Viral wheel tab.")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1")] [assembly: AssemblyProduct("MegaEmotes_FortniteAndViral")] [assembly: AssemblyTitle("MegaEmotes_FortniteAndViral")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.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_FortniteAndViral { internal static class GeneratedCatalog { internal const string TabDisplayName = "<color=#FFAA44>Fortnite & Viral</color>"; internal static readonly string[] BundleFiles = new string[4] { "mystic_anims", "mystic_audio", "dacne_dance", "nekiyman_emotes" }; internal static readonly MegaEmoteDef[] All = new MegaEmoteDef[109] { new MegaEmoteDef("mfv_she_wolf", "She Wolf", "dacne_dance", "assets/shewolf.anim", null, "dacne_dance", "assets/shewolfsound.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_brooklyn_blood_pop_1_dacne", "Brooklyn Blood Pop 1 (Dacne)", "dacne_dance", "assets/brooklynbloodpop1.anim", null, "dacne_dance", "assets/brooklynbloodpop.ogg", null, CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_brooklyn_blood_pop_2_dacne", "Brooklyn Blood Pop 2 (Dacne)", "dacne_dance", "assets/brooklynbloodpop2.anim", null, "dacne_dance", "assets/brooklynbloodpop.ogg", null, CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_cute_oui_dance_trend_1", "Cute Oui Dance Trend 1", "dacne_dance", "assets/cute oui dance trend 1.anim", null, "dacne_dance", "assets/cute oui dance trend.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_cute_oui_dance_trend_2", "Cute Oui Dance Trend 2", "dacne_dance", "assets/cute oui dance trend 2.anim", null, "dacne_dance", "assets/cute oui dance trend.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_baby_you_challenge", "baby you challenge", "dacne_dance", "assets/baby you challenge.anim", null, "dacne_dance", "assets/baby you challenge.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_bubblepop", "bubblepop", "dacne_dance", "assets/bubblepop.anim", null, "dacne_dance", "assets/bubblepop.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_cure_for_me_challenge", "cure for me challenge", "dacne_dance", "assets/cure for me challenge.anim", null, "dacne_dance", "assets/cure for me challenge.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_kiss_me_more", "Kiss Me More", "dacne_dance", "assets/kiss me more.anim", null, "dacne_dance", "assets/kiss me more.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_no_way_dacne", "No way (Dacne)", "dacne_dance", "assets/no way.anim", null, "dacne_dance", "assets/no way.ogg", null, CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_qing_hai_yao", "qing hai yao", "dacne_dance", "assets/qing hai yao.anim", null, "dacne_dance", "assets/qing hai yao.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_xinbaodao_zhong", "xinbaodao(zhong)", "dacne_dance", "assets/xinbaodao zhong.anim", null, "dacne_dance", "assets/xinbaodao.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_xinbaodao_zuo", "xinbaodao(zuo)", "dacne_dance", "assets/xinbaodao zuo.anim", null, "dacne_dance", "assets/xinbaodao.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_xinbaodao_zuozuo", "xinbaodao(zuozuo)", "dacne_dance", "assets/xinbaodao zuozuo.anim", null, "dacne_dance", "assets/xinbaodao.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_xinbaodao_you", "xinbaodao(you)", "dacne_dance", "assets/xinbaodao you.anim", null, "dacne_dance", "assets/xinbaodao.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_xinbaodao_hou", "xinbaodao(hou)", "dacne_dance", "assets/xinbaodao hou.anim", null, "dacne_dance", "assets/xinbaodao.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_xinbaodao_youyou", "xinbaodao(youyou)", "dacne_dance", "assets/xinbaodao youyou.anim", null, "dacne_dance", "assets/xinbaodao.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_all_my_people", "all my people", "dacne_dance", "assets/all my people.anim", null, "dacne_dance", "assets/all my people.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_instant21", "Instant21", "dacne_dance", "assets/instant21.anim", null, "dacne_dance", "assets/instant21.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_lightthefireupinthenight_p3dmn", "LightTheFireUpInTheNight(P3DMN)", "dacne_dance", "assets/p3dmn_lightthefireupinthenight.anim", null, "dacne_dance", "assets/p3dmn_lightthefireupinthenight.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_bboombboom_pubg", "BBoomBBoom(PUBG)", "dacne_dance", "assets/pubg_bboombboom.anim", null, "dacne_dance", "assets/pubg_bboombboom.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_poppy_pubg", "Poppy(PUBG)", "dacne_dance", "assets/pubg_poppy.anim", null, "dacne_dance", "assets/pubg_poppy.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_samsara_pubg", "Samsara(PUBG)", "dacne_dance", "assets/pubg_samsara.anim", null, "dacne_dance", "assets/pubg_samsara.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_pubg_victorydance61", "PUBG_VictoryDance61", "dacne_dance", "assets/pubg_victorydance61.anim", null, "dacne_dance", "assets/pubg_victorydance61.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_pubg_victorydance85", "PUBG_VictoryDance85", "dacne_dance", "assets/pubg_victorydance85.anim", null, "dacne_dance", "assets/pubg_victorydance85.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_pubg_victorydance102", "PUBG_VictoryDance102", "dacne_dance", "assets/pubg_victorydance102.anim", null, "dacne_dance", "assets/pubg_victorydance102.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_ievan_polkka", "Ievan Polkka", "mystic_anims", "assets/custom animation folder/other/ievanpolkka/ievanpolkka.anim", null, "mystic_audio", "assets/custom animation folder/other/ievanpolkka/ievanpolkka.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_idol", "Idol", "mystic_anims", "assets/custom animation folder/other/idol/idol.anim", null, "mystic_audio", "assets/custom animation folder/other/idol/idol.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_run_it_down_mystic", "Run it Down (Mystic)", "mystic_anims", "assets/custom animation folder/fortnite/runitdown/runitdown.anim", null, "mystic_audio", "assets/custom animation folder/fortnite/runitdown/runitdown.ogg", null, CanMove: true, IsBaseOverlap: true), new MegaEmoteDef("mfv_magnetic", "Magnetic", "mystic_anims", "assets/custom animation folder/fortnite/magnetic/illitintro.anim", "assets/custom animation folder/fortnite/magnetic/illitloop.anim", "mystic_audio", "assets/custom animation folder/fortnite/magnetic/illitintro.ogg", "assets/custom animation folder/fortnite/magnetic/illitloop.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_apple", "Apple", "mystic_anims", "assets/custom animation folder/fortnite/apple/appleintro.anim", "assets/custom animation folder/fortnite/apple/appleloop.anim", "mystic_audio", "assets/custom animation folder/fortnite/apple/appleintro.ogg", "assets/custom animation folder/fortnite/apple/appleloop.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_the_viper", "The Viper", "mystic_anims", "assets/custom animation folder/fortnite/viper/viperintro.anim", "assets/custom animation folder/fortnite/viper/viperloop.anim", "mystic_audio", "assets/custom animation folder/fortnite/viper/viperintro.ogg", "assets/custom animation folder/fortnite/viper/viperloop.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_popular_vibe_mystic", "Popular Vibe (Mystic)", "mystic_anims", "assets/custom animation folder/fortnite/popularvibe/popularvibe.anim", null, "mystic_audio", "assets/custom animation folder/fortnite/popularvibe/popularvibe.ogg", null, CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_groove_jam_mystic", "Groove Jam (Mystic)", "mystic_anims", "assets/custom animation folder/fortnite/groovejam/groovejam.anim", null, "mystic_audio", "assets/custom animation folder/fortnite/groovejam/groovejam.ogg", null, CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_dream_feet_mystic", "Dream Feet (Mystic)", "mystic_anims", "assets/custom animation folder/fortnite/dreamfeet/dreamfeet.anim", null, "mystic_audio", "assets/custom animation folder/fortnite/dreamfeet/dreamfeet.ogg", null, CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_laid_back_shuffle_mystic", "Laid Back Shuffle (Mystic)", "mystic_anims", "assets/custom animation folder/fortnite/laidbackshuffle/laidbackshuffle.anim", null, "mystic_audio", "assets/custom animation folder/fortnite/laidbackshuffle/laidbackshuffle.ogg", null, CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_jaywalking", "Jaywalking", "mystic_anims", "assets/custom animation folder/fortnite/jaywalking/jaywalking.anim", null, "mystic_audio", "assets/custom animation folder/fortnite/jaywalking/jaywalking.ogg", null, CanMove: true, IsBaseOverlap: false), new MegaEmoteDef("mfv_bring_it_around_mystic", "Bring it Around (Mystic)", "mystic_anims", "assets/custom animation folder/fortnite/bringitaround/bringitaround.anim", null, "mystic_audio", "assets/custom animation folder/fortnite/bringitaround/bringitaround.ogg", null, CanMove: true, IsBaseOverlap: true), new MegaEmoteDef("mfv_bomb_rush_blush", "Bomb Rush Blush", "mystic_anims", "assets/custom animation folder/splatoon/bombrushblush/aoriintro.anim", "assets/custom animation folder/splatoon/bombrushblush/aorisong.anim", "mystic_audio", "assets/custom animation folder/splatoon/bombrushblush/aoriintro.ogg", "assets/custom animation folder/splatoon/bombrushblush/aorisong.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_calamari_inkantation", "Calamari Inkantation", "mystic_anims", "assets/custom animation folder/splatoon/calamariinkantation/shiokaraintro.anim", "assets/custom animation folder/splatoon/calamariinkantation/shiokara.anim", "mystic_audio", "assets/custom animation folder/splatoon/calamariinkantation/shiokaraintro.ogg", "assets/custom animation folder/splatoon/calamariinkantation/shiokara.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_city_of_color", "City of Color", "mystic_anims", "assets/custom animation folder/splatoon/cityofcolor/fesintro.anim", "assets/custom animation folder/splatoon/cityofcolor/fes.anim", "mystic_audio", "assets/custom animation folder/splatoon/cityofcolor/fesintro.ogg", "assets/custom animation folder/splatoon/cityofcolor/fes.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_maritime_memory", "Maritime Memory", "mystic_anims", "assets/custom animation folder/splatoon/maritimememory/maritime.anim", null, "mystic_audio", "assets/custom animation folder/splatoon/maritimememory/maritime.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_ink_me_up", "Ink me Up", "mystic_anims", "assets/custom animation folder/splatoon/inkmeup/kimiirointro.anim", "assets/custom animation folder/splatoon/inkmeup/kimiiro.anim", "mystic_audio", "assets/custom animation folder/splatoon/inkmeup/kimiirointro.ogg", "assets/custom animation folder/splatoon/inkmeup/kimiiro.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_now_or_never", "Now or Never!", "mystic_anims", "assets/custom animation folder/splatoon/nowornever/imanuraintro.anim", "assets/custom animation folder/splatoon/nowornever/imanura.anim", "mystic_audio", "assets/custom animation folder/splatoon/nowornever/imanuraintro.ogg", "assets/custom animation folder/splatoon/nowornever/imanura.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_tide_goes_out", "Tide Goes Out", "mystic_anims", "assets/custom animation folder/splatoon/tidegoesout/hotaruintro.anim", "assets/custom animation folder/splatoon/tidegoesout/hotarusong.anim", "mystic_audio", "assets/custom animation folder/splatoon/tidegoesout/hotaruintro.ogg", "assets/custom animation folder/splatoon/tidegoesout/hotarusong.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_color_pulse", "Color Pulse", "mystic_anims", "assets/custom animation folder/splatoon/colorpulse/squarefesintro.anim", "assets/custom animation folder/splatoon/colorpulse/squarefesloop.anim", "mystic_audio", "assets/custom animation folder/splatoon/colorpulse/squarefesintro.ogg", "assets/custom animation folder/splatoon/colorpulse/squarefesloop.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_paptabek", "Paptabek", "nekiyman_emotes", "assets/paptabek.anim", null, "nekiyman_emotes", "assets/paptamusic.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_take_on_me", "Take On Me", "nekiyman_emotes", "assets/take_on_me.anim", null, "nekiyman_emotes", "assets/takeonme.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_boogie_down_nekiy", "Boogie Down (Nekiy)", "nekiyman_emotes", "assets/boogiedown.anim", "assets/boogiedown_loop.anim", "nekiyman_emotes", "assets/boogiedown.ogg", null, CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_out_west", "Out West", "nekiyman_emotes", "assets/outwest.anim", null, "nekiyman_emotes", "assets/outwest.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_renegade_nekiy", "Renegade (Nekiy)", "nekiyman_emotes", "assets/renegade.anim", null, "nekiyman_emotes", "assets/renegade.ogg", null, CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_it_s_vibe", "It's Vibe", "nekiyman_emotes", "assets/vibe.anim", null, "nekiyman_emotes", "assets/vibe.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_skibidi_pa_pa_pa", "Skibidi Pa Pa Pa", "nekiyman_emotes", "assets/skibidipapa.anim", null, "nekiyman_emotes", "assets/skibidipapa.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_gigabyte", "GigaByte", "nekiyman_emotes", "assets/gigabyte.anim", null, "nekiyman_emotes", "assets/gigabyte.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_drill_dance", "Drill Dance", "nekiyman_emotes", "assets/drilldance.anim", "assets/drilldance_loop.anim", "nekiyman_emotes", "assets/drilldance.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_astro_dance_new", "Astro Dance New", "nekiyman_emotes", "assets/astralslide.anim", "assets/astralslide_loop.anim", "nekiyman_emotes", "assets/astralslide_intro.ogg", "assets/astralslide_loop.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_hide_away", "Hide Away", "nekiyman_emotes", "assets/hideaway.anim", null, "nekiyman_emotes", "assets/hideaway.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_bully_maguire", "Bully Maguire", "nekiyman_emotes", "assets/bullymaguire.anim", null, "nekiyman_emotes", "assets/bullymaguire.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_ashley_look_at_me", "Ashley Look At Me", "nekiyman_emotes", "assets/ashlelookatme.anim", null, "nekiyman_emotes", "assets/ashlelookatme.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_it_s_been_so_long", "It's Been So Long", "nekiyman_emotes", "assets/itsbeensolong.anim", "assets/itsbeensolong_loop.anim", "nekiyman_emotes", "assets/itsbeensolong.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_pineapple_syrup", "Pineapple syrup", "nekiyman_emotes", "assets/ananas.anim", null, "nekiyman_emotes", "assets/ananas.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_nominalo", "Nominalo", "nekiyman_emotes", "assets/nominalo.anim", null, "nekiyman_emotes", "assets/nominalo.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_danca_funk", "DANCA FUNK", "nekiyman_emotes", "assets/dancafunk.anim", null, "nekiyman_emotes", "assets/dancafunk.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_rammstein_sonne", "Rammstein Sonne", "nekiyman_emotes", "assets/rammstein.anim", null, "nekiyman_emotes", "assets/rammstein.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_give_me_everything", "Give Me Everything", "nekiyman_emotes", "assets/kvinka.anim", "assets/kvinka_loop.anim", "nekiyman_emotes", "assets/kvinka.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_heads_will_roll", "Heads Will Roll", "nekiyman_emotes", "assets/willroll.anim", "assets/willroll_loop.anim", "nekiyman_emotes", "assets/willroll.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_beggin", "Beggin", "nekiyman_emotes", "assets/beggin.anim", "assets/beggin_loop.anim", "nekiyman_emotes", "assets/beggin.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_evil_plan_nekiy", "Evil Plan (Nekiy)", "nekiyman_emotes", "assets/evilplan.anim", "assets/evilplan_loop.anim", "nekiyman_emotes", "assets/evilplan_intro.ogg", "assets/evilplan_loop.ogg", CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_t_ar", "T$ar", "nekiyman_emotes", "assets/tsar.anim", null, "nekiyman_emotes", "assets/tsar.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_some_cut", "Some Cut", "nekiyman_emotes", "assets/somecut.anim", null, "nekiyman_emotes", "assets/somecut_intro.ogg", "assets/somecut_loop.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_in_da_party_nekiy", "In Da Party (Nekiy)", "nekiyman_emotes", "assets/ageto.anim", null, "nekiyman_emotes", "assets/ageto.ogg", null, CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_dancin", "Dancin", "nekiyman_emotes", "assets/dancin.anim", null, "nekiyman_emotes", "assets/dancin_intro.ogg", "assets/dancin_loop.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_omfg_hello", "OMFG Hello", "nekiyman_emotes", "assets/omfghello.anim", null, "nekiyman_emotes", "assets/omfghello.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_donyagon", "Donyagon", "nekiyman_emotes", "assets/donyagon.anim", null, "nekiyman_emotes", "assets/donyagon.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_cowbell_goth", "COWBELL GOTH", "nekiyman_emotes", "assets/goth.anim", null, "nekiyman_emotes", "assets/goth.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_one_dance", "One Dance", "nekiyman_emotes", "assets/onedance.anim", null, "nekiyman_emotes", "assets/onedance.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_maroon", "Maroon", "nekiyman_emotes", "assets/maroon.anim", null, "nekiyman_emotes", "assets/maroon.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_just_wanna_rock", "Just Wanna Rock", "nekiyman_emotes", "assets/wannarock.anim", null, "nekiyman_emotes", "assets/wannarock.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_k_r_u_s_h_f_u_n_k", "K R U S H F U N K", "nekiyman_emotes", "assets/krushfunk.anim", null, "nekiyman_emotes", "assets/krushfunk.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_ebanko", "EBANKO", "nekiyman_emotes", "assets/ebanko.anim", null, "nekiyman_emotes", "assets/ebanko.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_on_the_floor", "On The Floor", "nekiyman_emotes", "assets/onthefloor.anim", null, "nekiyman_emotes", "assets/onthefloor.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_ee_nado_ebat", "Ee nado Ebat", "nekiyman_emotes", "assets/aebat_intro.anim", "assets/aebat_loop.anim", "nekiyman_emotes", "assets/aebat_intro.ogg", "assets/aebat_loop.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_baixo", "Baixo", "nekiyman_emotes", "assets/baixo_intro.anim", "assets/baixo_loop.anim", "nekiyman_emotes", "assets/baixo.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_what_it_s_love", "What It's Love", "nekiyman_emotes", "assets/whatislove.anim", null, "nekiyman_emotes", "assets/whatislove.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_ya_tebya_oteby", "Ya Tebya Oteby", "nekiyman_emotes", "assets/yatebyaoteby.anim", null, "nekiyman_emotes", "assets/yatebyaoteby.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_skibidi_toilet", "Skibidi Toilet", "nekiyman_emotes", "assets/skibiditoilet.anim", null, "nekiyman_emotes", "assets/skibiditoilet.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_freetato", "FREETATO", "nekiyman_emotes", "assets/freetato.anim", null, "nekiyman_emotes", "assets/freetato.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_me_and_the_bird", "Me And The Bird", "nekiyman_emotes", "assets/meandthebird.anim", null, "nekiyman_emotes", "assets/meandthebird.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_all_my_fellas", "All My Fellas", "nekiyman_emotes", "assets/allmyfellas.anim", null, "nekiyman_emotes", "assets/allmyfellas.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_me_gusta_to", "Me Gusta To", "nekiyman_emotes", "assets/megustato.anim", null, "nekiyman_emotes", "assets/megustato.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_faina", "Faina", "nekiyman_emotes", "assets/faina.anim", null, "nekiyman_emotes", "assets/faina.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_kidnesspunk_nekiy", "KidNessPunk (Nekiy)", "nekiyman_emotes", "assets/kidnesspunk.anim", null, "nekiyman_emotes", "assets/kidnesspunk_intro.ogg", "assets/kidnesspunk_loop.ogg", CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_assumptions_nekiy", "Assumptions (Nekiy)", "nekiyman_emotes", "assets/assumptions.anim", null, "nekiyman_emotes", "assets/assumptions.ogg", null, CanMove: false, IsBaseOverlap: true), new MegaEmoteDef("mfv_springtrap_death", "Springtrap Death", "nekiyman_emotes", "assets/springtrapdeath.anim", null, "nekiyman_emotes", "assets/springtrapdeath.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_black_bakardi", "Black Bakardi", "nekiyman_emotes", "assets/blackbakardi.anim", null, "nekiyman_emotes", "assets/blackbakardi.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_drunk_groove", "Drunk Groove", "nekiyman_emotes", "assets/drunkgroove.anim", null, "nekiyman_emotes", "assets/drunkgroove.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_just_dance", "Just Dance", "nekiyman_emotes", "assets/justdance.anim", null, "nekiyman_emotes", "assets/justdance.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_malinovya_lada", "Malinovya Lada", "nekiyman_emotes", "assets/malinovyalada.anim", null, "nekiyman_emotes", "assets/malinovyalada.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_normal_guy_2", "Normal Guy 2", "nekiyman_emotes", "assets/normalguy2.anim", null, "nekiyman_emotes", "assets/normalguy2.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_navalny_leha", "Navalny Leha", "nekiyman_emotes", "assets/navalny.anim", null, "nekiyman_emotes", "assets/navalny.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_cotton_eye_joe", "Cotton Eye Joe", "nekiyman_emotes", "assets/cottoneyejoe.anim", null, "nekiyman_emotes", "assets/cottoneyejoe.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_dodge_this", "DODGE THIS", "nekiyman_emotes", "assets/dodgethis.anim", "assets/dodgethis_loop.anim", "nekiyman_emotes", "assets/dodgethis.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_vacok", "Vacok", "nekiyman_emotes", "assets/vacok.anim", "assets/vacok_loop.anim", "nekiyman_emotes", "assets/vacok.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_zahotel", "Zahotel", "nekiyman_emotes", "assets/zahotel.anim", "assets/zahotel_loop.anim", "nekiyman_emotes", "assets/zahotel.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_head_bangs", "Head Bangs", "nekiyman_emotes", "assets/headbang.anim", "assets/headbang_loop.anim", "nekiyman_emotes", "assets/headbang_intro.ogg", "assets/headbang_loop.ogg", CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_lezginka_new", "Lezginka New", "nekiyman_emotes", "assets/lezginka.anim", null, "nekiyman_emotes", "assets/lezginkadance.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_funked_up", "Funked Up", "nekiyman_emotes", "assets/funkedup.anim", "assets/funkedup_loop.anim", "nekiyman_emotes", "assets/funkedup.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_para_blyater", "Para blyater", "nekiyman_emotes", "assets/parablyater.anim", null, "nekiyman_emotes", "assets/parablyater.ogg", null, CanMove: false, IsBaseOverlap: false), new MegaEmoteDef("mfv_baldwin", "BaldWin", "nekiyman_emotes", "assets/baldwin.anim", "assets/baldwin_loop.anim", "nekiyman_emotes", "assets/baldwin.ogg", null, CanMove: false, IsBaseOverlap: false) }; internal static readonly VmdEmoteDef[] VmdEmotes = Array.Empty<VmdEmoteDef>(); } [BepInPlugin("MegaEmotes.FortniteAndViral", "MegaEmotes_FortniteAndViral", "1.0.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public sealed class Plugin : BaseUnityPlugin { public const string PluginGuid = "MegaEmotes.FortniteAndViral"; public const string PluginName = "MegaEmotes_FortniteAndViral"; public const string PluginVersion = "1.0.1"; 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.FortniteAndViral"); _harmony.PatchAll(typeof(MegaEmotePatches)); MegaEmoteLoader.Initialize(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location) ?? Paths.PluginPath, "<color=#FFAA44>Fortnite & Viral</color>", GeneratedCatalog.BundleFiles, GeneratedCatalog.All, GeneratedCatalog.VmdEmotes, (MonoBehaviour)(object)this, ((BaseUnityPlugin)this).Logger); } } }