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.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Logging; using Febucci.UI; using Febucci.UI.Core; using Febucci.UI.Effects; using HarmonyLib; using InfoSkull.builtin; using InfoSkull.builtin.handlers; using InfoSkull.config; using InfoSkull.config.conversions; using InfoSkull.config.profiles; using InfoSkull.config.profiles.elements; using InfoSkull.core; using InfoSkull.core.components; using InfoSkull.core.menu; using InfoSkull.patches; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")] [assembly: AssemblyCompany("InfoSkull")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.1.2.0")] [assembly: AssemblyInformationalVersion("2.1.2+7063b3237b8f8557dea109a1f788ea83a1092a6f")] [assembly: AssemblyProduct("InfoSkull")] [assembly: AssemblyTitle("InfoSkull")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.1.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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 InfoSkull { public class Timer { public static float levelEnterTime; public static float realTime; public static void completeRoom(M_Level level) { float num = currentLevelTime(); string text = "info-skull-" + level.levelName + "-best-time"; StatManager.sessionStats.UpdateStatistic(text, (object)num, (DataType)2, (ModType)3, (DisplayType)4, (ModType)3); levelEnterTime = CL_GameManager.gMan.GetGameTime(); } public static float currentLevelTime() { return CL_GameManager.gMan.GetGameTime() - levelEnterTime; } public static float bestLevelTime(M_Level level) { string text = "info-skull-" + level.levelName + "-best-time"; string value = StatManager.sessionStats.GetStatistic(text).value; string value2 = StatManager.saveData.gameStats.GetStatistic(text).value; if (value == "") { if (!(value2 == "")) { return float.Parse(value2); } return 0f; } if (value2 == "") { return float.Parse(value); } if (!(float.Parse(value) > float.Parse(value2))) { return float.Parse(value); } return float.Parse(value2); } } [BepInPlugin("de.tamion.infoskull", "InfoSkull", "2.1.2")] public class InfoSkullPlugin : BaseUnityPlugin { private const string GUID = "de.tamion.infoskull"; private const string NAME = "InfoSkull"; public const string VERSION = "2.1.2"; public static InfoSkullPlugin instance; internal static ManualLogSource logger; private static Harmony harmony; private void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown instance = this; logger = ((BaseUnityPlugin)this).Logger; harmony = new Harmony("de.tamion.infoskull"); harmony.PatchAll(); InfoSkull.core.InfoSkull.init(); InfoSkullBuiltins.init(); logger.LogInfo((object)"InfoSkull has been loaded!"); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "InfoSkull"; public const string PLUGIN_NAME = "InfoSkull"; public const string PLUGIN_VERSION = "2.1.2"; } } namespace InfoSkull.core { public abstract class ElementHandler : MonoBehaviour { public abstract void init(ElementController controller); public virtual void openAdjustUI() { } public virtual void closeAdjustUI() { } public virtual bool isLeaderboardLegal() { return true; } } public class ElementType { internal string name; internal Action onInstantiateAction; internal Func creator; internal bool _allowCreation = true; public static ElementType create(string name) { return new ElementType { name = name }; } public ElementType onInstantiate(Action onInstantiate) { onInstantiateAction = (Action)Delegate.Combine(onInstantiateAction, onInstantiate); return this; } public ElementType objectCreator(Func creator) { this.creator = creator; return this; } public ElementType allowCreationByMenu(bool allowCreation) { _allowCreation = allowCreation; return this; } public ElementType register() { InfoSkull.registerType(this); return this; } } public class InfoSkull { [CompilerGenerated] private sealed class d__7 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: <>1__state = -1; elements.Clear(); RadialMenu.init(); onInitElements(); Config.instance.profiles[Config.instance.selectedProfile].elements.ForEach(delegate(ElementConfig element) { try { instantiateType(registeredTypes[element.type], element, save: false); } catch (Exception) { } }); Config.instance.save(); checkLeaderboard(); 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(); } } internal static Dictionary registeredTypes = new Dictionary(); public static List elements = new List(); public static Action onInitElements; public static bool isAdjustingUI; internal static void init() { Config.init(); callbacks(); } private static void callbacks() { SceneManager.sceneLoaded += delegate { GameObject val = GameObject.Find("Canvas"); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)GameObject.Find("GameManager"))) { ((MonoBehaviour)val.GetComponent()).StartCoroutine(initElements()); } }; } public static void selectProfile(int index) { if (index < 0 || index >= Config.instance.profiles.Count) { throw new Exception($"Profile index {index} is out of range"); } for (int num = elements.Count - 1; num >= 0; num--) { elements[num].liveUnload(); } Config.instance.selectedProfile = index; GameObject val = GameObject.Find("Canvas"); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)GameObject.Find("GameManager"))) { ((MonoBehaviour)val.GetComponent()).StartCoroutine(initElements()); } } [IteratorStateMachine(typeof(d__7))] public static IEnumerator initElements() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0); } public static void checkLeaderboard() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) CL_GameManager.gamemode.allowLeaderboardScoring = elements.All((ElementController element) => element.handlers.All((ElementHandler handler) => handler.isLeaderboardLegal())) && !CL_GameManager.HasActiveFlag("leaderboardIllegal", false) && CL_GameManager.gamemode.allowLeaderboardScoring; if (!CL_GameManager.gamemode.allowLeaderboardScoring) { Scene sceneByName = SceneManager.GetSceneByName("Main-Menu"); if (!((Scene)(ref sceneByName)).isLoaded) { GameManagerPatchBuiltin.highScoreQueue = "SESSION IS LEADERBOARD ILLEGAL"; CL_GameManager.SetGameFlag("leaderboardIllegal", true, "", false, false); } } } internal static void openAdjustUI() { GameObject.Find("Pause Menu").SetActive(false); isAdjustingUI = true; foreach (ElementController element in elements) { try { element.openAdjustUI(); } catch (Exception) { } } } internal static void disableAdjustUI() { foreach (ElementController element in elements) { try { element.closeAdjustUI(); } catch (Exception) { } } isAdjustingUI = false; Config.instance.save(); RadialMenu.instance.hideMenu(); checkLeaderboard(); } public static void registerType(ElementType type) { if (registeredTypes.ContainsKey(type.name)) { throw new Exception("Type " + type.name + " is already registered"); } registeredTypes[type.name] = type; } public static ElementController instantiateType(ElementType type, ElementConfig config = null, bool save = true) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (!registeredTypes.ContainsKey(type.name)) { throw new Exception("Type " + type.name + " is not registered"); } if (config == null) { config = ElementConfig.create(type.name, new Dictionary()); if (save) { Config.instance.profiles[Config.instance.selectedProfile].elements.Add(config); } } object obj = ((type.creator != null) ? ((object)type.creator(config)) : ((object)new GameObject(type.name))); ((GameObject)obj).transform.parent = GameObject.Find("Game UI").transform; ElementController elementController = ((GameObject)obj).AddComponent(); elementController.init(type, config); type.onInstantiateAction(elementController); elements.Add(elementController); if (isAdjustingUI) { elementController.openAdjustUI(); } return elementController; } } } namespace InfoSkull.core.patches { [HarmonyPatch(typeof(CL_GameManager))] public class GameManagerPatch { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__0_0; internal void b__0_0() { InfoSkull.openAdjustUI(); } } [HarmonyPatch("Pause")] [HarmonyPostfix] public static void postfixPause() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown GameObject val = GameObject.Find("Report Bug"); if (!Object.op_Implicit((Object)(object)val) || Object.op_Implicit((Object)(object)GameObject.Find("Adjust UI"))) { return; } GameObject obj = Object.Instantiate(val, new Vector3((float)Screen.width - val.transform.position.x, val.transform.position.y, 0f), Quaternion.identity, GameObject.Find("Pause Buttons").transform); ((Object)obj).name = "Adjust UI"; Button component = obj.GetComponent