using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("845AD")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("845AD")] [assembly: AssemblyTitle("845AD")] [assembly: AssemblyVersion("1.0.0.0")] [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 AD845 { [BepInPlugin("com.845ad.loadingscreen", "845AD Loading Screen", "1.0.0")] public class AD845LoadingScreen : BaseUnityPlugin { public static Texture2D Background; private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("com.845ad.loadingscreen"); val.PatchAll(); LoadBackground(); } private void LoadBackground() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown string text = Paths.PluginPath + "/845AD/assets/background.png"; if (!File.Exists(text)) { ((BaseUnityPlugin)this).Logger.LogError((object)("Background not found: " + text)); return; } byte[] array = File.ReadAllBytes(text); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); Assembly assembly = typeof(Texture2D).Assembly; Type type = assembly.GetType("UnityEngine.ImageConversion"); if (type == null) { ((BaseUnityPlugin)this).Logger.LogError((object)"UnityEngine.ImageConversion type not found."); return; } MethodInfo method = type.GetMethod("LoadImage", new Type[3] { typeof(Texture2D), typeof(byte[]), typeof(bool) }); if (method == null) { ((BaseUnityPlugin)this).Logger.LogError((object)"LoadImage(Texture2D, byte[], bool) not found."); return; } method.Invoke(null, new object[3] { val, array, false }); Background = val; } } [HarmonyPatch(typeof(Menu), "Update")] public class Patch_LoadingScreen { private static float smoothProgress; private static float targetProgress; private static float glowTimer; private static void Postfix(Menu __instance) { if (!((Object)(object)AD845LoadingScreen.Background == (Object)null)) { targetProgress += Time.deltaTime / 20f; targetProgress = Mathf.Clamp01(targetProgress); DrawBackground(); DrawProgressBar(targetProgress); DrawText(); } } private static void DrawBackground() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), (Texture)(object)AD845LoadingScreen.Background); } private static void DrawText() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(GUI.skin.label); val.fontSize = 28; val.normal.textColor = Color.white; val.alignment = (TextAnchor)7; GUI.Label(new Rect(0f, (float)(Screen.height - 140), (float)Screen.width, 50f), "Loading 845AD…", val); } private static void DrawProgressBar(float rawProgress) { //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Expected O, but got Unknown //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) smoothProgress = Mathf.Lerp(smoothProgress, rawProgress, Time.deltaTime * 5f); glowTimer += Time.deltaTime * 1.8f; float num = (Mathf.Sin(glowTimer) + 1f) * 0.5f; float num2 = (float)Screen.width * 0.55f; float num3 = 34f; float num4 = ((float)Screen.width - num2) / 2f; float num5 = (float)Screen.height - 95f; Color color = default(Color); ((Color)(ref color))..ctor(0.05f, 0.05f, 0.05f, 0.85f); Color color2 = default(Color); ((Color)(ref color2))..ctor(0.35f, 0.25f, 0.1f, 0.9f); Color color3 = default(Color); ((Color)(ref color3))..ctor(0.2f, 0.55f, 1f, 0.95f); Color color4 = default(Color); ((Color)(ref color4))..ctor(0.5f, 0.8f, 1f, num * 0.35f); Color color5 = default(Color); ((Color)(ref color5))..ctor(1f, 0.55f, 0.1f, 0.25f); GUI.color = color; GUI.DrawTexture(new Rect(num4, num5, num2, num3), (Texture)(object)Texture2D.whiteTexture); GUI.color = color2; GUI.DrawTexture(new Rect(num4, num5, num2, 3f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(num4, num5 + num3 - 3f, num2, 3f), (Texture)(object)Texture2D.whiteTexture); GUI.color = color5; GUI.DrawTexture(new Rect(num4 - 10f, num5 - 5f, num2 + 20f, num3 + 10f), (Texture)(object)Texture2D.whiteTexture); GUI.color = color3; GUI.DrawTexture(new Rect(num4, num5, num2 * Mathf.Clamp01(smoothProgress), num3), (Texture)(object)Texture2D.whiteTexture); GUI.color = color4; GUI.DrawTexture(new Rect(num4, num5, num2 * Mathf.Clamp01(smoothProgress), num3), (Texture)(object)Texture2D.whiteTexture); GUI.color = new Color(1f, 1f, 1f, 0.12f); GUI.DrawTexture(new Rect(num4, num5, num2 * Mathf.Clamp01(smoothProgress), num3 / 2f), (Texture)(object)Texture2D.whiteTexture); GUI.color = Color.white; GUIStyle val = new GUIStyle(GUI.skin.label); val.fontSize = 26; val.normal.textColor = new Color(0.85f, 0.85f, 0.85f, 1f); val.alignment = (TextAnchor)4; GUI.Label(new Rect(num4, num5 - 32f, num2, 30f), $"{Mathf.RoundToInt(smoothProgress * 100f)}%", val); } } }