using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Threading; using System.Threading.Tasks; using BepInEx; using BepInEx.Logging; using Microsoft.CodeAnalysis; using PluginConfig.API; using PluginConfig.API.Decorators; using PluginConfig.API.Fields; using PluginConfig.API.Functionals; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Preloading_Splash")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1")] [assembly: AssemblyProduct("Preloading Splash")] [assembly: AssemblyTitle("Preloading_Splash")] [assembly: AssemblyVersion("1.0.1.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Preloading_Splash { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.triggeredidiot.preloadingsplash", "Preloading Splash", "1.0.1")] public class Plugin : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__5_0; public static OnClick <>9__5_2; internal void b__5_0(Scene _, LoadSceneMode _) { SplashWindow.Close = true; } internal void b__5_2() { Application.OpenURL("file://" + SplashWindow.CoversPath); } } private PluginConfigurator config; internal static ManualLogSource Logger { get; private set; } private void Awake() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_00e7: 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_00fa: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Expected O, but got Unknown //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Expected O, but got Unknown //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Expected O, but got Unknown //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Expected O, but got Unknown //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Expected O, but got Unknown //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Expected O, but got Unknown //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; SceneManager.sceneLoaded += delegate { SplashWindow.Close = true; }; config = PluginConfigurator.Create("Preloading Splash", "com.triggeredidiot.preloadingsplash"); string location = Assembly.GetExecutingAssembly().Location; config.SetIconWithURL("file://" + Path.Combine(Path.GetDirectoryName(location) ?? Path.Combine(Paths.PluginPath, "PreloadingSplash"), "icon.png")); ConfigPanel val = new ConfigPanel(config.rootPanel, "Open Help", "infopanel"); new ConfigHeader(val, "The covers folder has 2 modes", 24); new ConfigHeader(val, "Mode 1:", 24); new ConfigHeader(val, " place ONLY PNGS in the covers folder", 24); new ConfigHeader(val, " splash screen then picks a random image from the folder", 24); new ConfigHeader(val, "Mode 2:", 24); new ConfigHeader(val, " place ONLY GIFs in the covers folder", 24); new ConfigHeader(val, " splash screen then picks a random gif from the folder", 24); new ConfigHeader(config.rootPanel, "It is recommended you open and read the help screen before adding custom covers", 24); ButtonField val2 = new ButtonField(config.rootPanel, "Open Covers folder", "coversbtn"); ButtonField previewBtn = new ButtonField(config.rootPanel, "Preview splash", "splashpreview"); ConfigHeader previewNotice = new ConfigHeader(config.rootPanel, "May be hidden as a sub-window of ultrakill or loading the gif, its recommended to not be in fullscreen while previewing", 24); ((ConfigField)previewNotice).hidden = true; BoolField loadingBar = new BoolField(config.rootPanel, "Show Loading Bar", "loadingbar", true); BoolField loadingText = new BoolField(config.rootPanel, "Show Loading Text", "loadingbartext", true); FloatSliderField textScale = new FloatSliderField(config.rootPanel, "Loading Text Scale", "textscale", new Tuple(8f, 64f), 16f); FloatSliderField scale = new FloatSliderField(config.rootPanel, "Splash screen scale", "scale", new Tuple(0.1f, 0.85f), 0.3f); ((ConfigField)new ConfigHeader(config.rootPanel, "Can't change fps in gif mode", 24)).hidden = true; FloatSliderField fps = new FloatSliderField(config.rootPanel, "Cover Framerate", "fps", new Tuple(0f, 60f), 0f); ((ConfigField)fps).hidden = true; BoolField forcewait = new BoolField(config.rootPanel, "Force animation before loading game", "forcewait", false); new ConfigHeader(config.rootPanel, "Requires one loop to play before the game can finish loading", 24); new ConfigHeader(config.rootPanel, "Doesn't do anything for static covers", 24); ((ConfigField)forcewait).interactable = true; object obj = <>c.<>9__5_2; if (obj == null) { OnClick val3 = delegate { Application.OpenURL("file://" + SplashWindow.CoversPath); }; <>c.<>9__5_2 = val3; obj = (object)val3; } val2.onClick += (OnClick)obj; SplashWindow currentPreviewWindow = null; bool previewMode = false; previewBtn.onClick += (OnClick)delegate { if (currentPreviewWindow == null || currentPreviewWindow.Loaded || !currentPreviewWindow.IsAlive) { Save(); previewMode = !previewMode; if (previewMode) { ((ConfigField)previewNotice).hidden = false; previewBtn.text = "Close splash"; SplashWindow.TestMode = true; SplashWindow.Close = false; Task.Run(delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown currentPreviewWindow = new SplashWindow(); currentPreviewWindow = null; }).ContinueWith(delegate(Task task) { currentPreviewWindow = null; Logger.LogError((object)task.Exception); }, TaskContinuationOptions.OnlyOnFaulted); } else { ((ConfigField)previewNotice).hidden = true; previewBtn.text = "Preview splash"; SplashWindow.Close = true; while (currentPreviewWindow != null) { Thread.Sleep(10); } } } }; config.postConfigChange += new PostConfigChangeEvent(Save); Application.quitting += Save; Logger.LogInfo((object)"Plugin com.triggeredidiot.preloadingsplash is loaded! (well technically the prepatcher should have ran before the main plugin but whatever)"); ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; void Save() { SplashWindow.SaveConfig(fps.value, loadingBar.value, loadingText.value, textScale.value, scale.value, forcewait.value, true); } } } internal static class MyPluginInfo { public const string PLUGIN_GUID = "com.triggeredidiot.preloadingsplash"; public const string PLUGIN_NAME = "Preloading Splash"; public const string PLUGIN_VERSION = "1.0.1"; } }