diff --git a/Reactor.Debugger/DebuggerPlugin.cs b/Reactor.Debugger/DebuggerPlugin.cs index 61e2a48..9a659d6 100644 --- a/Reactor.Debugger/DebuggerPlugin.cs +++ b/Reactor.Debugger/DebuggerPlugin.cs @@ -32,11 +32,6 @@ namespace Reactor.Debugger GameOptionsData.MinPlayers = Enumerable.Repeat(1, 4).ToArray(); Harmony.PatchAll(); - - Extensions.Extensions.once_sceneLoaded((_, _) => - { - Dumping.Dump(); - }); } [RegisterInIl2Cpp] @@ -101,18 +96,4 @@ namespace Reactor.Debugger } } } - - // [HarmonyPatch] - // public static class TracePatch - // { - // public static IEnumerable TargetMethods() - // { - // return typeof(AmongUsClient).GetMethods(AccessTools.all).Where(x => x.ReturnType == typeof(Il2CppStructArray) && !x.GetParameters().Any()); - // } - // - // public static void Postfix(MethodBase __originalMethod) - // { - // PluginSingleton.Instance.Log.LogInfo(__originalMethod.FullDescription()); - // } - // } } diff --git a/Reactor.Debugger/Dumping.cs b/Reactor.Debugger/Dumping.cs deleted file mode 100644 index dd55485..0000000 --- a/Reactor.Debugger/Dumping.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using BepInEx; -using UnityEngine; - -namespace Reactor.Debugger -{ - public static class Dumping - { - public static string DumpPath { get; } = Path.Combine(Paths.PluginPath, "dump"); - - public static void Dump() - { - Directory.CreateDirectory(DumpPath); - - WritePalette(); - WriteEnum("Hat", HatManager.Instance.AllHats.ToArray().Select(hat => hat.name)); - WriteEnum("Pet", HatManager.Instance.AllPets.ToArray().Select(hat => hat.name)); - WriteEnum("Skin", HatManager.Instance.AllSkins.ToArray().Select(hat => hat.name)); - } - - private static void WritePalette() - { - var builder = new StringBuilder(); - - builder.AppendLine("public static class Palette"); - builder.AppendLine("{"); - - foreach (var propertyInfo in typeof(Palette).GetProperties()) - { - if (propertyInfo.GetMethod == null || !propertyInfo.GetMethod.IsStatic) - continue; - - var value = propertyInfo.GetValue(null); - - if (value is Color f) - { - value = (Color32) f; - } - - if (value is Color32 color) - { - builder.AppendLine($" public static readonly Color {propertyInfo.Name} = Color.FromArgb({(color.a != byte.MaxValue ? $"{color.a}, " : string.Empty)}{color.r}, {color.g}, {color.b});"); - } - } - - builder.AppendLine("}"); - - File.WriteAllText(Path.Combine(DumpPath, $"Palette.cs"), builder.ToString()); - } - - private static void WriteEnum(string name, IEnumerable values) - { - var builder = new StringBuilder(); - - builder.AppendLine("public enum " + name); - builder.AppendLine("{"); - - foreach (var value in values) - { - builder.AppendLine(" " + value.Replace(" ", "").Replace("'", "") + ","); - } - - builder.AppendLine("}"); - - File.WriteAllText(Path.Combine(DumpPath, $"{name}.cs"), builder.ToString()); - } - } -} diff --git a/Reactor.Debugger/Patches/Test.cs b/Reactor.Debugger/Patches.cs similarity index 95% rename from Reactor.Debugger/Patches/Test.cs rename to Reactor.Debugger/Patches.cs index 01fc602..3e67e3a 100644 --- a/Reactor.Debugger/Patches/Test.cs +++ b/Reactor.Debugger/Patches.cs @@ -1,8 +1,8 @@ using HarmonyLib; -namespace Reactor.Debugger.Patches +namespace Reactor.Debugger { - public static class Test + internal static class Patches { [HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Update))] public static class UpdatePatch