using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; 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 System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using Grimoire.Models; using Grimoire.Services; using Grimoire.UI; using Grimoire.Utilities; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.Attributes; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections; using Il2CppSystem.Collections.Generic; using Il2CppSystem.Reflection; using Microsoft.CodeAnalysis; using ProjectM; using ProjectM.Hybrid; using ProjectM.Network; using ProjectM.UI; using Stunlock.Core; using TMPro; using Unity.Collections; using Unity.Entities; using Unity.Mathematics; using Unity.Rendering; using Unity.Transforms; using UnityEngine; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("Grimoire")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.42.185.0")] [assembly: AssemblyInformationalVersion("2.42.185")] [assembly: AssemblyProduct("Grimoire")] [assembly: AssemblyTitle("Grimoire")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.42.185.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 Grimoire { [BepInPlugin("io.grimoire", "Grimoire", "2.42.185")] internal sealed class Plugin : BasePlugin { internal static ManualLogSource LogSource = null; internal static Harmony Harmony = null; internal static ConfigEntry ToggleKey = null; internal static ConfigEntry CombatHudToggleKey = null; internal static ConfigEntry LauncherToggleKey = null; internal static ConfigEntry DpsToggleKey = null; internal static ConfigEntry LauncherVisible = null; internal static ConfigEntry HudEnabled = null; internal static ConfigEntry AutoCollapseHud = null; internal static ConfigEntry ClosedRefreshSeconds = null; internal static ConfigEntry OpenRefreshSeconds = null; internal static ConfigEntry HudScale = null; internal static ConfigEntry HudOpacity = null; internal static ConfigEntry HudX = null; internal static ConfigEntry HudY = null; internal static ConfigEntry LauncherX = null; internal static ConfigEntry LauncherY = null; internal static ConfigEntry GrimoireWindowX = null; internal static ConfigEntry GrimoireWindowY = null; internal static ConfigEntry VoidfallWindowX = null; internal static ConfigEntry VoidfallWindowY = null; internal static ConfigEntry PerkShopWindowX = null; internal static ConfigEntry PerkShopWindowY = null; internal static ConfigEntry InvitePopupX = null; internal static ConfigEntry InvitePopupY = null; internal static ConfigEntry ReadyPopupX = null; internal static ConfigEntry ReadyPopupY = null; internal static ConfigEntry TrialPopupX = null; internal static ConfigEntry TrialPopupY = null; internal static ConfigEntry DpsX = null; internal static ConfigEntry DpsY = null; internal static ConfigEntry PartyDpsX = null; internal static ConfigEntry PartyDpsY = null; internal static ConfigEntry ReducedMotion = null; internal static ConfigEntry HighContrast = null; internal static ConfigEntry LargeText = null; internal static ConfigEntry ShowNameplateTitles = null; internal static ConfigEntry ShowOverheadWorldTitles = null; internal static ConfigEntry ShowLocalNameplateTitle = null; internal static ConfigEntry ShowTargetPanelTitles = null; internal static ConfigEntry NameplateTitleColor = null; internal static ConfigEntry UseTitleCategoryColors = null; internal static ConfigEntry EnableTitleGlow = null; internal static ConfigEntry GoldTitleGlow = null; internal static ConfigEntry HeirOfTheFallenGlow = null; internal static ConfigEntry HeirOfTheFallenPulse = null; internal static ConfigEntry TitleGlowIntensity = null; internal static ConfigEntry TitleGlowScale = null; internal static ConfigEntry EnableVoidfallVisuals = null; internal static ConfigEntry HideVoidfallTravelPrompt = null; internal static ConfigEntry VoidfallGlowIntensity = null; internal static ConfigEntry VoidfallEffectRadius = null; internal static ConfigEntry WeaponAuraScale = null; internal static ConfigEntry WeaponAuraRightOffset = null; internal static ConfigEntry WeaponAuraUpOffset = null; internal static ConfigEntry WeaponAuraForwardOffset = null; internal static ConfigEntry MaskProfileGameVersion = null; internal static ConfigEntry WeaponAuraVoidColor = null; internal static ConfigEntry WeaponAuraBodyColor = null; internal static ConfigEntry WeaponAuraEmissionIntensity = null; internal static ConfigEntry WeaponAuraDiagnostics = null; internal static ConfigEntry WeaponAuraCertifications = null; private static GameObject? _host; private static GrimoireUiHost? _ui; private static VoidfallUiHost? _voidfallUi; private static PerkShopUiHost? _perkShopUi; private static ActivityPopupUiHost? _activityPopups; private static DamageMeterUiHost? _damageMeterUi; private static string _lastWeaponAuraError = ""; private static int _lastUiTickFrame = -1; private bool _loaded; internal static bool IsUiOpen { get { if ((Object)(object)_ui != (Object)null) { return _ui.IsOpen; } return false; } } internal static bool IsPointerOverLauncherStrip => _ui?.IsPointerOverLauncherStrip ?? false; internal static bool IsVoidfallTextInputFocused => _voidfallUi?.IsTextInputFocused ?? false; internal static bool IsPointerOverUiPanel { get { if ((!((Object)(object)_ui != (Object)null) || !_ui.IsPointerOverPanel) && (!((Object)(object)_voidfallUi != (Object)null) || !_voidfallUi.IsPointerOverPanel) && (!((Object)(object)_perkShopUi != (Object)null) || !_perkShopUi.IsPointerOverPanel)) { if ((Object)(object)_damageMeterUi != (Object)null) { return _damageMeterUi.IsPointerOverPanel; } return false; } return true; } } public override void Load() { //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_090d: Unknown result type (might be due to invalid IL or missing references) //IL_0917: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Invalid comparison between Unknown and I4 //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) LogSource = ((BasePlugin)this).Log; if (Application.productName == "VRisingServer") { return; } MigrateLegacyConfig(); ToggleKey = ((BasePlugin)this).Config.Bind("Interface", "ToggleKey", (KeyCode)288, "Key used to open or close Grimoire."); CombatHudToggleKey = ((BasePlugin)this).Config.Bind("Interface", "CombatHudToggleKey", (KeyCode)289, "Legacy combat-HUD shortcut setting; the Combat HUD button remains available, while F8 now toggles the launcher strip."); LauncherToggleKey = ((BasePlugin)this).Config.Bind("Interface", "LauncherToggleKey", (KeyCode)289, "Key used to hide or show the entire Grimoire, Combat HUD, and Voidfall launcher strip."); DpsToggleKey = ((BasePlugin)this).Config.Bind("Interface", "DpsToggleKey", (KeyCode)290, "Show or hide the personal DPS meter."); LauncherVisible = ((BasePlugin)this).Config.Bind("Interface", "LauncherVisible", true, "Whether the unified three-button launcher strip is visible in the world."); if (ToggleKey.Value == LauncherToggleKey.Value) { ToggleKey.Value = (KeyCode)(((int)LauncherToggleKey.Value == 288) ? 287 : 288); ManualLogSource logSource = LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(80, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Grimoire panel shortcut moved to "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ToggleKey.Value); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" so "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(LauncherToggleKey.Value); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" can exclusively toggle the launcher strip."); } logSource.LogInfo(val); } HudEnabled = ((BasePlugin)this).Config.Bind("Interface", "HudEnabled", true, "Show the compact equipped-relic HUD."); AutoCollapseHud = ((BasePlugin)this).Config.Bind("Interface", "AutoCollapseHud", true, "Collapse the combat HUD while no relic event, cooldown, or proc activity is present."); ClosedRefreshSeconds = ((BasePlugin)this).Config.Bind("Bridge", "ClosedRefreshSecondsV2", 10f, "Idle refresh interval while the panel is closed, clamped to 5–20 seconds. An active relic HUD refreshes at least every 5 seconds; opening the panel or taking an action refreshes promptly."); OpenRefreshSeconds = ((BasePlugin)this).Config.Bind("Bridge", "OpenRefreshSeconds", 2f, "State refresh interval while the panel is open."); HudScale = ((BasePlugin)this).Config.Bind("Appearance", "HudScale", 1f, "Combat HUD scale from 0.7 to 1.4."); HudOpacity = ((BasePlugin)this).Config.Bind("Appearance", "HudOpacity", 0.9f, "Combat HUD background opacity from 0.25 to 1.0."); HudX = ((BasePlugin)this).Config.Bind("Appearance", "HudX", 24f, "Combat HUD horizontal position at 1920x1080 reference resolution."); HudY = ((BasePlugin)this).Config.Bind("Appearance", "HudY", -70f, "Combat HUD vertical position at 1920x1080 reference resolution."); LauncherX = ((BasePlugin)this).Config.Bind("Appearance", "LauncherX", 24f, "Unified launcher-strip horizontal position at 1920x1080 reference resolution. Drag its grip to move it."); LauncherY = ((BasePlugin)this).Config.Bind("Appearance", "LauncherY", -24f, "Unified launcher-strip vertical position at 1920x1080 reference resolution. Drag its grip to move it."); GrimoireWindowX = ((BasePlugin)this).Config.Bind("Appearance", "GrimoireWindowX", 0f, "Grimoire menu horizontal offset from screen center; drag its header grip to move it."); GrimoireWindowY = ((BasePlugin)this).Config.Bind("Appearance", "GrimoireWindowY", 0f, "Grimoire menu vertical offset from screen center."); VoidfallWindowX = ((BasePlugin)this).Config.Bind("Appearance", "VoidfallWindowX", 0f, "Voidfall menu horizontal offset from screen center; drag its header grip to move it."); VoidfallWindowY = ((BasePlugin)this).Config.Bind("Appearance", "VoidfallWindowY", 0f, "Voidfall menu vertical offset from screen center."); PerkShopWindowX = ((BasePlugin)this).Config.Bind("Appearance", "PerkShopWindowX", 0f, "PerkShop menu horizontal offset from screen center; drag its header grip to move it."); PerkShopWindowY = ((BasePlugin)this).Config.Bind("Appearance", "PerkShopWindowY", 0f, "PerkShop menu vertical offset from screen center."); InvitePopupX = ((BasePlugin)this).Config.Bind("Appearance", "InvitePopupX", 550f, "Abyss party invite popup horizontal offset; drag its three-dot grip to move it."); InvitePopupY = ((BasePlugin)this).Config.Bind("Appearance", "InvitePopupY", 250f, "Abyss party invite popup vertical offset."); ReadyPopupX = ((BasePlugin)this).Config.Bind("Appearance", "ReadyPopupX", 550f, "Abyss ready-check popup horizontal offset; drag its three-dot grip to move it."); ReadyPopupY = ((BasePlugin)this).Config.Bind("Appearance", "ReadyPopupY", 15f, "Abyss ready-check popup vertical offset."); TrialPopupX = ((BasePlugin)this).Config.Bind("Appearance", "TrialPopupX", 550f, "Relic Trial popup horizontal offset; drag its three-dot grip to move it."); TrialPopupY = ((BasePlugin)this).Config.Bind("Appearance", "TrialPopupY", -245f, "Relic Trial popup vertical offset."); DpsX = ((BasePlugin)this).Config.Bind("Appearance", "DpsX", -24f, "Personal DPS meter horizontal offset from the upper right corner."); DpsY = ((BasePlugin)this).Config.Bind("Appearance", "DpsY", -165f, "Personal DPS meter vertical offset from the upper right corner."); PartyDpsX = ((BasePlugin)this).Config.Bind("Appearance", "PartyDpsX", -24f, "Abyss party DPS panel horizontal offset from the upper right corner."); PartyDpsY = ((BasePlugin)this).Config.Bind("Appearance", "PartyDpsY", -425f, "Abyss party DPS panel vertical offset from the upper right corner."); ReducedMotion = ((BasePlugin)this).Config.Bind("Accessibility", "ReducedMotion", false, "Disable pulsing Energy animation."); HighContrast = ((BasePlugin)this).Config.Bind("Accessibility", "HighContrast", false, "Use brighter high-contrast combat colors."); LargeText = ((BasePlugin)this).Config.Bind("Accessibility", "LargeText", false, "Increase combat HUD text size."); ShowNameplateTitles = ((BasePlugin)this).Config.Bind("Titles", "ShowNameplateTitles", true, "Show equipped Reliquary titles beneath online player names in the world."); ShowOverheadWorldTitles = ((BasePlugin)this).Config.Bind("Titles", "ShowOverheadWorldTitlesV3", true, "Show equipped Reliquary titles as independent overlays above vanilla player names. This does not patch or modify V Rising's name components."); ShowLocalNameplateTitle = ((BasePlugin)this).Config.Bind("Titles", "ShowLocalNameplateTitle", true, "Show your own equipped title when your local nameplate is visible."); ShowTargetPanelTitles = ((BasePlugin)this).Config.Bind("Titles", "ShowTargetHoverTitles", true, "Show equipped Reliquary titles beneath player names in the top target-hover panel."); NameplateTitleColor = ((BasePlugin)this).Config.Bind("Titles", "NameplateTitleColor", "D9B45B", "Six-digit RGB color used for overhead titles, without #."); UseTitleCategoryColors = ((BasePlugin)this).Config.Bind("Titles", "UseTitleCategoryColors", true, "Use the same achievement-category colors as the Hall of Titles; false uses NameplateTitleColor for every title."); EnableTitleGlow = ((BasePlugin)this).Config.Bind("TitleVisuals", "EnableTitleGlow", true, "Enable cached client-side glow layers for prestigious Reliquary titles."); GoldTitleGlow = ((BasePlugin)this).Config.Bind("TitleVisuals", "GoldTitleGlow", true, "Give Gold rarity titles a subtle static warm-gold aura."); HeirOfTheFallenGlow = ((BasePlugin)this).Config.Bind("TitleVisuals", "HeirOfTheFallenGlow", true, "Enable prestigious title glow for Heir of the Fallen and The Living Reliquary. The latter uses a distinct aurora-teal palette."); HeirOfTheFallenPulse = ((BasePlugin)this).Config.Bind("TitleVisuals", "HeirOfTheFallenPulse", true, "Use the same restrained slow pulse on prestigious title glows, including The Living Reliquary."); TitleGlowIntensity = ((BasePlugin)this).Config.Bind("TitleVisuals", "TitleGlowIntensity", 1f, "Glow opacity multiplier, clamped from 0 to 2."); TitleGlowScale = ((BasePlugin)this).Config.Bind("TitleVisuals", "TitleGlowScale", 1f, "Glow expansion multiplier, clamped from 0.5 to 1.5."); EnableVoidfallVisuals = ((BasePlugin)this).Config.Bind("Voidfall", "EnablePortalVisuals", true, "Render tracked purple Voidfall portal effects supplied by the server."); HideVoidfallTravelPrompt = ((BasePlugin)this).Config.Bind("Voidfall", "HideDraculaTravelPrompt", true, "Hide the Dracula travel prompt while near a tracked Voidfall portal."); VoidfallGlowIntensity = ((BasePlugin)this).Config.Bind("Voidfall", "PortalGlowIntensity", 2.2f, "Purple point-light intensity for tracked Voidfall portals."); VoidfallEffectRadius = ((BasePlugin)this).Config.Bind("Voidfall", "LocalEffectRadius", 85f, "Portal and enemy effects are dormant when the local player is farther than this many world units (30-150)."); WeaponAuraScale = ((BasePlugin)this).Config.Bind("VoidfallWeaponAura", "Scale", 1.35f, "Local weapon Aura scale, clamped from 0.6 to 2.5."); WeaponAuraDiagnostics = ((BasePlugin)this).Config.Bind("VoidfallWeaponAura", "VerboseDiagnostics", false, "Write detailed weapon-aura renderer and material audits. Enable only while troubleshooting; this can cause client stutter."); WeaponAuraRightOffset = ((BasePlugin)this).Config.Bind("VoidfallWeaponAura", "RightOffset", 0.12f, "Player-space right offset used when no exact weapon render transform is available."); WeaponAuraUpOffset = ((BasePlugin)this).Config.Bind("VoidfallWeaponAura", "UpOffset", 1.02f, "Player-space height used when no exact weapon render transform is available."); WeaponAuraForwardOffset = ((BasePlugin)this).Config.Bind("VoidfallWeaponAura", "ForwardOffset", 0.02f, "Player-space forward offset used when no exact weapon render transform is available."); MaskProfileGameVersion = ((BasePlugin)this).Config.Bind("VoidfallWeaponAura", "VerifiedAlphaMaskGameVersion", Application.version, "Game version associated with the manually verified MasterLit alpha profile. A game-version change disables alpha patching until revalidated."); VoidfallMaskAlphaService.Initialize(); WeaponAuraBodyColor = ((BasePlugin)this).Config.Bind("VoidfallWeaponAura", "PurpleBodyColor", "0.12,0.02,0.38", "Private material base RGB; native textures remain unchanged."); WeaponAuraVoidColor = ((BasePlugin)this).Config.Bind("VoidfallWeaponAura", "PurpleBodyEmissionColor", "0.175,0.0225,0.5625", "Normalized emission RGB for the detailed-purple profile; separate from the earlier emission-only experiment."); WeaponAuraEmissionIntensity = ((BasePlugin)this).Config.Bind("VoidfallWeaponAura", "PurpleBodyEmissionIntensity", 8f, "Surface HDR multiplier, clamped to 4–12. Default produces (1.4,0.18,4.5)."); WeaponAuraCertifications = ((BasePlugin)this).Config.Bind("VoidfallWeaponAura", "VisualCertifications", "Greatsword=.030;Reaper=.020;Spear=.015;Pistols=.010", "Player-confirmed class expansion values. Admin certification only; never inferred from readback."); WeaponAuraProfile.ValidateLegacyRegistry(); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); Harmony = new Harmony("io.grimoire"); Harmony.PatchAll(); CreateHost(); _loaded = true; ((BasePlugin)this).Log.LogInfo((object)"Grimoire 2.42.185 loaded. Master what you've claimed."); } private static void CreateHost() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown _host = new GameObject("Grimoire.Host"); Object.DontDestroyOnLoad((Object)(object)_host); _ui = _host.AddComponent(); _ui.Initialize(); _voidfallUi = _host.AddComponent(); _voidfallUi.Initialize(); _perkShopUi = _host.AddComponent(); _perkShopUi.Initialize(); _activityPopups = _host.AddComponent(); _activityPopups.Initialize(); _damageMeterUi = _host.AddComponent(); _damageMeterUi.Initialize(); } internal static void TickUi() { //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Expected O, but got Unknown //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Expected O, but got Unknown //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Expected O, but got Unknown //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Expected O, but got Unknown //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Expected O, but got Unknown int frameCount = Time.frameCount; if (_lastUiTickFrame == frameCount) { return; } _lastUiTickFrame = frameCount; bool flag = default(bool); try { if ((Object)(object)_host == (Object)null || (Object)(object)_ui == (Object)null || (Object)(object)_voidfallUi == (Object)null || (Object)(object)_perkShopUi == (Object)null || (Object)(object)_activityPopups == (Object)null || (Object)(object)_damageMeterUi == (Object)null) { try { _activityPopups?.Shutdown(); } catch { } try { _damageMeterUi?.Shutdown(); } catch { } try { _voidfallUi?.Shutdown(); } catch { } try { _perkShopUi?.Shutdown(); } catch { } try { _ui?.Shutdown(); } catch { } if ((Object)(object)_host != (Object)null) { Object.Destroy((Object)(object)_host); } _ui = null; _voidfallUi = null; _perkShopUi = null; _activityPopups = null; _damageMeterUi = null; _host = null; LogSource.LogInfo((object)"Grimoire host was removed during a scene transition; recreating it now."); CreateHost(); } _ui.Tick(); _voidfallUi?.Tick(); _perkShopUi?.Tick(); _activityPopups?.Tick(); _damageMeterUi?.Tick(); VoidfallKeyboardCaptureService.Tick(_voidfallUi?.IsTextInputFocused ?? false); } catch (Exception ex) { ManualLogSource logSource = LogSource; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("UI update failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logSource.LogError(val); } try { VoidfallVisualPerformanceService.Measure("titles", delegate { NameplateTitleService.Tick(); }, 16); } catch (Exception ex2) { ManualLogSource logSource2 = LogSource; BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(32, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Nameplate title update skipped: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex2.Message); } logSource2.LogDebug(val2); } try { VoidfallVisualPerformanceService.Measure("visual tick", VoidfallVisualService.Tick, 16); } catch (Exception ex3) { ManualLogSource logSource3 = LogSource; BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(32, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Voidfall visual update skipped: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex3.Message); } logSource3.LogDebug(val2); } try { VoidfallVisualPerformanceService.Measure("weapon aura local", VoidfallWeaponAuraService.Tick, 16); } catch (Exception ex4) { VoidfallWeaponAuraService.Clear(); string text = ex4.GetType().Name + ":" + ex4.Message; if (text != _lastWeaponAuraError) { _lastWeaponAuraError = text; ManualLogSource logSource4 = LogSource; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(29, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[WeaponAura Runtime Failure] "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex4); } logSource4.LogWarning(val3); } } try { VoidfallVisualPerformanceService.Measure("weapon aura remote", VoidfallRemoteWeaponAuraService.Tick, 16); } catch (Exception ex5) { VoidfallRemoteWeaponAuraService.Clear(); ManualLogSource logSource5 = LogSource; BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(44, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Voidfall remote weapon aura update skipped: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex5.Message); } logSource5.LogDebug(val2); } } internal static void ToggleVoidfall() { _voidfallUi?.ToggleWindow(); } internal static void TogglePerkShop() { _perkShopUi?.ToggleWindow(); } internal static void ToggleDps() { _damageMeterUi?.TogglePersonal(); } private void MigrateLegacyConfig() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown try { string text = Path.Combine(Paths.ConfigPath, "io.grimoire.cfg"); string text2 = Path.Combine(Paths.ConfigPath, "io.vrelics.ui.cfg"); if (!File.Exists(text) && File.Exists(text2)) { File.Copy(text2, text, overwrite: false); ((BasePlugin)this).Config.Reload(); LogSource.LogInfo((object)"Copied legacy VRelicsUI settings into Grimoire. The old config was left unchanged."); } } catch (Exception ex) { ManualLogSource logSource = LogSource; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(34, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Grimoire config migration failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogWarning(val); } } public override bool Unload() { if (!_loaded) { return true; } Harmony harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } CommandService.Reset(); RelicStateService.Reset(); NameplateTitleService.Reset(); VoidfallVisualService.Reset(); VoidfallMapIconService.Shutdown(); VoidfallWeaponAuraService.Shutdown(); VoidfallRemoteWeaponAuraService.Clear(); VoidfallMaskAlphaService.Shutdown(); VoidfallStateService.Reset(); DamageMeterService.Reset(); PerkShopStateService.Reset(); VoidfallKeyboardCaptureService.Release(); _voidfallUi?.Shutdown(); _perkShopUi?.Shutdown(); _activityPopups?.Shutdown(); _damageMeterUi?.Shutdown(); _ui?.Shutdown(); if ((Object)(object)_host != (Object)null) { Object.Destroy((Object)(object)_host); } _ui = null; _voidfallUi = null; _perkShopUi = null; _activityPopups = null; _damageMeterUi = null; _host = null; _lastUiTickFrame = -1; _loaded = false; return true; } } } namespace Grimoire.Utilities { internal static class EntityExtensions { internal static bool Has(this Entity e, EntityManager em) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (e != Entity.Null && ((EntityManager)(ref em)).Exists(e)) { return ((EntityManager)(ref em)).HasComponent(e); } return false; } internal static T Read(this Entity e, EntityManager em) where T : struct { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return ((EntityManager)(ref em)).GetComponentData(e); } } } namespace Grimoire.UI { internal sealed class ActivityPopupUiHost : MonoBehaviour { private sealed class PopupPanel { internal GameObject Root; internal GameObject Grip; internal GameObject Primary; internal GameObject Secondary; internal Text Body; internal Text PrimaryLabel; internal ConfigEntry X; internal ConfigEntry Y; internal bool Dragging; internal Vector2 LastPointer; } private Canvas? _canvas; private PopupPanel? _invitePanel; private PopupPanel? _readyPanel; private PopupPanel? _trialPanel; private readonly Queue<(AbyssInvitePopupUiState Invite, float Until)> _inviteQueue = new Queue<(AbyssInvitePopupUiState, float)>(); private readonly HashSet _seenInvites = new HashSet(StringComparer.Ordinal); private readonly HashSet _seenReady = new HashSet(StringComparer.Ordinal); private readonly HashSet _seenTrials = new HashSet(StringComparer.Ordinal); private AbyssInvitePopupUiState? _invite; private AbyssReadyPopupUiState? _ready; private string _trialKey = ""; private string _trialName = ""; private string _trialTargets = ""; private string _trialDeadline = ""; private string _lastTrialStatus = ""; private float _inviteUntil; private float _readyUntil; private float _readyRetryAt; private float _nextCountdown; private int _inviteRevisionAtReceive; private int _readyRevisionAtReceive; private long _trialSequenceAtStart; private bool _readyClicked; private bool _readyConfirmed; internal void Initialize() { Build(); VoidfallStateService.InvitePopupReceived += OnInvite; VoidfallStateService.ReadyPopupReceived += OnReady; VoidfallStateService.Changed += OnVoidfallChanged; RelicStateService.ActionMessageReceived += OnRelicAction; RelicStateService.Changed += OnRelicChanged; OnRelicChanged(); } internal void Shutdown() { VoidfallStateService.InvitePopupReceived -= OnInvite; VoidfallStateService.ReadyPopupReceived -= OnReady; VoidfallStateService.Changed -= OnVoidfallChanged; RelicStateService.ActionMessageReceived -= OnRelicAction; RelicStateService.Changed -= OnRelicChanged; _inviteQueue.Clear(); _seenInvites.Clear(); _seenReady.Clear(); _seenTrials.Clear(); if ((Object)(object)_canvas != (Object)null) { Object.Destroy((Object)(object)((Component)_canvas).gameObject); } _canvas = null; _invitePanel = (_readyPanel = (_trialPanel = null)); } internal void Tick() { Drag(_invitePanel); Drag(_readyPanel); Drag(_trialPanel); if (_invite == null && _ready == null) { return; } float unscaledTime = Time.unscaledTime; if (unscaledTime < _nextCountdown) { return; } _nextCountdown = unscaledTime + 1f; if (_invite != null) { if (unscaledTime >= _inviteUntil) { CloseInvite(); } else { RenderInvite(); } } if (_ready == null) { return; } if (unscaledTime >= _readyUntil) { CloseReady(); return; } if (_readyClicked && !_readyConfirmed && unscaledTime >= _readyRetryAt) { _readyClicked = false; } RenderReady(); } private static void Drag(PopupPanel? popup) { if (popup != null) { WindowDrag.Update(popup.Root, popup.Grip, ref popup.Dragging, ref popup.LastPointer, popup.X, popup.Y); } } private void Build() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Grimoire.ActivityPopups"); _canvas = val.AddComponent(); val.AddComponent(); val.AddComponent(); _canvas.renderMode = (RenderMode)0; _canvas.overrideSorting = true; _canvas.sortingOrder = 32767; CanvasScaler component = val.GetComponent(); component.uiScaleMode = (ScaleMode)1; component.referenceResolution = new Vector2(1920f, 1080f); component.screenMatchMode = (ScreenMatchMode)1; Object.DontDestroyOnLoad((Object)(object)val); _invitePanel = CreatePanel("ABYSS PARTY INVITE", 420f, 180f, Plugin.InvitePopupX, Plugin.InvitePopupY, AcceptInvite, DeclineInvite, CloseInvite); _readyPanel = CreatePanel("ABYSS READY CHECK", 440f, 210f, Plugin.ReadyPopupX, Plugin.ReadyPopupY, ReadyUp, CloseReady, CloseReady); _trialPanel = CreatePanel("RELIC TRIAL TARGETS", 460f, 260f, Plugin.TrialPopupX, Plugin.TrialPopupY, CloseTrial, CloseTrial, CloseTrial); _readyPanel.Secondary.GetComponentInChildren().text = "DISMISS"; _trialPanel.Secondary.SetActive(false); } private PopupPanel CreatePanel(string title, float width, float height, ConfigEntry x, ConfigEntry y, Action primary, Action secondary, Action close) { //IL_0036: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) PopupPanel obj = new PopupPanel { X = x, Y = y, Root = Box(((Component)_canvas).transform, "Popup." + title, new Vector2(0f, 0f), new Vector2(width, height), new Color(0.035f, 0.018f, 0.065f, 0.98f), new Vector2(0.5f, 0.5f)) }; WindowDrag.Restore(obj.Root, x, y); Label(obj.Root.transform, title, new Vector2(18f, -14f), new Vector2(width - 95f, 30f), 19, new Color(0.8f, 0.55f, 1f), (TextAnchor)0); Button(obj.Root.transform, "×", new Vector2(-17f, -14f), new Vector2(30f, 30f), close, (Vector2?)new Vector2(1f, 1f)); obj.Grip = Box(obj.Root.transform, "DragGrip", new Vector2(-55f, -14f), new Vector2(30f, 30f), new Color(0.55f, 0.23f, 0.8f, 0.65f), new Vector2(1f, 1f)); Label(obj.Grip.transform, "⋮", new Vector2(0f, 0f), new Vector2(30f, 30f), 19, Color.white, (TextAnchor)4); obj.Body = Label(obj.Root.transform, "", new Vector2(18f, -58f), new Vector2(width - 36f, height - 111f), 15, Color.white, (TextAnchor)0); obj.Primary = Button(obj.Root.transform, "ACCEPT", new Vector2(18f, 0f - height + 47f), new Vector2(125f, 32f), primary); obj.PrimaryLabel = obj.Primary.GetComponentInChildren(); obj.Secondary = Button(obj.Root.transform, "DECLINE", new Vector2(151f, 0f - height + 47f), new Vector2(125f, 32f), secondary); obj.Root.SetActive(false); return obj; } private void OnInvite(AbyssInvitePopupUiState invite) { if (invite.Seconds > 0 && !string.IsNullOrWhiteSpace(invite.Id) && !string.IsNullOrWhiteSpace(invite.Leader) && _seenInvites.Add(invite.Id)) { _inviteQueue.Enqueue((invite, Time.unscaledTime + (float)Math.Min(60, invite.Seconds))); if (_invite == null) { ShowNextInvite(); } } } private void ShowNextInvite() { _invite = null; while (_inviteQueue.Count > 0) { (AbyssInvitePopupUiState, float) tuple = _inviteQueue.Dequeue(); if (!(tuple.Item2 <= Time.unscaledTime)) { _invite = tuple.Item1; _inviteUntil = tuple.Item2; _inviteRevisionAtReceive = VoidfallStateService.State.AbyssPartyRevision; _invitePanel.Root.SetActive(true); _invitePanel.Root.transform.SetAsLastSibling(); RenderInvite(); return; } } if (_invitePanel != null) { _invitePanel.Root.SetActive(false); } } private void RenderInvite() { if (_invite != null && _invitePanel != null) { int value = Math.Max(0, Mathf.CeilToInt(_inviteUntil - Time.unscaledTime)); _invitePanel.Body.text = $"{Escape(_invite.Leader)} invited you to an Abyss party.\n\nExpires in {value}s."; } } private void AcceptInvite() { if (_invite != null) { CommandService.Send(".abyss partyaccept \"" + _invite.Leader.Replace("\"", string.Empty) + "\""); _inviteQueue.Clear(); CloseInvite(); } } private void DeclineInvite() { if (_invite != null) { CommandService.Send(".abyss partydecline \"" + _invite.Leader.Replace("\"", string.Empty) + "\""); CloseInvite(); } } private void CloseInvite() { _invite = null; ShowNextInvite(); } private void OnReady(AbyssReadyPopupUiState ready) { if (ready.Seconds > 0 && ready.Depth > 0 && !string.IsNullOrWhiteSpace(ready.Id) && _seenReady.Add(ready.Id)) { _ready = ready; _readyClicked = (_readyConfirmed = ready.AlreadyReady); _readyUntil = Time.unscaledTime + (float)Math.Min(60, ready.Seconds); _readyRevisionAtReceive = VoidfallStateService.State.AbyssPartyRevision; _readyPanel.Root.SetActive(true); _readyPanel.Root.transform.SetAsLastSibling(); RenderReady(); } } private void RenderReady() { if (_ready != null && _readyPanel != null) { int value = Math.Max(0, Mathf.CeilToInt(_readyUntil - Time.unscaledTime)); string value2 = string.Join(", ", _ready.Members.Select(Escape)); string text = string.Join(", ", _ready.Ready.Select(Escape)); _readyPanel.Body.text = $"Depth {_ready.Depth} · {value}s remaining\nParty: {value2}\nReady: {((text.Length == 0) ? "None" : text)}"; _readyPanel.PrimaryLabel.text = (_readyClicked ? "WAITING..." : "READY UP"); ((Selectable)_readyPanel.Primary.GetComponent