using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using JetBrains.Annotations; using SpeedrunManager.Patches; using SpeedrunManager.UI; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("SpeedrunManager")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SpeedrunManager")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("031bb4ac-9b74-4f04-b34e-cb63952a95ae")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace SpeedrunManager { public enum BossNameEnum { [BossNameAttr("TrophyEikthyr", "$enemy_eikthyr")] Eikthyr, [BossNameAttr("TrophyTheElder", "$enemy_gdking")] gd_king, [BossNameAttr("TrophyBonemass", "$enemy_bonemass")] Bonemass, [BossNameAttr("TrophyDragonQueen", "$enemy_dragon")] Dragon, [BossNameAttr("TrophyGoblinKing", "$enemy_goblinking")] GoblinKing, [BossNameAttr("TrophySeekerQueen", "$enemy_seekerqueen")] SeekerQueen, [BossNameAttr("TrophyFader", "$enemy_fader")] Fader } internal class BossNameAttr : Attribute { public string translationKey { get; private set; } public string trophySpriteKey { get; private set; } internal BossNameAttr(string trophySpriteKey, string translationKey) { this.trophySpriteKey = trophySpriteKey; this.translationKey = translationKey; } } public static class BossNameFields { public static string GetTranslationKey(this BossNameEnum p) { BossNameAttr attr = GetAttr(p); return attr.translationKey; } public static string GetTrophySpriteKey(this BossNameEnum p) { BossNameAttr attr = GetAttr(p); return attr.trophySpriteKey; } private static BossNameAttr GetAttr(BossNameEnum p) { return (BossNameAttr)Attribute.GetCustomAttribute(ForValue(p), typeof(BossNameAttr)); } private static MemberInfo ForValue(BossNameEnum p) { return typeof(BossNameEnum).GetField(Enum.GetName(typeof(BossNameEnum), p)); } } public class SplitsCommands { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static ConsoleEvent <>9__0_0; public static ConsoleEvent <>9__0_1; internal void b__0_0(ConsoleEventArgs args) { BossNameEnum result; if (args.Args.Length < 3) { args.Context.AddString("Usage: speedrun_set_split "); } else if (Enum.TryParse(args.Args[1], out result)) { RegisterBossDefeatPatch.setupBossSplitTime(args.Args[1], args.Args[2], overwrite: true); Split split = new Split(result, args.Args[2]); SpeedrunTimer.AddSplitTimer(split); } } internal void b__0_1(ConsoleEventArgs args) { if (args.Args.Length < 1) { args.Context.AddString("Usage: speedrun_reset"); } else { if ((Object)(object)Player.m_localPlayer == (Object)null || (Object)(object)ZNet.instance == (Object)null) { return; } Dictionary dictionary = (Dictionary)ModUtils.GetPrivateValue(Player.m_localPlayer, "m_knownTexts"); List list = new List(); string worldName = ZNet.instance.GetWorldName(); foreach (string key in dictionary.Keys) { if (key.StartsWith("Turbero.SpeedrunManager_" + worldName)) { list.Add(key); } } foreach (string item in list) { dictionary.Remove(item); } } } } public static void RegisterConsoleCommand() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown object obj = <>c.<>9__0_0; if (obj == null) { ConsoleEvent val = delegate(ConsoleEventArgs args) { BossNameEnum result; if (args.Args.Length < 3) { args.Context.AddString("Usage: speedrun_set_split "); } else if (Enum.TryParse(args.Args[1], out result)) { RegisterBossDefeatPatch.setupBossSplitTime(args.Args[1], args.Args[2], overwrite: true); Split split = new Split(result, args.Args[2]); SpeedrunTimer.AddSplitTimer(split); } }; <>c.<>9__0_0 = val; obj = (object)val; } new ConsoleCommand("speedrun_set_split", "[boss_prefab_id] [timer_value]", (ConsoleEvent)obj, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj2 = <>c.<>9__0_1; if (obj2 == null) { ConsoleEvent val2 = delegate(ConsoleEventArgs args) { if (args.Args.Length < 1) { args.Context.AddString("Usage: speedrun_reset"); } else if (!((Object)(object)Player.m_localPlayer == (Object)null) && !((Object)(object)ZNet.instance == (Object)null)) { Dictionary dictionary = (Dictionary)ModUtils.GetPrivateValue(Player.m_localPlayer, "m_knownTexts"); List list = new List(); string worldName = ZNet.instance.GetWorldName(); foreach (string key in dictionary.Keys) { if (key.StartsWith("Turbero.SpeedrunManager_" + worldName)) { list.Add(key); } } foreach (string item in list) { dictionary.Remove(item); } } }; <>c.<>9__0_1 = val2; obj2 = (object)val2; } new ConsoleCommand("speedrun_reset", "", (ConsoleEvent)obj2, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); } } public enum SpeedrunType { Permadeath, InfiniteLives } public class DefaultUIPositions { public static readonly Vector2 positionTimer = new Vector2(885f, 20f); public static readonly int fontSizeTimer = 64; public static readonly Vector2 positionSplits = new Vector2(630f, 8f); public static readonly int fontSizeSplits = 20; public static readonly int splitsColumnSize = 4; public static readonly int splitsColumnsSpace = 0; public static readonly int splitsRowsSpace = 40; } internal class ConfigurationFile { public static ConfigEntry debug; public static ConfigEntry hotKey; public static ConfigEntry speedrunType; private static ConfigFile configFile; private static readonly string ConfigFileName = "Turbero.SpeedrunManager.cfg"; private static readonly string ConfigFileFullPath; public static ConfigEntry colorTimerAfterDyingInPermadeath; public static ConfigEntry countHuginnInitTravelAsPartOfTimer; public static ConfigEntry overrideBossSplitTimerIfKilledAgain; public static ConfigEntry effectsPerRow; public static ConfigEntry showTimer; public static ConfigEntry positionTimer; public static ConfigEntry colorTimer; public static ConfigEntry colorWidthTimer; public static ConfigEntry fontSizeTimer; public static ConfigEntry showSplits; public static ConfigEntry positionSplits; public static ConfigEntry colorSplits; public static ConfigEntry colorWidthSplits; public static ConfigEntry fontSizeSplits; public static ConfigEntry splitsColumnSize; public static ConfigEntry splitsColumnsSpace; public static ConfigEntry splitsRowsSpace; internal static void LoadConfig(BaseUnityPlugin plugin) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Expected O, but got Unknown //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Expected O, but got Unknown //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Expected O, but got Unknown //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Expected O, but got Unknown //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Expected O, but got Unknown //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Expected O, but got Unknown //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Expected O, but got Unknown //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Expected O, but got Unknown //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Expected O, but got Unknown //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Expected O, but got Unknown configFile = plugin.Config; debug = configFile.Bind("1 - General", "DebugMode", false, "Enabling/Disabling the debugging in the console (default = false)"); hotKey = configFile.Bind("1 - General", "Hotkey Panel", (KeyCode)121, "Key to show/hide the speedrun panel configuration"); speedrunType = configFile.Bind("2 - Configuration", "Speedrun Type", SpeedrunType.Permadeath, new ConfigDescription("Speedrun type", (AcceptableValueBase)null, Array.Empty())); countHuginnInitTravelAsPartOfTimer = configFile.Bind("2 - Configuration", "Count from Huginn Intro", false, new ConfigDescription("If active, the time will start since Huginn is taking you to the spawn, that's ~1min47seg (default = false)", (AcceptableValueBase)null, Array.Empty())); overrideBossSplitTimerIfKilledAgain = configFile.Bind("2 - Configuration", "Override Boss Split Timer if killed again", false, new ConfigDescription("Replaces the time the boss was killed in his split when it is killed again if this is enabled (default = false)", (AcceptableValueBase)null, Array.Empty())); effectsPerRow = configFile.Bind("2 - Configuration", "Effects Per Row", 7, new ConfigDescription("Effects Per Row", (AcceptableValueBase)(object)new AcceptableValueRange(1, 8), Array.Empty())); showTimer = configFile.Bind("3 - UI", "Show Timer", true, new ConfigDescription("Show/hide timer (still running while hidden)", (AcceptableValueBase)null, Array.Empty())); showSplits = configFile.Bind("3 - UI", "Show Splits", true, new ConfigDescription("Show/hide splits information", (AcceptableValueBase)null, Array.Empty())); positionTimer = configFile.Bind("3.1 - UI Timer", "Position", new Vector2(885f, 20f), new ConfigDescription("UI Timer position", (AcceptableValueBase)null, Array.Empty())); colorTimer = configFile.Bind("3.1 - UI Timer", "Color", new Color(0f, 1f, 0f), new ConfigDescription("UI Timer color", (AcceptableValueBase)null, Array.Empty())); colorWidthTimer = configFile.Bind("3.1 - UI Timer", "Color Intensity", 0.15f, new ConfigDescription("UI Timer color intensity (recommended between 0 and 0.5f)", (AcceptableValueBase)null, Array.Empty())); fontSizeTimer = configFile.Bind("3.1 - UI Timer", "Size", 64, new ConfigDescription("UI Timer size", (AcceptableValueBase)null, Array.Empty())); colorTimerAfterDyingInPermadeath = configFile.Bind("3.1 - UI Timer", "Timer Color After Dying In Permadeath", new Color(1f, 0f, 0f), "Timer color after dying for first time in permadeath mode"); positionSplits = configFile.Bind("3.2 - UI Splits", "Splits Position", new Vector2(630f, 8f), new ConfigDescription("UI Splits position", (AcceptableValueBase)null, Array.Empty())); colorSplits = configFile.Bind("3.2 - UI Splits", "Splits Color", Color.white, new ConfigDescription("UI Splits color", (AcceptableValueBase)null, Array.Empty())); colorWidthSplits = configFile.Bind("3.2 - UI Splits", "Splits Color Intensity", 0.05f, new ConfigDescription("UI Splits color intensity (recommended between 0 and 0.5f)", (AcceptableValueBase)null, Array.Empty())); fontSizeSplits = configFile.Bind("3.2 - UI Splits", "Splits Font Size", 20, new ConfigDescription("UI Splits size", (AcceptableValueBase)null, Array.Empty())); splitsColumnSize = configFile.Bind("3.2 - UI Splits", "Splits Column Size", 4, new ConfigDescription("UI Splits size", (AcceptableValueBase)(object)new AcceptableValueRange(4, 8), Array.Empty())); splitsColumnsSpace = configFile.Bind("3.2 - UI Splits", "Splits Columns Space", 0, new ConfigDescription("UI Splits Columns Space", (AcceptableValueBase)null, Array.Empty())); splitsRowsSpace = configFile.Bind("3.2 - UI Splits", "Splits Rows Space", 40, new ConfigDescription("UI Splits Rows Space", (AcceptableValueBase)null, Array.Empty())); SetupWatcher(); } private static void SetupWatcher() { FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, ConfigFileName); fileSystemWatcher.Changed += ReadConfigValues; fileSystemWatcher.Created += ReadConfigValues; fileSystemWatcher.Renamed += ReadConfigValues; fileSystemWatcher.IncludeSubdirectories = true; fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject; fileSystemWatcher.EnableRaisingEvents = true; } private static void ReadConfigValues(object sender, FileSystemEventArgs e) { if (!File.Exists(ConfigFileFullPath)) { return; } try { Logger.Log("Attempting to reload configuration..."); configFile.Reload(); SettingsChanged(null, null); } catch (Exception arg) { Logger.LogError($"There was an issue loading {ConfigFileName}, {arg}"); } } private static void SettingsChanged(object sender, EventArgs e) { if ((Object)(object)SpeedrunTimer._text != (Object)null) { Hud.instance.m_effectsPerRow = effectsPerRow.Value; SpeedrunTimer.UpdateVisibility(); SpeedrunTimer.UpdateTimer(); SpeedrunTimer.UpdateTimerUI(); SpeedrunTimer.DrawSplits(); } } static ConfigurationFile() { string configPath = Paths.ConfigPath; char directorySeparatorChar = Path.DirectorySeparatorChar; ConfigFileFullPath = configPath + directorySeparatorChar + ConfigFileName; } } public class ControllerUtils { public static void RemoveHint(Transform buttonGo, InventoryGui inventoryGui = null) { UIGamePad val = null; if (((Component)buttonGo).TryGetComponent(ref val)) { if (ZInput.instance == null) { ZInput.Initialize(); } ((TMP_Text)val.m_hint.GetComponentInChildren(true)).text = ""; } } public static void BindGamePad(Transform buttonGo, KeyCode gamepadKeyCode, InventoryGui inventoryGui = null) { //IL_0013: 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) //IL_005c: Unknown result type (might be due to invalid IL or missing references) UIGamePad val = null; if (((Component)buttonGo).TryGetComponent(ref val)) { string text = KeyCodeToString(gamepadKeyCode); if (ZInput.instance == null) { ZInput.Initialize(); } TextMeshProUGUI componentInChildren = val.m_hint.GetComponentInChildren(true); ZInput instance = ZInput.instance; ((TMP_Text)componentInChildren).text = ((instance != null) ? instance.GetBoundKeyString(text, true) : null); val.m_zinputKey = text; val.m_keyCode = gamepadKeyCode; UIGroupHandler value = default(UIGroupHandler); if ((Object)(object)inventoryGui != (Object)null && ((Component)inventoryGui.m_crafting).TryGetComponent(ref value)) { SetPrivateValue(val, "m_group", value); } } } private static void SetPrivateValue(object obj, string name, object value, BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic) { obj.GetType().GetField(name, bindingAttr)?.SetValue(obj, value); } public static string KeyCodeToString(KeyCode keyCode) { //IL_0001: 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_0009: Expected I4, but got Unknown int num = keyCode - 330; if (1 == 0) { } string result = num switch { 1 => "JoyButtonB", 2 => "JoyButtonX", 3 => "JoyButtonY", 4 => "JoyLBumper", 5 => "JoyRBumper", 6 => "JoyBack", 7 => "JoyStart", 8 => "JoyLStick", 9 => "JoyRStick", 10 => "JoyDPadLeft", 11 => "JoyDPadRight", 12 => "JoyDPadUp", 13 => "JoyDPadDown", 14 => "JoyLTrigger", 15 => "JoyRTrigger", 16 => "JoyButtonA", 17 => "JoyButtonB", 18 => "JoyButtonX", 19 => "JoyButtonY", _ => "JoyButtonA", }; if (1 == 0) { } return result; } } public static class Logger { public static ManualLogSource logger = Logger.CreateLogSource("Speedrun Manager"); internal static void Log(object s) { if (ConfigurationFile.debug.Value) { logger.LogInfo((object)s?.ToString()); } } internal static void LogInfo(object s) { logger.LogInfo((object)s?.ToString()); } internal static void LogWarning(object s) { string text = "Speedrun Manager 1.0.2: " + ((s != null) ? s.ToString() : "null"); Debug.LogWarning((object)text); } internal static void LogError(object s) { string text = "Speedrun Manager 1.0.2: " + ((s != null) ? s.ToString() : "null"); Debug.LogError((object)text); } } public class ModStatsUtils { public static Dictionary GetKnownTexts() { if ((Object)(object)Player.m_localPlayer == (Object)null) { return new Dictionary(); } return (Dictionary)ModUtils.GetPrivateValue(Player.m_localPlayer, "m_knownTexts"); } public static Dictionary GetStats() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown if ((Object)(object)Game.instance == (Object)null) { return new Dictionary(); } return ((PlayerProfile)(typeof(Game).GetField("m_playerProfile", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(Game.instance)))?.m_playerStats.m_stats; } public static string GetSpeedrunKnownTextKey(string name) { ZNet instance = ZNet.instance; string text = ((instance != null) ? instance.GetWorldName() : null); return "Turbero.SpeedrunManager_" + text + "_" + name; } public static string GetSpeedrunKnownTextValue(string name) { return ZDOHelper.GetValueOrDefaultPiktiv((IDictionary)GetKnownTexts(), GetSpeedrunKnownTextKey(name), (string)null); } public static void SetSpeedrunKnownTextKeyValue(string name, string value) { Dictionary knownTexts = GetKnownTexts(); string speedrunKnownTextKey = GetSpeedrunKnownTextKey(name); knownTexts.Remove(speedrunKnownTextKey); knownTexts.Add(speedrunKnownTextKey, value); } } public static class ModUtils { private static readonly Dictionary cachedSprites = new Dictionary(); private static readonly Dictionary cachedFonts = new Dictionary(); public static object GetPrivateValue(object obj, string name, BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic) { return obj.GetType().GetField(name, bindingAttr)?.GetValue(obj); } public static BossNameEnum parseBossName(string value) { Logger.Log("Parsing value: " + value); return (BossNameEnum)Enum.Parse(typeof(BossNameEnum), value, ignoreCase: true); } public static TMP_FontAsset getFontAsset(string name) { if (!cachedFonts.ContainsKey(name)) { Logger.Log("Finding " + name + " font..."); TMP_FontAsset[] array = Resources.FindObjectsOfTypeAll(); foreach (TMP_FontAsset val in array) { if (((Object)val).name == name) { Logger.Log(name + " font found."); cachedFonts.Add(name, val); return val; } } Logger.Log(name + " font NOT found."); return null; } return GeneralExtensions.GetValueSafe(cachedFonts, name); } public static Sprite getSprite(string name) { if (!cachedSprites.ContainsKey(name)) { Logger.Log("Finding " + name + " sprite..."); Sprite[] array = Resources.FindObjectsOfTypeAll(); foreach (Sprite val in array) { if (((Object)val).name == name) { Logger.Log(name + " sprite found."); cachedSprites.Add(name, val); return val; } } Logger.Log(name + " sprite NOT found."); return null; } return GeneralExtensions.GetValueSafe(cachedSprites, name); } } [BepInPlugin("Turbero.SpeedrunManager", "Speedrun Manager", "1.0.2")] public class SpeedrunManager : BaseUnityPlugin { [CompilerGenerated] private sealed class d__7 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public SpeedrunManager <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (ZRoutedRpc.instance == null || (Object)(object)ZNet.instance == (Object)null) { <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } SplitsCommands.RegisterConsoleCommand(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const string GUID = "Turbero.SpeedrunManager"; public const string NAME = "Speedrun Manager"; public const string VERSION = "1.0.2"; private readonly Harmony harmony = new Harmony("Turbero.SpeedrunManager"); private void Awake() { ConfigurationFile.LoadConfig((BaseUnityPlugin)(object)this); harmony.PatchAll(); } private void onDestroy() { harmony.UnpatchSelf(); } private void Start() { ((MonoBehaviour)this).StartCoroutine(WaitForNetworking()); } [IteratorStateMachine(typeof(d__7))] private IEnumerator WaitForNetworking() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this }; } private void Update() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Player.m_localPlayer) || InventoryGui.IsVisible() || !Object.op_Implicit((Object)(object)Hud.instance) || !SpeedrunConfigPanel.IsCreated()) { return; } if (Input.GetKeyDown((KeyCode)27) && SpeedrunConfigPanel.IsVisible()) { SpeedrunConfigPanel.Hide(hideMenu: false); } if ((Input.GetKeyDown((KeyCode)271) || Input.GetKeyDown((KeyCode)13) || ((Character)Player.m_localPlayer).IsDead()) && SpeedrunConfigPanel.IsVisible()) { SpeedrunConfigPanel.Hide(); } if (!Input.GetKeyDown(ConfigurationFile.hotKey.Value)) { return; } if (SpeedrunConfigPanel.IsVisible()) { SpeedrunConfigPanel.Hide(); } else if (CanShowSpeedrunConfigPanel()) { if (!SpeedrunConfigPanel.IsCreated()) { SpeedrunConfigPanel.Create(); } SpeedrunConfigPanel.Show(); } } private static bool CanShowSpeedrunConfigPanel() { return (Object)(object)Player.m_localPlayer != (Object)null && (((Character)Player.m_localPlayer).CanMove() || ((Character)Player.m_localPlayer).IsSitting()) && !Game.IsPaused() && !InventoryGui.IsVisible() && !Console.IsVisible() && !((Component)((Component)Hud.instance).transform.parent.Find("Chat_box/root/ChatInput")).gameObject.activeSelf && !((Component)((Component)Game.instance).transform.Find("LoadingGUI/PixelFix/IngameGui/TextInput/panel")).gameObject.activeSelf && !((Component)((Component)Minimap.instance).transform.Find("large")).gameObject.activeSelf && !StoreGui.instance.m_rootPanel.activeSelf; } } [HarmonyPatch(typeof(Player), "GetKnownTexts")] public class FixCompendium { public static void Postfix(ref List> __result) { __result = __result.Where((KeyValuePair p) => !p.Key.StartsWith("Turbero.SpeedrunManager")).ToList(); } } } namespace SpeedrunManager.UI { public class ResetConfirmDialog { public GameObject resetConfirmDialog; public ResetConfirmDialog() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) Logger.Log("Creating resetConfirmDialog..."); resetConfirmDialog = Object.Instantiate(GameObject.Find("_GameMain/LoadingGUI/PixelFix/IngameGui/Menu/MenuRoot/ExitConfirm"), ((Component)Menu.instance).transform); ((Object)resetConfirmDialog).name = "ResetConfirmDialog"; UIGroupHandler componentInChildren = resetConfirmDialog.GetComponentInChildren(); ((TMP_Text)((Component)((Component)componentInChildren).transform.Find("Exit")).GetComponentInChildren()).text = "Confirm?"; Button[] componentsInChildren = ((Component)componentInChildren).GetComponentsInChildren