diff --git a/BoneSync/Data/Debugger.cs b/BoneSync/Data/Debugger.cs index ccc471a..76c4534 100644 --- a/BoneSync/Data/Debugger.cs +++ b/BoneSync/Data/Debugger.cs @@ -10,10 +10,10 @@ namespace BoneSync.Data { internal static class SyncLogger { - public static void Msg(string message, ConsoleColor color = ConsoleColor.White) + public static void Msg(string message, ConsoleColor color = ConsoleColor.White, int frame = 1) { StackTrace stackTrace = new StackTrace(); - StackFrame stackFrame = stackTrace.GetFrame(1); + StackFrame stackFrame = stackTrace.GetFrame(frame); string methodName = stackFrame.GetMethod().Name; string className = stackFrame.GetMethod().DeclaringType.Name; MelonLogger.Msg(color, $"[{className}.{methodName}] {message}"); @@ -21,18 +21,18 @@ namespace BoneSync.Data public static void Warning(string message) { - Msg(message, ConsoleColor.Yellow); + Msg(message, ConsoleColor.Yellow, 2); } public static void Error(string message) { - Msg(message, ConsoleColor.Red); + Msg(message, ConsoleColor.Red, 2); } internal static void Debug(string v) { -#if TRACE - Msg(v, ConsoleColor.Gray); +#if DEBUG + Msg(v, ConsoleColor.Gray, 2); #endif } } diff --git a/BoneSync/Patching/ZonePatches.cs b/BoneSync/Patching/ZonePatches.cs index 5de4c71..cdcd4e7 100644 --- a/BoneSync/Patching/ZonePatches.cs +++ b/BoneSync/Patching/ZonePatches.cs @@ -62,7 +62,7 @@ namespace BoneSync.Patching [HarmonyPatch(typeof(SceneZone))] public static class SceneZonePatch { - /*[HarmonyPatch(nameof(SceneZone.OnTriggerEnter)), HarmonyPrefix] + [HarmonyPatch(nameof(SceneZone.OnTriggerEnter)), HarmonyPrefix] public static bool EnterPrefix(SceneZone __instance, Collider other) { if (other.CompareTag("Player")) @@ -72,7 +72,7 @@ namespace BoneSync.Patching return true; } - */ + [HarmonyPatch(nameof(SceneZone.OnTriggerExit)), HarmonyPrefix] public static bool ExitPrefix(SceneZone __instance, Collider other) { @@ -88,7 +88,7 @@ namespace BoneSync.Patching [HarmonyPatch(typeof(PlayerTrigger))] public static class PlayerTriggerPatch { - /*[HarmonyPatch(nameof(PlayerTrigger.OnTriggerEnter)), HarmonyPrefix] + [HarmonyPatch(nameof(PlayerTrigger.OnTriggerEnter)), HarmonyPrefix] public static bool EnterPrefix(PlayerTrigger __instance, Collider other) { if (other.CompareTag("Player")) @@ -98,7 +98,7 @@ namespace BoneSync.Patching } return true; - }*/ + } // only patch exit, as we want to allow activating a trigger always [HarmonyPatch(nameof(PlayerTrigger.OnTriggerExit)), HarmonyPrefix]