-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
116 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using HarmonyLib; | ||
|
||
namespace LabratEyeTracking | ||
{ | ||
public class HarmonyHelper | ||
{ | ||
public static class initcache | ||
{ | ||
public static bool hasinit; | ||
} | ||
|
||
class discordPatch | ||
{ | ||
[HarmonyPatch(typeof(discordManager), "updateDiscord")] | ||
[HarmonyPostfix] | ||
static void updateDiscord() | ||
{ | ||
if (!initcache.hasinit) | ||
{ | ||
MainMod.currentEyeTrackingRuntime?.Init(); | ||
initcache.hasinit = true; | ||
} | ||
} | ||
} | ||
|
||
public static void Patch() | ||
{ | ||
Harmony.CreateAndPatchAll(typeof(discordPatch)); | ||
LogHelper.Debug("Patched Harmony!"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using BepInEx.Logging; | ||
using UnityEngine; | ||
using Logger = BepInEx.Logging.Logger; | ||
|
||
namespace LabratEyeTracking | ||
{ | ||
public class LogHelper | ||
{ | ||
public static void Debug(object message) => UnityEngine.Debug.Log("[LabratEyeTracking] (DEBUG): " + message); | ||
public static void Warn(object message) => UnityEngine.Debug.LogWarning("[LabratEyeTracking] (WARN): " + message); | ||
public static void Error(object message) => UnityEngine.Debug.LogError("[LabratEyeTracking] (ERROR): " + message); | ||
public static void Critical(object message) => UnityEngine.Debug.LogError("[LabratEyeTracking] (CRITICAL): " + message); | ||
private static readonly ManualLogSource _logger = Logger.CreateLogSource("LabratEyeTracking"); | ||
|
||
public static void Debug(object message) => _logger.Log(LogLevel.Info, "[LabratEyeTracking] (DEBUG): " + message); | ||
public static void Warn(object message) => _logger.LogWarning("[LabratEyeTracking] (WARN): " + message); | ||
public static void Error(object message) => _logger.LogError("[LabratEyeTracking] (ERROR): " + message); | ||
public static void Critical(object message) => _logger.LogError("[LabratEyeTracking] (CRITICAL): " + message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters