local only trigger
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user