Decompiled source of SkulInsight QoL v0.16.2
plugins/DamageInsight.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using BehaviorDesigner.Runtime; using BehaviorDesigner.Runtime.Tasks; using BehaviorDesigner.Runtime.Tasks.Spine; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using Characters; using Characters.AI; using Characters.AI.Behaviours; using Characters.AI.Emperor; using Characters.AI.Pope; using Characters.AI.TwinSister; using Characters.AI.YggdrasillElderEnt; using Characters.Abilities; using Characters.Abilities.Blessing; using Characters.Abilities.CharacterStat; using Characters.Abilities.Darks; using Characters.Abilities.Savable; using Characters.Abilities.Statuses; using Characters.Abilities.Upgrades; using Characters.Actions; using Characters.Controllers; using Characters.Cooldowns; using Characters.Gear; using Characters.Gear.Fragments; using Characters.Gear.Items; using Characters.Gear.Quintessences; using Characters.Gear.Synergy; using Characters.Gear.Synergy.Inscriptions; using Characters.Gear.Synergy.Inscriptions.FairyTaleSummon; using Characters.Gear.Upgrades; using Characters.Gear.Weapons; using Characters.Operations; using Characters.Operations.Attack; using Characters.Player; using Characters.Projectiles; using CutScenes; using CutScenes.Shots.Events.Customs; using DamageInsight.Achievements; using DamageInsight.Codex; using DamageInsight.Crash; using DamageInsight.Daily; using DamageInsight.Describe; using DamageInsight.History; using DamageInsight.Lang; using DamageInsight.Mods; using DamageInsight.Patches; using DamageInsight.Recording; using DamageInsight.Rewards; using DamageInsight.SaveSlots; using DamageInsight.Tools; using DamageInsight.UI; using Data; using FX; using FX.BoundsAttackVisualEffect; using FX.CastAttackVisualEffect; using FX.ProjectileAttackVisualEffect; using FX.SmashAttackVisualEffect; using GameResources; using Hardmode; using Hardmode.DCDefense; using Hardmode.Darktech; using HarmonyLib; using InControl; using Level; using Microsoft.CodeAnalysis; using Platforms; using Runnables.Triggers; using Scenes; using Services; using Singletons; using Spine; using Spine.Unity; using Steamworks; using TMPro; using UI; using UI.Adventurer; using UI.GearPopup; using UI.Hud; using UI.Inventory; using UI.Pause; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Experimental.Rendering; using UnityEngine.Networking; using UnityEngine.Profiling; using UnityEngine.Rendering; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; using UnityEngine.TextCore.LowLevel; using UnityEngine.UI; using UserInput; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("BehaviorDesigner.Runtime")] [assembly: IgnoresAccessChecksTo("Platforms.Common")] [assembly: IgnoresAccessChecksTo("Platforms")] [assembly: IgnoresAccessChecksTo("Plugins.Common")] [assembly: IgnoresAccessChecksTo("Plugins.Singletons")] [assembly: IgnoresAccessChecksTo("UserInput")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("DocRun")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Real damage numbers, a combat log with per-hit calculations and build planning for Skul: The Hero Slayer.")] [assembly: AssemblyFileVersion("0.16.2.0")] [assembly: AssemblyInformationalVersion("0.16.2+0e43f6bff6e0edf2048b4a29c9813df1cf727eb5")] [assembly: AssemblyProduct("SkulInsight QoL")] [assembly: AssemblyTitle("DamageInsight")] [assembly: InternalsVisibleTo("DamageInsight.Tests")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.16.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace DamageInsight { public enum DamageSource { Basic, Skill, Item, Quintessence, Poison, Burn, Bleed, Shock, Ember, Status, Dash, Swap, DarkAbility, Other } public static class DamageSources { internal static DamageSource? CurrentStatus; public static DamageSource Classify(in Damage damage) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected I4, but got Unknown MotionType motionType = damage.motionType; return (int)motionType switch { 0 => DamageSource.Basic, 1 => DamageSource.Skill, 2 => DamageSource.Item, 3 => DamageSource.Quintessence, 5 => DamageSource.Dash, 6 => DamageSource.Swap, 7 => DamageSource.DarkAbility, 4 => CurrentStatus ?? DamageSource.Status, _ => DamageSource.Other, }; } public static string Label(DamageSource source) { return source switch { DamageSource.Basic => Loc.T("ATK"), DamageSource.Skill => Loc.T("SKILL"), DamageSource.Item => Loc.T("ITEM"), DamageSource.Quintessence => Loc.T("ESSENCE"), DamageSource.Poison => Loc.T("POISON"), DamageSource.Burn => Loc.T("BURN"), DamageSource.Bleed => Loc.T("BLEED"), DamageSource.Shock => Loc.T("SHOCK"), DamageSource.Ember => Loc.T("EMBER"), DamageSource.Status => Loc.T("STATUS"), DamageSource.Dash => Loc.T("DASH"), DamageSource.Swap => Loc.T("SWAP"), DamageSource.DarkAbility => Loc.T("DARK"), _ => "", }; } public static string Title(DamageSource source) { return source switch { DamageSource.Basic => Loc.T("Basic"), DamageSource.Skill => Loc.T("Skill"), DamageSource.Item => Loc.T("Item"), DamageSource.Quintessence => Loc.T("Essence"), DamageSource.Poison => Loc.T("Poison"), DamageSource.Burn => Loc.T("Burn"), DamageSource.Bleed => Loc.T("Bleed"), DamageSource.Shock => Loc.T("Shock"), DamageSource.Ember => Loc.T("Ember"), DamageSource.Status => Loc.T("Status"), DamageSource.Dash => Loc.T("Dash"), DamageSource.Swap => Loc.T("Swap"), DamageSource.DarkAbility => Loc.T("Dark"), _ => Loc.T("Other"), }; } public static string AttributeColorHex(Attribute attribute) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Invalid comparison between Unknown and I4 if ((int)attribute != 0) { if ((int)attribute == 1) { return "#3FD0FF"; } return "#DDDDDD"; } return "#FF9A3C"; } public static string ColorHex(DamageSource source) { return source switch { DamageSource.Basic => "#FFFFFF", DamageSource.Skill => "#FFC83D", DamageSource.Item => "#4FE0C8", DamageSource.Quintessence => "#C49BFF", DamageSource.Poison => "#96E03A", DamageSource.Burn => "#FF6A2B", DamageSource.Bleed => "#E8334F", DamageSource.Shock => "#FFF36B", DamageSource.Ember => "#FFA05E", DamageSource.Status => "#D0D0D0", DamageSource.Dash => "#7FB8FF", DamageSource.Swap => "#FF77DD", DamageSource.DarkAbility => "#9A6BFF", _ => "#A0A0A0", }; } public static Color Color(DamageSource source) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ParseHex(ColorHex(source)); } public static Color AttributeColor(Attribute attribute) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ParseHex(AttributeColorHex(attribute)); } private static Color ParseHex(string hex) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) Color result = default(Color); ColorUtility.TryParseHtmlString(hex, ref result); return result; } } [BepInPlugin("docrun.skulinsight_qol", "SkulInsight QoL", "0.16.2")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Log; internal static Plugin Instance; internal static ConfigEntry<string> Language; internal static ConfigEntry<bool> WhatsNewEnabled; internal static ConfigEntry<bool> MenuSoundsEnabled; internal static ConfigEntry<bool> CrashReports; internal static ConfigEntry<bool> PerformanceLog; internal static ConfigEntry<bool> PerformanceOverlay; internal static ConfigEntry<bool> RoomRestartEnabled; internal static ConfigEntry<bool> ShowAllSettings; internal static ConfigEntry<KeyboardShortcut> RoomRestartKey; internal static ConfigEntry<bool> RunHistory; internal static ConfigEntry<int> RunHistoryKeep; internal static ConfigEntry<bool> DailyEnabled; internal static ConfigEntry<string> DailyServer; internal static ConfigEntry<string> DailyName; internal static ConfigEntry<bool> DailyWinnerNames; internal static ConfigEntry<string> LastVersionSeen; internal static ConfigEntry<bool> DamageSourceTags; internal static ConfigEntry<bool> DamageSourceIcons; internal static ConfigEntry<float> DamageNumberHoldTime; internal static ConfigEntry<float> DamageNumberFadeTime; internal static ConfigEntry<bool> BossHealthNumbers; internal static ConfigEntry<bool> DescriptionNumbers; internal static ConfigEntry<bool> DescriptionsHoldToShow; internal static ConfigEntry<bool> DescriptionsCompact; internal static ConfigEntry<KeyboardShortcut> DescriptionsHoldKey; internal static ConfigEntry<KeyboardShortcut> CombatLogKey; internal static ConfigEntry<bool> CombatLogUseDialogueBackground; internal static ConfigEntry<float> CombatLogOpacity; internal static ConfigEntry<string> CombatLogWindowRect; internal static ConfigEntry<bool> MiniLogEnabled; internal static ConfigEntry<int> MiniLogLines; internal static ConfigEntry<float> MiniLogIdleSeconds; internal static ConfigEntry<bool> MiniLogPie; internal static ConfigEntry<float> MiniLogOffsetY; internal static ConfigEntry<bool> PickupPreview; internal static ConfigEntry<bool> CombatLogCalculations; internal static ConfigEntry<bool> CombatLogToFile; internal static ConfigEntry<bool> CooldownTicker; internal static ConfigEntry<float> CooldownTickerOpacity; internal static ConfigEntry<bool> CodexEnabled; internal static ConfigEntry<KeyboardShortcut> CodexKey; internal static ConfigEntry<bool> CodexRecordFights; internal static ConfigEntry<bool> CodexMoveHints; internal static ConfigEntry<bool> CodexProjectiles; internal static ConfigEntry<bool> CodexCleanFilms; internal static ConfigEntry<bool> CodexCompactFilms; internal static ConfigEntry<bool> CodexOpenOnYou; internal static ConfigEntry<bool> AchievementNotice; internal static ConfigEntry<bool> AchievementVeil; internal static ConfigEntry<float> AchievementSound; internal static ConfigEntry<bool> ClearViewEnabled; internal static ConfigEntry<bool> ClearViewOverRun; internal static ConfigEntry<bool> ClearViewWhenBusy; internal static ConfigEntry<bool> ClearViewProjectiles; internal static ConfigEntry<float> ClearViewLowest; internal static ConfigEntry<bool> ModManagerEnabled; internal static ConfigEntry<bool> AutoUpdate; internal static ConfigEntry<string> HealOrbLookSetting; internal static ConfigEntry<bool> HealOrbReminder; internal static ConfigEntry<bool> RewardsEnabled; internal static ConfigEntry<bool> RewardsAchievements; internal static ConfigEntry<bool> RewardsCoins; internal static ConfigEntry<bool> RewardsQuests; internal static ConfigEntry<bool> RewardsActivations; internal static ConfigEntry<int> RewardsSummonsPerRun; internal static ConfigEntry<int> RewardsCoinsPerSummon; internal static ConfigEntry<int> RewardsActivationsPerRun; internal static ConfigEntry<int> RewardsQuestDarkQuartz; internal static ConfigEntry<int> RewardsQuestGold; internal static ConfigEntry<int> RewardsAdventurerKills; internal static ConfigEntry<float> RewardsQuestRuns; internal static ConfigEntry<int> SaveSlotSelected; internal static ConfigEntry<int> SaveSlotCount; internal static ConfigEntry<bool> CodexMoveCounter; internal static ConfigEntry<bool> CodexRunLog; internal static ConfigEntry<bool> PreferNewMoves; private void Awake() { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_0662: Expected O, but got Unknown //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_0753: Expected O, but got Unknown //IL_077b: Unknown result type (might be due to invalid IL or missing references) //IL_0785: Expected O, but got Unknown //IL_07ac: Unknown result type (might be due to invalid IL or missing references) //IL_07b6: Expected O, but got Unknown //IL_07e9: Unknown result type (might be due to invalid IL or missing references) //IL_07f3: Expected O, but got Unknown //IL_081c: Unknown result type (might be due to invalid IL or missing references) //IL_0826: Expected O, but got Unknown //IL_0852: Unknown result type (might be due to invalid IL or missing references) //IL_085c: Expected O, but got Unknown //IL_0884: Unknown result type (might be due to invalid IL or missing references) //IL_088e: Expected O, but got Unknown //IL_08e1: Unknown result type (might be due to invalid IL or missing references) //IL_08eb: Expected O, but got Unknown //IL_0987: Unknown result type (might be due to invalid IL or missing references) //IL_0aa9: Unknown result type (might be due to invalid IL or missing references) //IL_0ab3: Expected O, but got Unknown //IL_0ba5: Unknown result type (might be due to invalid IL or missing references) //IL_0baf: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Instance = this; Language = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Language", "auto", new ConfigDescription("Language of the mod's texts. auto = the game's language (changes with it); or one of: " + string.Join(", ", Loc.Languages.Select(((string code, string name) l) => l.code)) + ".", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[1] { "auto" }.Concat(Loc.Languages.Select(((string code, string name) l) => l.code)).ToArray()), Array.Empty<object>())); Loc.OverrideFolder = Path.Combine(Paths.BepInExRootPath, "DamageInsight", "Lang"); WhatsNewEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "WhatsNew", true, "After an update, show once (in the castle) what's new in this version."); MenuSoundsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "MenuSounds", true, "The mod's buttons play the game's menu sounds when the mouse moves onto them or clicks them."); RunHistory = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "RunHistory", true, "Keep every run in the Codex: how it ended, the end screen's numbers, the build, the damage of each piece of gear, the maps and a timeline of skulls, items and inscriptions. Per save slot, in BepInEx\\DamageInsight\\Codex\\Runs."); RunHistoryKeep = ((BaseUnityPlugin)this).Config.Bind<int>("General", "RunHistoryKeep", 100, "How many of the newest runs keep all their details (timeline, damage, picture). Older runs without a star keep only their summary (20-1000)."); DailyEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Daily", "Enabled", false, "Daily runs (online): everyone plays the same seed each day, one try, daily and monthly boards. Connects to the daily run server and sends a random player id made by the mod, the name you enter and your daily run (its numbers, build, damage and timeline). Off until you turn it on (Codex, Daily)."); DailyName = ((BaseUnityPlugin)this).Config.Bind<string>("Daily", "Name", "", "Your name for the daily boards (up to 12 characters). The name box after a daily run starts with it. Type it here (e.g. in the mod manager's config editor) if typing in the game freezes it: some input methods (Pinyin, IME) freeze full-screen games."); DailyWinnerNames = ((BaseUnityPlugin)this).Config.Bind<bool>("Daily", "WinnerNames", true, "The adventurers (the hero parties in runs) are named after yesterday's daily run winners. Needs daily runs on."); DailyServer = ((BaseUnityPlugin)this).Config.Bind<string>("Daily", "Server", "https://skul.umut-aslan.dev", "The daily run server's address."); CrashReports = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "CrashReports", true, "Keep a report of every game session in BepInEx\\DamageInsight\\CrashReports (the newest 20): errors with what happened before them and whose code they were in (the game's, SkulInsight's or another mod's), a stuck black screen, a session that ended unexpectedly. Says so on screen. Send the report with a bug report."); ShowAllSettings = ((BaseUnityPlugin)this).Config.Bind<bool>("All settings", "Show", false, "The settings page shows every setting (on) or only the ones most players change (off)."); RoomRestartEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Restart Room", "Enabled", true, "Restart room: press the key below (F5) twice within 3 seconds to go back to the moment you entered the room, as when you close the game and continue. In a daily run it ends the run (like leaving the game)."); RoomRestartKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Restart Room", "Key", new KeyboardShortcut((KeyCode)286, Array.Empty<KeyCode>()), "Press twice within 3 seconds to restart the room you are in."); PerformanceLog = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "PerformanceLog", true, "Write into the session report how smooth the game runs: frames per second and stutters each minute, how much of each frame SkulInsight's own code takes (part by part), and what was going on if the game stands still for a few seconds. Costs next to nothing."); PerformanceOverlay = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "PerformanceOverlay", false, "A small line in the top left corner: frames per second and how many milliseconds of each frame SkulInsight takes."); LastVersionSeen = ((BaseUnityPlugin)this).Config.Bind<string>("General", "LastVersionSeen", "", "The version whose 'What's new' was last shown (kept by the mod)."); DamageSourceTags = ((BaseUnityPlugin)this).Config.Bind<bool>("Damage Numbers", "ShowSourceTag", true, "Mark damage numbers with where the damage came from (icon or ATK, SKILL, ITEM, ...)."); DamageSourceIcons = ((BaseUnityPlugin)this).Config.Bind<bool>("Damage Numbers", "UseIcons", true, "Use icons instead of text tags where an icon is configured (see [Damage Icons])."); IconLibrary.Bind(((BaseUnityPlugin)this).Config); DamageNumberHoldTime = ((BaseUnityPlugin)this).Config.Bind<float>("Damage Numbers", "HoldSeconds", 0.8f, "How long a damage number stays fully visible after popping up. (Game default: about 0.15)"); DamageNumberFadeTime = ((BaseUnityPlugin)this).Config.Bind<float>("Damage Numbers", "FadeSeconds", 0.7f, "How long a damage number takes to fade out."); BossHealthNumbers = ((BaseUnityPlugin)this).Config.Bind<bool>("Boss Health Bar", "ShowNumbers", true, "Show current / maximum HP as text on boss, adventurer and dark enemy health bars."); DescriptionNumbers = ((BaseUnityPlugin)this).Config.Bind<bool>("Descriptions", "ShowDamageNumbers", true, "Add real damage numbers (with your current stats) to skull, skill, swap, item, essence and inscription descriptions."); DescriptionsCompact = ((BaseUnityPlugin)this).Config.Bind<bool>("Descriptions", "Compact", true, "Compact numbers in the game's description boxes: one line per attack with its totals. Off: every hit with its formula (base x hit % x attack %). The Codex always shows the formula."); DescriptionsHoldToShow = ((BaseUnityPlugin)this).Config.Bind<bool>("Descriptions", "HoldToShow", true, "The numbers in the game's description boxes show only while you hold HoldKey (the boxes stay short, like the game's own 'hold for details'). Off: always shown."); DescriptionsHoldKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Descriptions", "HoldKey", new KeyboardShortcut((KeyCode)304, Array.Empty<KeyCode>()), "Key to hold for the numbers in the game's description boxes (inventory, items on the ground, shops, swap menu). Either Shift works."); PickupPreview = ((BaseUnityPlugin)this).Config.Bind<bool>("Descriptions", "PreviewPickup", true, "Items on the ground, in shops and in the swap menu show their numbers as if you had picked them up (their stats and inscription steps included)."); CombatLogKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Combat Log", "ToggleKey", new KeyboardShortcut((KeyCode)108, Array.Empty<KeyCode>()), "Key that opens and closes the combat log."); CombatLogUseDialogueBackground = ((BaseUnityPlugin)this).Config.Bind<bool>("Combat Log", "UseDialogueBackground", true, "Use the NPC dialogue box artwork as the window background (false = plain dark panel)."); CombatLogOpacity = ((BaseUnityPlugin)this).Config.Bind<float>("Combat Log", "BackgroundOpacity", 0.85f, "Opacity of the dialogue background, 0 = invisible, 1 = solid."); CombatLogWindowRect = ((BaseUnityPlugin)this).Config.Bind<string>("Combat Log", "WindowRect", "", "Position and size of the log window (left,top,width,height at 1920x1080). Saved automatically; empty = default."); CombatLogCalculations = ((BaseUnityPlugin)this).Config.Bind<bool>("Combat Log", "RecordCalculations", true, "Record how every hit's number came about (stats, items, inscriptions, dark abilities, crits, debuffs); hover a log line to see it."); CombatLogToFile = ((BaseUnityPlugin)this).Config.Bind<bool>("Combat Log", "SaveToFile", true, "Also write every hit (with its calculation) to BepInEx\\DamageInsight\\CombatLogs, one file per game session (the newest 30 are kept)."); MiniLogEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Mini Log", "Enabled", false, "Show a few log lines above the minimap. Can also be toggled in the combat log window."); MiniLogLines = ((BaseUnityPlugin)this).Config.Bind<int>("Mini Log", "Lines", 4, "Number of lines (1-8)."); MiniLogIdleSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Mini Log", "HideAfterSeconds", 5f, "Hide the mini log when no new damage came in for this many seconds."); MiniLogPie = ((BaseUnityPlugin)this).Config.Bind<bool>("Mini Log", "ShowPie", true, "Show a tiny pie chart at the right of the mini log."); MiniLogOffsetY = ((BaseUnityPlugin)this).Config.Bind<float>("Mini Log", "GapAboveMinimap", 40f, "Distance between the minimap and the mini log (reference pixels at 1920x1080)."); CooldownTicker = ((BaseUnityPlugin)this).Config.Bind<bool>("Cooldown Ticker", "Enabled", true, "Show the remaining seconds on the skill, swap, quintessence, item and ability icons (83s, 2m+, 10m). Cooldown speed bonuses are included."); CooldownTickerOpacity = ((BaseUnityPlugin)this).Config.Bind<float>("Cooldown Ticker", "Opacity", 0.55f, "Opacity of the numbers (0-1)."); ModManagerEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Mods", "Enabled", true, "A Mods button in the pause menu: Thunderstore's Skul mods and yours side by side, with search, details and their Thunderstore pages. It only goes online (Thunderstore) when you open it."); HealOrbLookSetting = ((BaseUnityPlugin)this).Config.Bind<string>("Heal Orbs", "Look", "Potion", new ConfigDescription("How the healing orbs enemies drop look: Game (the game's purple orb), Potion (the game's Portable Potion, a bit bigger, with a green glow) or Plus (a big green +).", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[3] { "Game", "Potion", "Plus" }), Array.Empty<object>())); HealOrbReminder = ((BaseUnityPlugin)this).Config.Bind<bool>("Heal Orbs", "Reminder", true, "When a map is cleared while you are hurt and healing orbs are left on it, a short text above you says so (once per map)."); RewardsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Rewards", "Enabled", true, "Rewards for your achievements and the bestiary (small lasting bonuses, coins, quests). They change the game's balance a little; never in daily runs. Off: the game as it is; everything earned is kept and comes back when turned on."); RewardsAchievements = ((BaseUnityPlugin)this).Config.Bind<bool>("Rewards", "AchievementRewards", true, "Each achievement of this save slot gives a small lasting bonus (more damage to a boss you beat, attack, speed, gold, ...)."); RewardsCoins = ((BaseUnityPlugin)this).Config.Bind<bool>("Rewards", "Coins", true, "Breaking a legendary item or skull gives its coin, every 5th win over an adventurer that adventurer's coin, a run ended with Omen items an Omen coin: in a later run coins summon that gear (Codex, You, Rewards; Coins per summon)."); RewardsQuests = ((BaseUnityPlugin)this).Config.Bind<bool>("Rewards", "Quests", true, "Every normal enemy has an endless quest: every few runs' worth of kills pays some dark quartz and gold at once."); RewardsActivations = ((BaseUnityPlugin)this).Config.Bind<bool>("Rewards", "InscriptionActivations", true, "Completing an inscription in a run (its last step) earns an activation when the run ends: in a later run it makes an inscription you have count one more until that run ends (each one once per run), like the Dark Mirror's banners."); RewardsSummonsPerRun = ((BaseUnityPlugin)this).Config.Bind<int>("Rewards", "SummonsPerRun", 1, new ConfigDescription("How many summons of each kind (legendary skull, legendary item, adventurer, Omen) you can make per run (0-3).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 3), Array.Empty<object>())); RewardsCoinsPerSummon = ((BaseUnityPlugin)this).Config.Bind<int>("Rewards", "CoinsPerSummon", 3, new ConfigDescription("Coins a summon takes: of that legendary skull or item, or Omen coins for an Omen item (1-10). An adventurer's coin is enough on its own (it already takes several wins).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); RewardsActivationsPerRun = ((BaseUnityPlugin)this).Config.Bind<int>("Rewards", "ActivationsPerRun", 2, new ConfigDescription("How many inscription activations you can use per run (0-3).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 3), Array.Empty<object>())); RewardsQuestRuns = ((BaseUnityPlugin)this).Config.Bind<float>("Rewards", "QuestRuns", 2f, new ConfigDescription("How many runs' worth of an enemy one quest step takes (0.5-10).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 10f), Array.Empty<object>())); RewardsQuestDarkQuartz = ((BaseUnityPlugin)this).Config.Bind<int>("Rewards", "QuestDarkQuartz", 25, new ConfigDescription("Dark quartz per quest step (0-100).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); RewardsQuestGold = ((BaseUnityPlugin)this).Config.Bind<int>("Rewards", "QuestGold", 50, new ConfigDescription("Gold per quest step, only inside a run (0-300).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 300), Array.Empty<object>())); RewardsAdventurerKills = ((BaseUnityPlugin)this).Config.Bind<int>("Rewards", "AdventurerKills", 5, new ConfigDescription("Wins over one adventurer for its coin (1-50).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50), Array.Empty<object>())); ClearViewEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Clear View", "Enabled", true, "Make the effects of your skills, items and summons fainter, so enemy attacks stay easy to see with a strong build. Enemy attacks and their warnings are never faded."); ClearViewLowest = ((BaseUnityPlugin)this).Config.Bind<float>("Clear View", "LowestOpacity", 0.4f, new ConfigDescription("How faint your effects get at most (0.1-1).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 1f), Array.Empty<object>())); ClearViewOverRun = ((BaseUnityPlugin)this).Config.Bind<bool>("Clear View", "OverTheRun", true, "Fade over the run: full in chapter 1, the lowest opacity from chapter 5 on (Dark Mirror chapters the same)."); ClearViewWhenBusy = ((BaseUnityPlugin)this).Config.Bind<bool>("Clear View", "WhenBusy", true, "Fade when many of your effects are on screen at once (from 8; the lowest opacity at 40), in any chapter."); ClearViewProjectiles = ((BaseUnityPlugin)this).Config.Bind<bool>("Clear View", "Projectiles", true, "Your projectiles and your summons' fade too."); CodexEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Codex", "Enabled", true, "Record your progress for the Codex (enemies met and killed, gear found) and capture enemy portraits."); CodexKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Codex", "ToggleKey", new KeyboardShortcut((KeyCode)107, Array.Empty<KeyCode>()), "Key that opens and closes the Codex book."); CodexMoveHints = ((BaseUnityPlugin)this).Config.Bind<bool>("Codex", "ShowMoveHints", true, "Under a boss move in the Codex: when the boss uses it (HP range, distance, cooldown...), read from its AI. Shown once you have beaten the boss."); CodexRecordFights = ((BaseUnityPlugin)this).Config.Bind<bool>("Codex", "FilmBossAttacks", true, "Film each boss attack once (a small picture 10 times a second, effects included) to show it in the Codex."); CodexProjectiles = ((BaseUnityPlugin)this).Config.Bind<bool>("Codex", "ProjectilePictures", true, "Add the projectile an enemy fires (arrow, bolt, ...) to its pictures in the Codex, the first time it fires one."); CodexCompactFilms = ((BaseUnityPlugin)this).Config.Bind<bool>("Codex", "CompactFilms", true, "Save boss films as compact pictures (about a quarter of the size, nearly the same look). Off: lossless pictures, about 1 GB more once every boss is filmed."); CodexCleanFilms = ((BaseUnityPlugin)this).Config.Bind<bool>("Codex", "CleanFilms", true, "Boss films show only the boss: damage numbers, the effects of your skills and items, your summons and status effects on the boss (poison, burn, freeze, ...) are left out."); CodexOpenOnYou = ((BaseUnityPlugin)this).Config.Bind<bool>("Codex", "OpenOnYou", true, "During a run, the Codex opens on the You page (your skulls, items, inscriptions and stats). Off: it opens on the page you read last."); AchievementNotice = ((BaseUnityPlugin)this).Config.Bind<bool>("Codex", "AchievementNotice", true, "When this save slot earns an achievement, a small box with it slides down from the top of the screen for a few seconds (also for achievements your Steam account already has: each slot earns them on its own)."); AchievementSound = ((BaseUnityPlugin)this).Config.Bind<float>("Codex", "AchievementSound", 0.5f, new ConfigDescription("How loud the little chime of the achievement notice is (0 = no sound). The game's master and effects volume apply too.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); AchievementVeil = ((BaseUnityPlugin)this).Config.Bind<bool>("Codex", "VeilSecretAchievements", true, "Achievements that give the story away stay veiled in the Codex until you earn them, meet what they are about, or hold the mouse button on them for 4 seconds."); AchievementVeil.SettingChanged += delegate { CodexWindow.Instance?.Invalidate(); }; AchievementStore.Folder = CodexTracker.Folder; RewardStore.Folder = CodexTracker.Folder; CodexBalance.Bind(((BaseUnityPlugin)this).Config); SaveSlotSelected = ((BaseUnityPlugin)this).Config.Bind<int>("Save Slots", "Slot", 1, "The save slot that Play, Copy and Clear use. The panel on the right shows what it holds."); SaveSlotCount = ((BaseUnityPlugin)this).Config.Bind<int>("Save Slots", "Slots", 3, "How many save slots there are (3 to 5)."); SlotStore.Folder = Path.Combine(Paths.BepInExRootPath, "DamageInsight", "SaveSlots"); SlotStore.Load(); SlotSwitcher.ConnectSettingsPage(); CrashReporter.Begin(((Component)this).gameObject, ((BaseUnityPlugin)this).Config); ((Component)this).gameObject.AddComponent<PerfMonitor>(); List<PatchRegistry.Result> list = PatchRegistry.ApplyAll(new Harmony("docrun.skulinsight_qol")); SelfTest.ReportPatches(list); CrashReporter.Note($"patches applied: {list.Count((PatchRegistry.Result r) => r.Ok)}/{list.Count}"); DamageLog.Recorded += delegate(DamageRecord record) { SelfTest.Observe(in record); }; LogFile.Attach(); RunJournal.Attach(); CodexOrigins.Attach(); ((Component)this).gameObject.AddComponent<DailyService>(); ((Component)this).gameObject.AddComponent<CombatLogWindow>(); ((Component)this).gameObject.AddComponent<MiniLog>(); ((Component)this).gameObject.AddComponent<ClearView>(); ((Component)this).gameObject.AddComponent<ModService>(); ((Component)this).gameObject.AddComponent<WhatsNew>(); CodexReset.RunIfRequested(); CodexMigrations.Run(); ((Component)this).gameObject.AddComponent<CodexWindow>(); ((Component)this).gameObject.AddComponent<FightRecorder>(); Application.quitting += delegate { CodexTracker.SaveIfNeeded(force: true); }; Application.quitting += delegate { Guard.Run("Rewards: save at quit", RewardStore.Flush); }; Log.LogInfo((object)"SkulInsight QoL 0.16.2 loaded"); } private void Update() { LanguageWatcher.Tick(); ExtraInfo.Tick(); Guard.Run("UI (event system)", ModEventSystem.Tick); Service instance = Singleton<Service>.Instance; object obj; if (instance == null) { obj = null; } else { LevelManager levelManager = instance.levelManager; obj = ((levelManager != null) ? levelManager.player : null); } Character player = (Character)obj; bool num = (Object)(object)player != (Object)null; CodexTracker.Tick(player); Guard.Run("Run history", delegate { RunJournal.Tick(player); }); Guard.Run("Heal orbs", delegate { HealOrbs.Tick(player); }); Guard.Run("Rewards", delegate { RewardApplier.Tick(player); }); Guard.Run("Rewards (bestiary)", delegate { RewardService.Tick(player); }); Guard.Run("Rewards (save)", RewardStore.Tick); Guard.Run("Daily run", DailyRun.Tick); Guard.Run("Restart room (key)", RoomRestart.Tick); if (num) { SelfTest.CheckRun(); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "docrun.skulinsight_qol"; public const string PLUGIN_NAME = "SkulInsight QoL"; public const string PLUGIN_VERSION = "0.16.2"; } } namespace DamageInsight.UI { internal static class AchievementSound { public const int Rate = 44100; private const float Length = 0.48f; private const float Gain = 0.42f; private const float Attack = 0.004f; private static readonly (float freq, float start, float hold, float decay, float level)[] Notes = new(float, float, float, float, float)[3] { (987.77f, 0f, 0.07f, 0.03f, 1f), (1318.51f, 0.075f, 0f, 0.12f, 1f), (1975.53f, 0.075f, 0f, 0.05f, 0.22f) }; private static SoundInfo _sound; public static void Play() { float volume = Plugin.AchievementSound?.Value ?? 0.5f; if (volume <= 0f) { return; } Guard.Run("Achievement sound", delegate { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (_sound == null) { AudioClip obj = AudioClip.Create("SkulInsight_AchievementChime", 21168, 1, 44100, false); obj.SetData(Samples(), 0); _sound = new SoundInfo(obj) { _uniqueTime = 0.2f }; } _sound._volume = Mathf.Clamp01(volume); SoundManager instance = PersistentSingleton<SoundManager>.Instance; if (instance != null) { instance.PlaySound(_sound, Vector3.zero); } }); } internal static float[] Samples() { int num = 21168; float[] array = new float[num]; (float, float, float, float, float)[] notes = Notes; for (int i = 0; i < notes.Length; i++) { (float, float, float, float, float) tuple = notes[i]; float item = tuple.Item1; float item2 = tuple.Item2; float item3 = tuple.Item3; float item4 = tuple.Item4; float item5 = tuple.Item5; for (int j = (int)(44100f * item2); j < num; j++) { double num2 = (double)j / 44100.0 - (double)item2; double num3 = Math.Min(1.0, num2 / 0.004000000189989805) * ((num2 < (double)item3) ? 1.0 : Math.Exp((0.0 - (num2 - (double)item3)) / (double)item4)); if (num3 < 0.0001 && num2 > (double)item3) { break; } double num4 = Math.PI * 2.0 * (double)item * num2; array[j] += (float)((double)item5 * num3 * (Math.Sin(num4) + 0.2 * Math.Sin(3.0 * num4) + 0.08 * Math.Sin(5.0 * num4))); } } int num5 = 441; for (int k = 0; k < num5; k++) { array[num - 1 - k] *= (float)k / (float)num5; } float num6 = 0f; float[] array2 = array; foreach (float value in array2) { num6 = Math.Max(num6, Math.Abs(value)); } for (int l = 0; l < num; l++) { array[l] = 0.42f * array[l] / num6; } return array; } } public sealed class AchievementToast : MonoBehaviour { private const float Height = 92f; private const float RewardLine = 22f; private const float MinWidth = 440f; private const float MaxWidth = 760f; private const float Top = 18f; private const float InSeconds = 0.4f; private const float StaySeconds = 4.5f; private const float OutSeconds = 0.45f; private static AchievementToast _instance; private readonly Queue<AchievementInfo> _waiting = new Queue<AchievementInfo>(); private AchievementInfo _shown; private float _time; private Canvas _canvas; private CanvasGroup _group; private RectTransform _box; private Image _icon; private TextMeshProUGUI _caption; private TextMeshProUGUI _name; private TextMeshProUGUI _description; private TextMeshProUGUI _reward; private float _height = 92f; public static void Show(AchievementInfo info) { if (info == null) { return; } Guard.Run("Achievement notice", delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown if ((Object)(object)_instance == (Object)null) { GameObject val = new GameObject("DamageInsight_AchievementToast"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent<AchievementToast>(); } _instance._waiting.Enqueue(info); }); } private void Update() { if (_shown == null) { if (_waiting.Count == 0) { return; } _shown = _waiting.Dequeue(); _time = 0f; Guard.Run("Achievement notice", Fill); } _time += Mathf.Min(Time.unscaledDeltaTime, 0.1f); Guard.Run("Achievement notice", Animate); } private void Fill() { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_0127: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_canvas == (Object)null) { Build(); } ((Behaviour)_canvas).enabled = true; ((TMP_Text)_caption).text = Loc.T("Achievement unlocked"); ((TMP_Text)_name).text = "<b>" + _shown.Name + "</b>"; ((TMP_Text)_description).text = _shown.Description; string text = RewardLineOf(_shown); ((TMP_Text)_reward).text = text; _height = ((text.Length > 0) ? 114f : 92f); float num = Mathf.Max(Mathf.Max(((TMP_Text)_name).GetPreferredValues(((TMP_Text)_name).text).x, ((TMP_Text)_description).GetPreferredValues(((TMP_Text)_description).text).x), (text.Length > 0) ? ((TMP_Text)_reward).GetPreferredValues(text).x : 0f); _box.sizeDelta = new Vector2(Mathf.Clamp(num + 128f, 440f, 760f), _height); SetIcon(); AchievementSound.Play(); } private void SetIcon() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) Sprite val = ((_shown.Kind == AchievementKind.Daily) ? PixelIcons.Get(_shown.Pixel) : AchievementSteam.Icon(_shown.OnSteam ? _shown.Id : _shown.BaseId, grey: false)); _icon.sprite = val; ((Graphic)_icon).color = (Color)(((Object)(object)val == (Object)null) ? new Color(0f, 0f, 0f, 0f) : Color.white); } private void Animate() { //IL_00f6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_icon.sprite == (Object)null) { SetIcon(); } float num = _height + 12f; float num2 = -18f; float num4; float alpha; if (_time < 0.4f) { float num3 = 1f - Mathf.Pow(1f - _time / 0.4f, 3f); num4 = Mathf.Lerp(num, num2, num3); alpha = num3; } else if (_time < 4.9f) { num4 = num2; alpha = 1f; } else { if (!(_time < 5.35f)) { _shown = null; ((Behaviour)_canvas).enabled = _waiting.Count > 0; return; } float num5 = Mathf.Pow((_time - 0.4f - 4.5f) / 0.45f, 2f); num4 = Mathf.Lerp(num2, num, num5); alpha = 1f - num5; } _box.anchoredPosition = new Vector2(0f, num4); _group.alpha = alpha; } private void Build() { //IL_0030: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: 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_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) _canvas = UiKit.OverlayCanvas("DamageInsight_AchievementToast", 5300); Image val = UiKit.Image("Box", ((Component)_canvas).transform, Color32.op_Implicit(new Color32((byte)27, (byte)18, (byte)36, (byte)240))); _box = ((Graphic)val).rectTransform; RectTransform box = _box; RectTransform box2 = _box; RectTransform box3 = _box; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 1f); box3.pivot = val2; Vector2 anchorMin = (box2.anchorMax = val2); box.anchorMin = anchorMin; _box.sizeDelta = new Vector2(440f, 92f); Outline obj = ((Component)val).gameObject.AddComponent<Outline>(); ((Shadow)obj).effectColor = Color32.op_Implicit(new Color32((byte)232, (byte)184, (byte)74, byte.MaxValue)); ((Shadow)obj).effectDistance = new Vector2(2f, -2f); ((Graphic)val).raycastTarget = false; _group = ((Component)val).gameObject.AddComponent<CanvasGroup>(); _group.blocksRaycasts = false; _group.interactable = false; Image val4 = UiKit.Image("Icon frame", (Transform)(object)_box, Color32.op_Implicit(new Color32((byte)14, (byte)9, (byte)20, byte.MaxValue))); ((Graphic)val4).rectTransform.Place(12f, 10f, 72f, 72f); ((Graphic)val4).raycastTarget = false; Outline obj2 = ((Component)val4).gameObject.AddComponent<Outline>(); ((Shadow)obj2).effectColor = Color32.op_Implicit(new Color32((byte)168, (byte)116, (byte)36, byte.MaxValue)); ((Shadow)obj2).effectDistance = new Vector2(1.5f, -1.5f); _icon = UiKit.Image("Icon", ((Component)val4).transform, Color.white); _icon.preserveAspect = true; ((Graphic)_icon).raycastTarget = false; ((Graphic)_icon).rectTransform.Fill(3f); _caption = UiKit.Text("Caption", (Transform)(object)_box, "", 14f, (TextAlignmentOptions)257, Color32.op_Implicit(new Color32((byte)232, (byte)184, (byte)74, byte.MaxValue))); TopRow(((TMP_Text)_caption).rectTransform, 10f, 20f); ((TMP_Text)_caption).enableWordWrapping = false; ((TMP_Text)_caption).characterSpacing = 4f; _name = UiKit.Text("Name", (Transform)(object)_box, "", 22f, (TextAlignmentOptions)257); TopRow(((TMP_Text)_name).rectTransform, 28f, 32f); ((TMP_Text)_name).enableWordWrapping = false; ((TMP_Text)_name).overflowMode = (TextOverflowModes)1; _description = UiKit.Text("Description", (Transform)(object)_box, "", 15f, (TextAlignmentOptions)257, UiKit.DimTextColor); TopRow(((TMP_Text)_description).rectTransform, 60f, 24f); ((TMP_Text)_description).enableWordWrapping = false; ((TMP_Text)_description).overflowMode = (TextOverflowModes)1; _reward = UiKit.Text("Reward", (Transform)(object)_box, "", 15f, (TextAlignmentOptions)257, Color32.op_Implicit(new Color32((byte)155, (byte)224, (byte)122, byte.MaxValue))); TopRow(((TMP_Text)_reward).rectTransform, 82f, 24f); ((TMP_Text)_reward).enableWordWrapping = false; ((TMP_Text)_reward).overflowMode = (TextOverflowModes)1; } private static void TopRow(RectTransform rect, float top, float height) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) rect.anchorMin = new Vector2(0f, 1f); rect.anchorMax = new Vector2(1f, 1f); rect.pivot = new Vector2(0.5f, 1f); rect.offsetMin = new Vector2(100f, 0f - top - height); rect.offsetMax = new Vector2(-16f, 0f - top); } private static string RewardLineOf(AchievementInfo info) { if (RewardApplier.AchievementsOn) { AchievementReward achievementReward = RewardCatalog.For(info.Id); if (achievementReward != null) { string text = RewardCatalog.Text(achievementReward, (string id) => CodexPages.Entry(id)?.Name ?? id); return Loc.F("Reward: {0}", text); } } return ""; } } public static class Changelog { public static List<(string version, string[] lines)> Versions() { List<(string, string[])> list = new List<(string, string[])>(); list.Add(("0.16.2", new string[1] { Loc.T("The name for the daily board starts with your Steam name when you haven't set one, so runs no longer go on the board as \"Skul\" by accident. You can change it before sending.") })); list.Add(("0.16.1", new string[5] { Loc.T("Fixed: Restart room (F5) brings the run back with all its gear (0.16.0 lost it until the game was started again)."), Loc.T("Fixed: a new name for the daily board can be typed (the box kept bringing the old one back)."), Loc.T("Other players' runs show in your language: their skills, damage table, enemies and stages, also runs sent before."), Loc.T("Daily points: gold and bones left are worth much more (1 point per 5 gold, 25 per bone). From November 2 the day's achievements are choices in the run (a skull and a quintessence of the day to win holding, one of the game's achievements), none that the points count already."), Loc.T("The changelog in the game: it opens once after every update with what is new for you in a box, and any time from Esc, SkulInsight QoL, General, Changelog.") })); list.Add(("0.16.0", new string[6] { Loc.T("Restart room: press F5 twice to go back to the moment you entered the room, as when you close the game and continue. In a daily run it ends the run."), Loc.T("Daily points, new from November 1: the boss fights instead of the game's double-counted kills, speed counts more, flawless rooms and boss fights (no health lost) count, and four achievements of the day give bonus points. The day's board is the run alone; the streak counts on the month board."), Loc.T("Yesterday's daily winners give their names to the adventurers you meet."), Loc.T("The settings page is new: the features on the left in groups (what changes the game, what only shows, helpers, online, general), each with its switch; hover one to see its settings on the right."), Loc.T("Fixed: hovering with the mouse selects items, skulls and dark abilities again; the game no longer stutters when a strong build kills a lot."), Loc.T("The crash reports now also note frames per second and what slows the game down (setting Show FPS for a line on screen).") })); list.Add(("0.15.0", new string[6] { Loc.T("Rewards: every achievement of your save slot gives a small lasting bonus that fits it, like more damage to a boss you beat (more without getting hit), attack, speed or gold (Codex, You, Rewards)."), Loc.T("Coins: break a legendary item or skull, or beat an adventurer a few times, and its coin summons that gear in a later run. A run ended with Omen items gives Omen coins."), Loc.T("Kill quests: every normal enemy has an endless quest that pays dark quartz and gold."), Loc.T("Inscription activations: complete an inscription in a run, and in a later run one you have counts one more, like the Dark Mirror's banners."), Loc.T("Rewards can be turned off at the top of the settings page; daily runs never use them."), Loc.T("Daily runs: every day Normal, the Dark Mirror at a random level and Dark Mirror 10, each with and without the DLC and each with its own board. Everyone gets the same gifts in the castle and the same blessing.") })); list.Add(("0.14.1", new string[1] { Loc.T("Thunderstore's rules: SkulInsight no longer updates itself (your mod manager does), and the Mods window lists mods and links their pages.") })); list.Add(("0.14.0", new string[7] { Loc.T("Achievements (Codex, You, Achievements): all of Skul's achievements as this save slot has them, with tips, your progress and veils over the story's secrets. Each slot earns its own, also the ones Steam already has."), Loc.T("A small notice slides down from the top of the screen when your slot earns an achievement."), Loc.T("Clear view: your own effects get fainter over the run and when the screen gets busy, so enemy attacks stay easy to see (settings: Clear view)."), Loc.T("Mods (pause menu): your mods and Thunderstore's Skul mods side by side, with search, details and their Thunderstore pages."), Loc.T("Healing orbs are easier to see (as a Portable Potion or a green plus), a short text says when some are left, and your runs count the ones you missed."), Loc.T("Daily runs: SkulInsight's own achievements for thumbs up received and days in a row. Record bonuses for most damage, gold and kills now need a boss defeated."), Loc.T("macOS: the mod now runs on Skul's Mac version, set up by one Terminal script.") })); list.Add(("0.13.1", new string[1] { Loc.T("The Thunderstore package is packed correctly again (0.13.0's was broken).") })); list.Add(("0.13.0", new string[4] { Loc.T("Run history (Codex, You, Runs): every run kept like a match history: how it ended, the build, each piece of gear's damage and a timeline, all linked to the Codex. Star a run to keep it whole; End screen shows the game's result panel again."), Loc.T("Records (Codex, You, Records): your bests over all runs, per skull, against bosses, and the game's own counters."), Loc.T("Daily run (Codex, Daily; online, off until you turn it on): the same run for everyone each day, one try, in its own save slot with everything unlocked. Your own game isn't touched."), Loc.T("Daily and monthly boards: open anyone's run like your run history, see how its points came about (with bonuses for the day's records and your streak) and give it a thumbs up.") })); list.Add(("0.12.2", new string[1] { Loc.T("Crash reports: a report of every game session that says whose code an error was in (settings: Crash reports folder). The game's skill boxes open beside the mod's box.") })); list.Add(("0.12.1", new string[1] { Loc.T("The What's new window closes with a click; the mod's buttons light up under the mouse and play the game's menu sounds.") })); list.Add(("0.12.0", new string[5] { Loc.T("The Codex (K) is your reference book: You, Bestiary and Arsenal, boxed pages, every number with its formula. Hold Shift on an Arsenal page to see the numbers with your run's stats."), Loc.T("Skill boxes: win a run with a skill (beat a boss of chapter 5 or later while you have it) to reveal it on the skull's page."), Loc.T("Descriptions stay short: hold Shift (or the game's details key) to see the mod's numbers."), Loc.T("Combat log (L), View: Damage table: your damage per skull, item, inscription and more."), Loc.T("Save slots: keep up to 5 games side by side (Esc, SkulInsight QoL, Save slots).") })); list.Add(("0.11.0", new string[1] { Loc.T("Codex: cleaner boss films, a short note on every boss move (what it does and how to deal with it), King Alexander's heart; damage numbers for about 50 more skill parts.") })); list.Add(("0.10.2", new string[1] { Loc.T("Cooldown seconds on the skill, swap and quintessence icons, with your cooldown speed included.") })); list.Add(("0.10.1", new string[1] { Loc.T("The mod speaks all the game's languages; its settings page is in the game (Esc, SkulInsight QoL); boss moves show when the boss uses them.") })); list.Add(("0.10.0", new string[1] { Loc.T("The Codex (K): every enemy, boss, adventurer, skull, item, quintessence and inscription you have met, with your stats, pictures that unlock as you play, boss move lists and fight films.") })); list.Add(("0.9.3", new string[1] { Loc.T("Fixed: a boss could stay invulnerable after its intro. Every part of the mod is guarded, so an error in it never stops the game.") })); list.Add(("0.9.2", new string[1] { Loc.T("Fixed: an attack could fail when the combat log looked up the item that dealt it.") })); list.Add(("0.9.1", new string[1] { Loc.T("Fixed: special characters on the Thunderstore page.") })); list.Add(("0.9.0", new string[1] { Loc.T("The first public version: damage numbers with their source, boss health numbers, real damage in every description, a preview of gear before you pick it up, the combat log (L) and cooldown numbers.") })); return list; } public static bool Newer(string version, string than) { int[] array = Parts(version); int[] array2 = Parts(than); for (int i = 0; i < 3; i++) { if (array[i] != array2[i]) { return array[i] > array2[i]; } } return false; } private static int[] Parts(string version) { string[] array = (version ?? "").Split(new char[1] { '.' }); int[] array2 = new int[3]; for (int i = 0; i < 3 && i < array.Length; i++) { int.TryParse(array[i], out array2[i]); } return array2; } public static (List<(string version, string[] lines)> boxed, List<(string version, string[] lines)> earlier) Split(string lastSeen) { List<(string, string[])> list = Versions(); if (string.IsNullOrEmpty(lastSeen)) { lastSeen = list[0].Item1; } List<(string, string[])> list2 = list.Where<(string, string[])>(((string version, string[] lines) v, int i) => i == 0 || Newer(v.version, lastSeen)).ToList(); return (boxed: list2, earlier: list.Skip(list2.Count).ToList()); } public static string Text(IEnumerable<(string version, string[] lines)> versions) { StringBuilder stringBuilder = new StringBuilder(); foreach (var (text, array) in versions) { stringBuilder.Append("<size=120%><color=#F2D78B>" + text + "</color></size>\n"); string[] array2 = array; foreach (string value in array2) { stringBuilder.Append("» ").Append(value).Append("\n<size=40%>\n</size>"); } stringBuilder.Append("<size=60%>\n</size>"); } return stringBuilder.ToString().TrimEnd(new char[1] { '\n' }); } } public sealed class ClearView : MonoBehaviour { private sealed class Faded { public float Base; public float Written; public int Frame; } public const int BusyFrom = 8; public const int BusyFull = 40; private static readonly Dictionary<SpriteRenderer, Faded> Renderers = new Dictionary<SpriteRenderer, Faded>(); private static readonly Dictionary<Projectile, SpriteRenderer[]> Projectiles = new Dictionary<Projectile, SpriteRenderer[]>(); private static readonly List<SpriteRenderer> Stale = new List<SpriteRenderer>(); private static readonly List<Projectile> Gone = new List<Projectile>(); private float _opacity = 1f; private float _nextPrune; private Action _apply; private static bool On => Plugin.ClearViewEnabled?.Value ?? false; public static void Fired(Projectile projectile, Character owner) { if (On) { ConfigEntry<bool> clearViewProjectiles = Plugin.ClearViewProjectiles; if (clearViewProjectiles != null && clearViewProjectiles.Value && !((Object)(object)projectile == (Object)null) && FilmClutter.IsPlayerSide(owner)) { Projectiles[projectile] = ((Component)projectile).GetComponentsInChildren<SpriteRenderer>(true); } } } public static void Despawned(Projectile projectile) { if (!((Object)(object)projectile == (Object)null) && Projectiles.TryGetValue(projectile, out var value)) { Projectiles.Remove(projectile); SpriteRenderer[] array = value; for (int i = 0; i < array.Length; i++) { Restore(array[i]); } } } private void LateUpdate() { if (_apply == null) { _apply = Apply; } Guard.Run("Clear view", _apply); } private void Apply() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Invalid comparison between Unknown and I4 if (Renderers.Count == 0 && Projectiles.Count == 0 && !On) { return; } int frameCount = Time.frameCount; int num = 0; foreach (EffectPoolInstance playerEffect in FilmClutter.PlayerEffects) { if ((Object)(object)playerEffect != (Object)null && (int)playerEffect.state == 2) { num++; } } Gone.Clear(); foreach (KeyValuePair<Projectile, SpriteRenderer[]> projectile in Projectiles) { if ((Object)(object)projectile.Key == (Object)null || !((Behaviour)projectile.Key).isActiveAndEnabled) { Gone.Add(projectile.Key); } } foreach (Projectile item in Gone) { Projectiles.Remove(item); } num += Projectiles.Count; float num2 = (On ? Target(num) : 1f); _opacity = Mathf.MoveTowards(_opacity, num2, Time.unscaledDeltaTime * 1.2f); if (_opacity < 0.999f) { foreach (EffectPoolInstance playerEffect2 in FilmClutter.PlayerEffects) { if ((Object)(object)playerEffect2 != (Object)null && (int)playerEffect2.state == 2 && (Object)(object)playerEffect2.renderer != (Object)null) { Dim(playerEffect2.renderer, frameCount); } } foreach (SpriteRenderer[] value in Projectiles.Values) { foreach (SpriteRenderer val in value) { if ((Object)(object)val != (Object)null) { Dim(val, frameCount); } } } } Stale.Clear(); foreach (KeyValuePair<SpriteRenderer, Faded> renderer in Renderers) { if (renderer.Value.Frame != frameCount) { Stale.Add(renderer.Key); } } foreach (SpriteRenderer item2 in Stale) { Restore(item2); } if (Time.unscaledTime >= _nextPrune) { _nextPrune = Time.unscaledTime + 10f; FilmClutter.PruneDestroyed(); } } private static float Target(int busy) { bool flag = Plugin.ClearViewOverRun?.Value ?? true; bool flag2 = Plugin.ClearViewWhenBusy?.Value ?? true; float num = ((!flag && !flag2) ? 1f : Math.Max(flag ? RunProgress() : 0f, flag2 ? BusyFade(busy) : 0f)); return Mathf.Lerp(1f, Mathf.Clamp(Plugin.ClearViewLowest?.Value ?? 0.4f, 0.05f, 1f), num); } internal static float RunProgress(Type chapter) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected I4, but got Unknown switch (chapter - 4) { case 0: case 6: return 0.25f; case 1: case 7: return 0.5f; case 2: case 8: return 0.75f; case 3: case 9: case 10: return 1f; default: return 0f; } } private static float RunProgress() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) Service instance = Singleton<Service>.Instance; object obj; if (instance == null) { obj = null; } else { LevelManager levelManager = instance.levelManager; obj = ((levelManager != null) ? levelManager.currentChapter : null); } Chapter val = (Chapter)obj; if (!((Object)(object)val == (Object)null)) { return RunProgress(val.type); } return 0f; } internal static float BusyFade(int busy) { return Mathf.Clamp01((float)(busy - 8) / 32f); } private void Dim(SpriteRenderer renderer, int frame) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) Color color = renderer.color; if (!Renderers.TryGetValue(renderer, out var value)) { Dictionary<SpriteRenderer, Faded> renderers = Renderers; Faded obj = new Faded { Base = color.a }; value = obj; renderers[renderer] = obj; } else if (Mathf.Abs(color.a - value.Written) > 0.002f) { value.Base = color.a; } color.a = value.Base * _opacity; renderer.color = color; value.Written = color.a; value.Frame = frame; } private static void Restore(SpriteRenderer renderer) { //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_0063: Unknown result type (might be due to invalid IL or missing references) if (renderer == null) { return; } if ((Object)(object)renderer == (Object)null || !Renderers.TryGetValue(renderer, out var value)) { Renderers.Remove(renderer); return; } Renderers.Remove(renderer); Color color = renderer.color; if (Mathf.Abs(color.a - value.Written) <= 0.002f) { color.a = value.Base; renderer.color = color; } } } public sealed class CombatLogWindow : MonoBehaviour { private enum ChartMode { Source, Type } private enum ViewMode { Hits, Table } private sealed class ChipGroup { public TextMeshProUGUI Label; public readonly List<(UiKit.Chip chip, float width)> Chips = new List<(UiKit.Chip, float)>(); } public static readonly LogFilter Filter = new LogFilter(); public static readonly LogFeed Feed = new LogFeed(Filter); private static int _feedFrame = -1; private ViewMode _view; private ViewMode _viewShown; private ChartMode _chartMode; private int _minDamageIndex; private const int MaxLines = 250; private const float TextInterval = 0.1f; private const float ChartInterval = 0.3f; private const float DefaultWidth = 920f; private const float DefaultHeight = 720f; private Canvas _canvas; private WindowFrame _frame; private RectTransform _panel; private ScrollRect _scroll; private TextMeshProUGUI _logText; private TextMeshProUGUI _legendText; private TextMeshProUGUI _pieCenterText; private RectTransform _logFrame; private RectTransform _chartFrame; private RectTransform _pieRect; private RectTransform _legendRect; private PieChart _pie; private readonly List<Action> _chipRefreshers = new List<Action>(); private readonly List<ChipGroup> _groups = new List<ChipGroup>(); private int _textVersion = -1; private int _chartVersion = -1; private ChartMode _chartModeShown; private float _nextText; private float _nextChart; private TraceTooltip _tooltip; private readonly List<int> _lineMap = new List<int>(); private int _hoverLine = -1; private DamageRecord? _pinned; private Image _panelImage; private TextMeshProUGUI _hint; private bool _rebuild; private static readonly Color PlainBackground = Color32.op_Implicit(new Color32((byte)27, (byte)18, (byte)36, (byte)235)); private int _pinnedLine = -1; public static bool IsOpen { get; private set; } public static void UpdateFeed() { if (_feedFrame != Time.frameCount) { _feedFrame = Time.frameCount; Feed.Update(DamageLog.Records, DamageLog.TotalAdded, DamageLog.ClearCount, DamageLog.CurrentRoom); } } private void Awake() { Plugin.CombatLogUseDialogueBackground.SettingChanged += delegate { Guard.Run("Combat log background", Restyle); }; Plugin.CombatLogOpacity.SettingChanged += delegate { Guard.Run("Combat log background", Restyle); }; Plugin.CombatLogWindowRect.SettingChanged += delegate { Guard.Run("Combat log position", delegate { _frame?.MoveTo(SavedEdges()); }); }; Plugin.CombatLogKey.SettingChanged += delegate { Guard.Run("Combat log hint", delegate { if ((Object)(object)_hint != (Object)null) { ((TMP_Text)_hint).text = HintText(); } }); }; Loc.Changed += delegate { _rebuild = true; }; } private void Rebuild() { _rebuild = false; if (!((Object)(object)_canvas == (Object)null)) { bool isOpen = IsOpen; Object.Destroy((Object)(object)((Component)_canvas).gameObject); _canvas = null; _frame = null; _tooltip = null; _pinned = null; _hoverLine = (_pinnedLine = -1); _chipRefreshers.Clear(); _groups.Clear(); _lineMap.Clear(); IsOpen = false; if (isOpen) { SetOpen(open: true); } } } private void Update() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (_rebuild) { Guard.Run("Combat log (language)", Rebuild); } KeyboardShortcut value = Plugin.CombatLogKey.Value; if ((((KeyboardShortcut)(ref value)).IsDown() || (IsOpen && Input.GetKeyDown((KeyCode)27))) && !SettingsPage.IsOpen && !TextInput.IsTyping()) { SetOpen(!IsOpen); } if (IsOpen) { UpdateFeed(); UpdateTooltip(); float unscaledTime = Time.unscaledTime; if ((Feed.Version != _textVersion || _view != _viewShown) && unscaledTime >= _nextText) { _nextText = unscaledTime + 0.1f; _textVersion = Feed.Version; _viewShown = _view; DrawLog(); } if ((Feed.Version != _chartVersion || _chartMode != _chartModeShown) && unscaledTime >= _nextChart) { _nextChart = unscaledTime + 0.3f; _chartVersion = Feed.Version; _chartModeShown = _chartMode; DrawChart(); } } } private void SetOpen(bool open) { if (open && (Object)(object)_canvas == (Object)null) { try { Build(); } catch (Exception arg) { Plugin.Log.LogError((object)$"Could not build the combat log window: {arg}"); return; } } IsOpen = open; ((Component)_canvas).gameObject.SetActive(open); if (open) { EnsureEventSystem(); RefreshChips(); _textVersion = (_chartVersion = -1); _nextText = (_nextChart = 0f); } } private void Build() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_077c: Unknown result type (might be due to invalid IL or missing references) _canvas = UiKit.OverlayCanvas("DamageInsight_CombatLog", 5000); ((Component)_canvas).gameObject.AddComponent<GraphicRaycaster>(); Image val = UiKit.Image("Panel", ((Component)_canvas).transform, PlainBackground); _panel = ((Graphic)val).rectTransform; _panelImage = val; ApplyBackground(val); _frame = WindowFrame.Attach(_panel, SavedEdges(), 560f, 440f); Transform panel = (Transform)(object)_panel; ((TMP_Text)UiKit.Text("Title", panel, Loc.T("Combat Log"), 30f, (TextAlignmentOptions)257)).rectTransform.Place(28f, 12f, 360f, 40f); _hint = UiKit.Text("Hint", panel, HintText(), 13f, (TextAlignmentOptions)257, UiKit.DimTextColor); ((TMP_Text)_hint).rectTransform.Place(28f, 48f, 520f, 20f); string label = Loc.T("Clear"); string label2 = Loc.T("Mini log"); float num = Mathf.Max(80f, UiKit.ChipWidth(label)); float width = Mathf.Max(100f, UiKit.ChipWidth(label2)); ((Graphic)new UiKit.Chip(panel, label, 0f, 0f, num, delegate { DamageLog.Clear(); Filter.Changed(); }).Background).rectTransform.PlaceTopRight(28f, 16f, num, 28f); UiKit.Chip mini = new UiKit.Chip(panel, label2, 0f, 0f, width, delegate { Plugin.MiniLogEnabled.Value = !Plugin.MiniLogEnabled.Value; RefreshChips(); }); ((Graphic)mini.Background).rectTransform.PlaceTopRight(28f + num + 8f, 16f, width, 28f); _chipRefreshers.Add(delegate { mini.SetOn(Plugin.MiniLogEnabled.Value); }); ChipGroup chipGroup = Group(panel, Loc.T("Show")); Radio(chipGroup, panel, new(string, LogDirection)[3] { (Loc.T("Dealt"), LogDirection.Dealt), (Loc.T("Taken"), LogDirection.Taken), (Loc.T("All"), LogDirection.All) }, () => Filter.Direction, delegate(LogDirection v) { Filter.Direction = v; }); ChipGroup chipGroup2 = Group(panel, Loc.T("Scope")); Radio(chipGroup2, panel, new(string, LogScope)[2] { (Loc.T("This room"), LogScope.Room), (Loc.T("All rooms"), LogScope.All) }, () => Filter.Scope, delegate(LogScope v) { Filter.Scope = v; }); ChipGroup chipGroup3 = Group(panel, Loc.T("Filter")); Toggle(chipGroup3, panel, Loc.T("Crits only"), () => Filter.CritsOnly, delegate(bool v) { Filter.CritsOnly = v; }); UiKit.Chip minChip = AddChip(chipGroup3, panel, Loc.T("Min: any"), Mathf.Max(100f, UiKit.ChipWidth(Loc.T("Min: any"))), delegate { _minDamageIndex = (_minDamageIndex + 1) % LogFilter.MinDamageSteps.Length; Filter.MinDamage = LogFilter.MinDamageSteps[_minDamageIndex]; Filter.Changed(); RefreshChips(); }); _chipRefreshers.Add(delegate { int num3 = LogFilter.MinDamageSteps[_minDamageIndex]; ((TMP_Text)minChip.Label).text = ((num3 == 0) ? Loc.T("Min: any") : Loc.F("Min: {0}", num3)); minChip.SetOn(num3 > 0); }); ChipGroup chipGroup4 = Group(panel, Loc.T("Enemy")); (string, EntityKind[])[] array = new(string, EntityKind[])[6] { (Loc.T("Regular"), new EntityKind[1] { EntityKind.TrashMob }), (Loc.T("Elites"), new EntityKind[1] { EntityKind.Elite }), (Loc.T("Adventurers"), new EntityKind[1] { EntityKind.Adventurer }), (Loc.T("Bosses"), new EntityKind[1] { EntityKind.Boss }), (Loc.T("Summons"), new EntityKind[1] { EntityKind.Summoned }), (Loc.T("Other"), new EntityKind[3] { EntityKind.Trap, EntityKind.Other, EntityKind.PlayerMinion }) }; for (int num2 = 0; num2 < array.Length; num2++) { var (label3, kinds) = array[num2]; Toggle(chipGroup4, panel, label3, () => kinds.All(Filter.EnemyKinds.Contains), delegate(bool on) { EntityKind[] array2 = kinds; foreach (EntityKind value in array2) { Set(Filter.EnemyKinds, value, on); } }); } ChipGroup chipGroup5 = Group(panel, Loc.T("Type")); foreach (Attribute attribute in Enum.GetValues(typeof(Attribute))) { Toggle(chipGroup5, panel, DescriptionFormatter.AttributeName(((object)attribute/*cast due to .constrained prefix*/).ToString()), () => Filter.Attributes.Contains(attribute), delegate(bool on) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) Set(Filter.Attributes, attribute, on); }, DamageSources.AttributeColor(attribute)); } ChipGroup chipGroup6 = Group(panel, Loc.T("View")); Radio(chipGroup6, panel, new(string, ViewMode)[2] { (Loc.T("Hits"), ViewMode.Hits), (Loc.T("Damage table"), ViewMode.Table) }, () => _view, delegate(ViewMode v) { _view = v; }, changesFilter: false); ChipGroup chipGroup7 = Group(panel, Loc.T("Chart")); Radio(chipGroup7, panel, new(string, ChartMode)[2] { (Loc.T("By source"), ChartMode.Source), (Loc.T("By type"), ChartMode.Type) }, () => _chartMode, delegate(ChartMode v) { _chartMode = v; }, changesFilter: false); ChipGroup chipGroup8 = Group(panel, Loc.T("Source")); foreach (DamageSource s in Enum.GetValues(typeof(DamageSource))) { Toggle(chipGroup8, panel, DamageSources.Title(s), () => Filter.Sources.Contains(s), delegate(bool on) { Set(Filter.Sources, s, on); }, DamageSources.Color(s)); } BuildLog(panel); _tooltip = new TraceTooltip(_canvas); BuildChart(panel); _frame.AddCornerGrips(); _frame.Resized += delegate { Relayout(); }; _frame.DragEnded += delegate(Edges e) { Plugin.CombatLogWindowRect.Value = WindowFrame.Serialize(e); }; Relayout(); RefreshChips(); ((Component)_canvas).gameObject.SetActive(false); } private void Relayout() { //IL_0214: 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_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) float width = _frame.Current.Width; float num = Mathf.Max(70f, (_groups.Count == 0) ? 0f : (_groups.Max((ChipGroup g) => ((TMP_Text)g.Label).preferredWidth) + 10f)); float num2 = width - 28f; float num3 = 28f; float num4 = 80f; bool flag = true; foreach (ChipGroup group in _groups) { float num5 = num + group.Chips.Sum(((UiKit.Chip chip, float width) c) => c.width + 6f); if (!flag && num3 + 22f + num5 > num2) { num3 = 28f; num4 += 34f; flag = true; } if (!flag) { num3 += 22f; } ((TMP_Text)group.Label).rectTransform.Place(num3, num4, num, 28f); num3 += num; float num6 = num3; foreach (var (chip, num7) in group.Chips) { if (num3 + num7 > num2 && num3 > num6) { num3 = num6; num4 += 34f; } ((Graphic)chip.Background).rectTransform.Place(num3, num4, num7, 28f); num3 += num7 + 6f; } flag = false; } float num8 = num4 + 34f + 10f; float num9 = Mathf.Clamp(width * 0.3f, 180f, 260f); _logFrame.Stretch(28f, num8, 28f + num9 + 16f, 24f); _chartFrame.anchorMin = new Vector2(1f, 0f); _chartFrame.anchorMax = new Vector2(1f, 1f); _chartFrame.pivot = new Vector2(1f, 0.5f); _chartFrame.offsetMin = new Vector2(0f - (28f + num9), 24f); _chartFrame.offsetMax = new Vector2(-28f, 0f - num8); float num10 = Mathf.Min(num9 - 32f, 220f); _pieRect.Place((num9 - num10) / 2f, 14f, num10, num10); _legendRect.Stretch(14f, num10 + 26f, 14f, 10f); } private void BuildLog(Transform parent) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) Image val = UiKit.Image("LogFrame", parent, Color32.op_Implicit(new Color32((byte)14, (byte)9, (byte)20, (byte)153))); _logFrame = ((Graphic)val).rectTransform; RectTransform val2 = UiKit.Rect("Viewport", ((Component)val).transform).Fill(8f); ((Component)val2).gameObject.AddComponent<RectMask2D>(); ((Graphic)((Component)val2).gameObject.AddComponent<Image>()).color = new Color(0f, 0f, 0f, 0f); _logText = UiKit.Text("Lines", (Transform)(object)val2, "", 16f, (TextAlignmentOptions)257); RectTransform rectTransform = ((TMP_Text)_logText).rectTransform; rectTransform.anchorMin = new Vector2(0f, 1f); rectTransform.anchorMax = new Vector2(1f, 1f); rectTransform.pivot = new Vector2(0.5f, 1f); rectTransform.anchoredPosition = Vector2.zero; rectTransform.sizeDelta = new Vector2(-8f, 0f); ((Component)rectTransform).gameObject.AddComponent<ContentSizeFitter>().verticalFit = (FitMode)2; _scroll = ((Component)val).gameObject.AddComponent<ScrollRect>(); _scroll.viewport = val2; _scroll.content = rectTransform; _scroll.horizontal = false; _scroll.movementType = (MovementType)2; _scroll.scrollSensitivity = 40f; } private void BuildChart(Transform parent) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Image val = UiKit.Image("ChartFrame", parent, Color32.op_Implicit(new Color32((byte)14, (byte)9, (byte)20, (byte)153))); _chartFrame = ((Graphic)val).rectTransform; _pie = new PieChart(); _pieRect = UiKit.Rect("Pie", ((Component)val).transform); RawImage obj = ((Component)_pieRect).gameObject.AddComponent<RawImage>(); obj.texture = (Texture)(object)_pie.Texture; ((Graphic)obj).raycastTarget = false; _pieCenterText = UiKit.Text("Total", (Transform)(object)_pieRect, "", 18f, (TextAlignmentOptions)514); ((TMP_Text)_pieCenterText).rectTransform.Fill(); _legendText = UiKit.Text("Legend", ((Component)val).transform, "", 15f, (TextAlignmentOptions)257); _legendRect = ((TMP_Text)_legendText).rectTransform; } public static Image FindDialogueBackground() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) Image val = null; NpcConversation[] array = Resources.FindObjectsOfTypeAll<NpcConversation>(); foreach (NpcConversation val2 in array) { if ((Object)(object)val2._container == (Object)null) { continue; } Image[] componentsInChildren = val2._container.GetComponentsInChildren<Image>(true); foreach (Image val3 in componentsInChildren) { if ((Object)(object)val3.sprite == (Object)null) { continue; } Rect rect = ((Graphic)val3).rectTransform.rect; Vector2 size = ((Rect)(ref rect)).size; if (!((Object)(object)val == (Object)null)) { float num = size.x * size.y; rect = ((Graphic)val).rectTransform.rect; float width = ((Rect)(ref rect)).width; rect = ((Graphic)val).rectTransform.rect; if (!(num > width * ((Rect)(ref rect)).height)) { continue; } } val = val3; } } return val; } private static string HintText() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return Loc.F("Drag here to move · corners to resize · {0}/Esc to close", Plugin.CombatLogKey.Value); } private static Edges SavedEdges() { //IL_0015: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (WindowFrame.TryParse(Plugin.CombatLogWindowRect.Value, out var edges)) { return edges; } Vector2 canvasSize = UiKit.CanvasSize; return new Edges(canvasSize.x - 40f - 920f, (canvasSize.y - 720f) / 2f, 920f, 720f); } private void Restyle() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) Image panelImage = _panelImage; if (!((Object)(object)panelImage == (Object)null)) { panelImage.sprite = null; panelImage.type = (Type)0; ((Graphic)panelImage).color = PlainBackground; ApplyBackground(panelImage); } } private static void ApplyBackground(Image panel) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.CombatLogUseDialogueBackground.Value) { return; } try { Image val = FindDialogueBackground(); if ((Object)(object)val == (Object)null) { Plugin.Log.LogInfo((object)"Combat log: dialogue background not found, using a plain panel."); return; } panel.sprite = val.sprite; panel.type = (Type)((val.sprite.border != Vector4.zero) ? 1 : 0); Color color = ((Graphic)val).color; color.a *= Mathf.Clamp01(Plugin.CombatLogOpacity.Value); ((Graphic)panel).color = color; Plugin.Log.LogInfo((object)$"Combat log: using dialogue background '{((Object)val.sprite).name}' (border {val.sprite.border})"); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Combat log: could not use dialogue background: " + ex.Message)); } } private static void EnsureEventSystem() { ModEventSystem.Ensure(); } private ChipGroup Group(Transform parent, string label) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) ChipGroup chipGroup = new ChipGroup { Label = UiKit.Text("Label " + label, parent, label, 16f, (TextAlignmentOptions)4097, UiKit.DimTextColor) }; _groups.Add(chipGroup); return chipGroup; } private static UiKit.Chip AddChip(ChipGroup group, Transform parent, string label, float width, Action onClick, Color? onColor = null) { UiKit.Chip chip = new UiKit.Chip(parent, label, 0f, 0f, width, onClick, onColor); group.Chips.Add((chip, width)); return chip; } private void Toggle(ChipGroup group, Transform parent, string label, Func<bool> get, Action<bool> set, Color? onColor = null) { UiKit.Chip chip = AddChip(group, parent, label, UiKit.ChipWidth(label), delegate { set(!get()); Filter.Changed(); RefreshChips(); }, onColor); _chipRefreshers.Add(delegate { chip.SetOn(get()); }); } private void Radio<T>(ChipGroup group, Transform parent, (string label, T value)[] options, Func<T> get, Action<T> set, bool changesFilter = true) { for (int i = 0; i < options.Length; i++) { (string, T) tuple = options[i]; string item = tuple.Item1; T value = tuple.Item2; UiKit.Chip chip = AddChip(group, parent, item, UiKit.ChipWidth(item), delegate { set(value); if (changesFilter) { Filter.Changed(); } RefreshChips(); }); _chipRefreshers.Add(delegate { chip.SetOn(EqualityComparer<T>.Default.Equals(get(), value)); }); } } private void RefreshChips() { foreach (Action chipRefresher in _chipRefreshers) { chipRefresher(); } } private static void Set<T>(HashSet<T> set, T value, bool on) { if (on) { set.Add(value); } else { set.Remove(value); } } private void DrawLog() { if (_view == ViewMode.Table) { bool num = _viewShown != ViewMode.Table || _lineMap.Count > 0; _lineMap.Clear(); ((TMP_Text)_logText).text = GearTable.Text(Feed.TotalByGear); if (num) { _scroll.verticalNormalizedPosition = 1f; } return; } bool num2 = _scroll.verticalNormalizedPosition <= 0.01f || ((TMP_Text)_logText).text.Length == 0; ((TMP_Text)_logText).text = LogText.Build(Feed.Shown, DamageLog.Rooms, 250, _lineMap); _hoverLine = -1; if (num2) { Canvas.ForceUpdateCanvases(); _scroll.verticalNormalizedPosition = 0f; } } private void UpdateTooltip() { //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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) if (_tooltip == null) { return; } int num = RecordUnderMouse(); if (Input.GetMouseButtonDown(0)) { _pinned = ((num >= 0 && (!_pinned.HasValue || _hoverLine != _pinnedLine)) ? new DamageRecord?(Feed.Shown[num]) : ((DamageRecord?)null)); _pinnedLine = (_pinned.HasValue ? _hoverLine : (-1)); if (_pinned.HasValue) { _tooltip.Show(_pinned.Value, Vector2.op_Implicit(Input.mousePosition)); } } if (!_pinned.HasValue) { if (num >= 0) { _tooltip.Show(Feed.Shown[num], Vector2.op_Implicit(Input.mousePosition)); } else if (_tooltip.Visible) { _tooltip.Hide(); } } } private int RecordUnderMouse() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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) _hoverLine = -1; if ((Object)(object)_logText == (Object)null || !RectTransformUtility.RectangleContainsScreenPoint(_scroll.viewport, Vector2.op_Implicit(Input.mousePosition), (Camera)null)) { return -1; } int num = TMP_TextUtilities.FindIntersectingLine((TMP_Text)(object)_logText, Input.mousePosition, (Camera)null); TMP_TextInfo textInfo = ((TMP_Text)_logText).textInfo; if (num < 0 || num >= textInfo.lineCount) { return -1; } int firstCharacterIndex = textInfo.lineInfo[num].firstCharacterIndex; int num2 = 0; for (int i = 0; i < firstCharacterIndex && i < textInfo.characterCount; i++) { if (textInfo.characterInfo[i].character == '\n') { num2++; } } _hoverLine = num2; int num3 = ((num2 < _lineMap.Count) ? _lineMap[num2] : (-1)); if (num3 < 0 || num3 >= Feed.Shown.Count) { return -1; } return num3; } private void DrawChart() { //IL_0128: Unknown result type (might be due to invalid IL or missing references) List<(string, double, double, Color)> list = ((_chartMode == ChartMode.Source) ? (from s in DamageStats.FromTotals(Feed.TotalBySource) select (label: DamageSources.Title(s.Key), Value: s.Value, Percent: s.Percent, color: DamageSources.Color(s.Key))).ToList() : (from s in DamageStats.FromTotals(Feed.TotalByAttribute) select (label: DescriptionFormatter.AttributeName(((object)s.Key/*cast due to .constrained prefix*/).ToString()), Value: s.Value, Percent: s.Percent, color: DamageSources.AttributeColor(s.Key))).ToList()); _pie.Draw(list.Select<(string, double, double, Color), (double, Color)>(((string label, double Value, double Percent, Color color) s) => (Value: s.Value, color: s.color)).ToList()); double num = list.Sum<(string, double, double, Color)>(((string label, double Value, double Percent, Color color) s) => s.Value); ((TMP_Text)_pieCenterText).text = ((num > 0.0) ? string.Format("<size=70%><color=#A89F94>{0}</color></size>\n{1:N0}", Loc.T("Total"), num) : ""); StringBuilder stringBuilder = new StringBuilder(); foreach (var item in list) { string text = ColorUtility.ToHtmlStringRGB(item.Item4); stringBuilder.Append($"<color=#{text}>{item.Item1}</color><pos=48%>{item.Item3:0.0}%<pos=72%><color=#A89F94>{item.Item2:N0}</color>\n"); } ((TMP_Text)_legendText).text = stringBuilder.ToString(); } } public static class CooldownFormat { public static double RealSeconds(double remain, double speed) { if (!(remain > 0.0) || !(speed > 0.01)) { return 0.0; } return remain / speed; } public static string Format(double seconds) { if (double.IsNaN(seconds) || double.IsInfinity(seconds) || seconds <= 0.0) { return ""; } long num = (long)Math.Ceiling(seconds - 0.0001); if (num < 100) { return Loc.F("{0}s", num); } long num2 = num / 60; if (num % 60 != 0L) { return Loc.F("{0}m+", num2); } return Loc.F("{0}m", num2); } } public static class CooldownLabel { private const string Name = "DamageInsight Cooldown"; public static void Set(Transform icon, string text, TMP_FontAsset font) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Transform val = icon.Find("DamageInsight Cooldown"); TextMeshProUGUI val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent<TextMeshProUGUI>() : null); if ((Object)(object)val2 == (Object)null) { if (text.Length == 0) { return; } val2 = Create(icon, font); } if (((TMP_Text)val2).text != text) { ((TMP_Text)val2).text = text; } float num = Mathf.Clamp01(Plugin.CooldownTickerOpacity.Value); if (!Mathf.Approximately(((Graphic)val2).color.a, num)) { ((Graphic)val2).color = new Color(1f, 1f, 1f, num); } } private static TextMeshProUGUI Create(Transform icon, TMP_FontAsset font) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_0030: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_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_0051: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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) GameObject val = new GameObject("DamageInsight Cooldown", new Type[1] { typeof(RectTransform) }); val.transform.SetParent(icon, false); RectTransform val2 = (RectTransform)val.transform; val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; Vector2 offsetMin = (val2.offsetMax = Vector2.zero); val2.offsetMin = offsetMin; TextMeshProUGUI val3 = val.AddComponent<TextMeshProUGUI>(); if ((Object)(object)font != (Object)null) { ((TMP_Text)val3).font = font; } ((TMP_Text)val3).alignment = (TextAlignmentOptions)514; ((TMP_Text)val3).enableWordWrapping = false; ((Graphic)val3).raycastTarget = false; ((TMP_Text)val3).enableAutoSizing = true; ((TMP_Text)val3).fontSizeMin = 4f; ((TMP_Text)val3).fontSizeMax = 40f; ((TMP_Text)val3).margin = new Vector4(1f, 1f, 1f, 1f); ((Graphic)val3).color = new Color(1f, 1f, 1f, Mathf.Clamp01(Plugin.CooldownTickerOpacity.Value)); ((TMP_Text)val3).outlineWidth = 0.25f; ((TMP_Text)val3).outlineColor = new Color32((byte)0, (byte)0, (byte)0, byte.MaxValue); return val3; } } public static class CooldownReader { private static readonly Dictionary<Type, FieldInfo> Fields = new Dictionary<Type, FieldInfo>(); public static double Remaining(IAbilityInstance instance) { if (instance == null) { return 0.0; } float iconFillAmount = instance.iconFillAmount; if (!(iconFillAmount > 0.001f) || !(iconFillAmount < 0.999f)) { return 0.0; } FieldInfo fieldInfo = FieldFor(((object)instance).GetType()); double num = ((fieldInfo != null) ? Convert.ToDouble(fieldInfo.GetValue(instance)) : ((double)instance.remainTime)); if (!(num > 0.0) || !(num < 100000.0)) { return 0.0; } return num; } private static FieldInfo FieldFor(Type type) { if (Fields.TryGetValue(type, out var value)) { return value; } List<FieldInfo> list = new List<FieldInfo>(); Type type2 = type; while (type2 != null && type2 != typeof(object)) { list.AddRange(from f in type2.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) where (f.FieldType == typeof(float) || f.FieldType == typeof(double)) && f.Name.IndexOf("remain", StringComparison.OrdinalIgnoreCase) >= 0 select f); type2 = type2.BaseType; } FieldInfo fieldInfo = list.FirstOrDefault((FieldInfo f) => f.Name.IndexOf("cooldown", StringComparison.OrdinalIgnoreCase) >= 0) ?? list.FirstOrDefault(); Fields[type] = fieldInfo; return fieldInfo; } } public sealed class EndScreenView : MonoBehaviour { private static EndScreenView _open; private Texture2D _photo; private Transform _container; private Vector3 _target; private AnimationCurve _curve; private float _time; private float _openedAt; public static bool IsOpen => (Object)(object)_open != (Object)null; public static bool Open(RunRecord run, Sprite portrait = null) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) Close(); GameBase instance = Scene<GameBase>.instance; object obj; if (instance == null) { obj = null; } else { UIManager uiManager = instance.uiManager; obj = ((uiManager != null) ? uiManager.gameResult : null); } GameResult val = (GameResult)obj; if ((Object)(object)val == (Object)null || ((Component)val).gameObject.activeSelf) { return false; } Canvas val2 = null; try { val2 = UiKit.OverlayCanvas("DamageInsight_EndScreen", 5300); ((Component)val2).gameObject.AddComponent<GraphicRaycaster>(); MatchGameCanvas(val, val2); ((Graphic)UiKit.Image("Dim", ((Component)val2).transform, new Color(0f, 0f, 0f, 0.8f))).rectTransform.Fill(); EndScreenView endScreenView = ((Component)val2).gameObject.AddComponent<EndScreenView>(); endScreenView.Build(val, ((Component)val2).transform, run, portrait); _open = endScreenView; MenuSounds.Play(MenuSounds.Kind.Select); return true; } catch (Exception arg) { Plugin.Log.LogWarning((object)$"End screen view failed: {arg}"); if ((Object)(object)val2 != (Object)null) { Object.Destroy((Object)(object)((Component)val2).gameObject); } _open = null; return false; } } public static void Close() { if (!((Object)(object)_open == (Object)null)) { EndScreenView open = _open; _open = null; if ((Object)(object)open._photo != (Object)null) { Object.Destroy((Object)(object)open._photo); } Object.Destroy((Object)(object)((Component)open).gameObject); } } private static void MatchGameCanvas(GameResult source, Canvas canvas) { //IL_0046: 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_005e: Unknown result type (might be due to invalid IL or missing references) //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) Canvas[] componentsInParent = ((Component)source).GetComponentsInParent<Canvas>(true); Canvas val = ((componentsInParent.Length != 0) ? componentsInParent[^1] : null); CanvasScaler val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent<CanvasScaler>() : null); CanvasScaler component = ((Component)canvas).GetComponent<CanvasScaler>(); if (!((Object)(object)val2 == (Object)null) && !((Object)(object)component == (Object)null)) { component.uiScaleMode = val2.uiScaleMode; component.referenceResolution = val2.referenceResolution; component.screenMatchMode = val2.screenMatchMode; component.matchWidthOrHeight = val2.matchWidthOrHeight; component.referencePixelsPerUnit = val2.referencePixelsPerUnit; canvas.referencePixelsPerUnit = val2.referencePixelsPerUnit; Plugin.Log.LogInfo((object)($"End screen view: game canvas {val2.uiScaleMode} {val2.referenceResolution} " + $"{val2.referencePixelsPerUnit} px/unit")); } } private void Build(GameResult source, Transform parent, RunRecord run, Sprite portrait) { //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (mi