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 UltrakillModLib; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("UltrakillModLib")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("UltrakillModLib")] [assembly: AssemblyTitle("UltrakillModLib")] [assembly: AssemblyVersion("1.0.0.0")] 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; } } } namespace UltrakillModLib { public class DebugLog { private bool _isDebug = false; private ConsoleColor _prefixColor; private string _modName; public DebugLog(string name, ConsoleColor prefixColor, bool isDebug = false) { _modName = name; _prefixColor = prefixColor; _isDebug = isDebug; } public void LogDebug(string msg) { if (_isDebug) { WriteLine(msg, ConsoleColor.Cyan); } } public void Log(string msg) { WriteLine(msg, ConsoleColor.DarkCyan); } public void WritePrefix() { Write("[" + _modName + "]: ", _prefixColor); } private void Write(string msg, ConsoleColor color) { Type type = AccessTools.TypeByName("BepInEx.ConsoleManager"); MethodInfo methodInfo = AccessTools.Method(type, "SetConsoleColor", (Type[])null, (Type[])null); PropertyInfo propertyInfo = AccessTools.Property(type, "ConsoleStream"); TextWriter textWriter = (TextWriter)propertyInfo.GetValue(null); methodInfo.Invoke(null, new object[1] { color }); textWriter?.Write(msg); methodInfo.Invoke(null, new object[1] { ConsoleColor.Gray }); } public void WriteLine(string msg, ConsoleColor color) { WritePrefix(); Write(msg + "\n", color); } public void WarnDebug(string msg) { if (_isDebug) { WriteLine("(WARNING) " + msg, ConsoleColor.DarkYellow); } } public void Warn(string msg) { WriteLine("(WARNING) " + msg, ConsoleColor.Yellow); } public void Error(string msg) { WriteLine("(ERROR) " + msg, ConsoleColor.Red); } } } namespace UltrakillLayerConfigurator { [BepInPlugin("net.zephyr.ultrakill.GOOPYlib", "GOOPYlib", "1.0.0")] public class LayerPlugin : BaseUnityPlugin { private static readonly bool IS_DEBUG = true; internal static DebugLog Log = null; private const string ModName = "GOOPYlib"; public static LayerPlugin Instance { get; private set; } = null; public LayerPlugin() { Instance = this; } 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("net.zephyr.ultrakill.LayerConfigurator"); Log = new DebugLog("GOOPYlib", ConsoleColor.Cyan); Log.Log("The goop is in the bag."); } private void Update() { } } }