diff --git a/BepInEx/BepInEx.csproj b/BepInEx/BepInEx.csproj index aac333d..f217d5d 100644 --- a/BepInEx/BepInEx.csproj +++ b/BepInEx/BepInEx.csproj @@ -70,6 +70,7 @@ + diff --git a/BepInEx/Chainloader.cs b/BepInEx/Chainloader.cs index 84ae79b..4b95ac5 100644 --- a/BepInEx/Chainloader.cs +++ b/BepInEx/Chainloader.cs @@ -18,18 +18,6 @@ namespace BepInEx public static GameObject ManagerObject { get; protected set; } = new GameObject("BepInEx_Manager"); - - public delegate void EntryLoggedEventHandler(string entry, bool show = false); - - public static event EntryLoggedEventHandler EntryLogged; - - - public static void Log(string entry, bool show = false) - { - EntryLogged?.Invoke(entry, show); - } - - public static void Initialize() { if (loaded) diff --git a/BepInEx/Logger.cs b/BepInEx/Logger.cs new file mode 100644 index 0000000..bb761fa --- /dev/null +++ b/BepInEx/Logger.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BepInEx +{ + public static class BepInLogger + { + public delegate void EntryLoggedEventHandler(string entry, bool show = false); + + public static event EntryLoggedEventHandler EntryLogged; + + + public static void Log(string entry, bool show = false) + { + EntryLogged?.Invoke(entry, show); + } + } +} diff --git a/Plugins/DeveloperConsole/DeveloperConsole.cs b/Plugins/DeveloperConsole/DeveloperConsole.cs index 8d2b8ec..2c8fe2b 100644 --- a/Plugins/DeveloperConsole/DeveloperConsole.cs +++ b/Plugins/DeveloperConsole/DeveloperConsole.cs @@ -19,7 +19,7 @@ namespace DeveloperConsole public DeveloperConsole() { - Chainloader.EntryLogged += (log, show) => + BepInLogger.EntryLogged += (log, show) => { string current = $"{TotalLog}\r\n{log}"; if (current.Length > 2000) diff --git a/Plugins/DynamicTranslationLoader/DynamicTranslator.cs b/Plugins/DynamicTranslationLoader/DynamicTranslator.cs index c2fb1f7..14d6d23 100644 --- a/Plugins/DynamicTranslationLoader/DynamicTranslator.cs +++ b/Plugins/DynamicTranslationLoader/DynamicTranslator.cs @@ -103,7 +103,7 @@ namespace DynamicTranslationLoader if (UnityEngine.Input.GetKeyDown(UnityEngine.KeyCode.F10)) { Dump(); - Chainloader.Log($"Text dumped to \"{Path.GetFullPath("dumped-tl.txt")}\"", true); + BepInLogger.Log($"Text dumped to \"{Path.GetFullPath("dumped-tl.txt")}\"", true); } } #endregion diff --git a/Plugins/ResourceRedirector/Loaders/BGMLoader.cs b/Plugins/ResourceRedirector/Loaders/BGMLoader.cs index 53a4655..c1edba1 100644 --- a/Plugins/ResourceRedirector/Loaders/BGMLoader.cs +++ b/Plugins/ResourceRedirector/Loaders/BGMLoader.cs @@ -31,7 +31,7 @@ namespace ResourceRedirector if (File.Exists(path)) { - Chainloader.Log($"Loading {path}"); + BepInLogger.Log($"Loading {path}"); result = new AssetBundleLoadAssetOperationSimulation(AssetLoader.LoadAudioClip(path, AudioType.WAV)); diff --git a/Plugins/ResourceRedirector/ResourceRedirector.cs b/Plugins/ResourceRedirector/ResourceRedirector.cs index 10e3a82..53f7300 100644 --- a/Plugins/ResourceRedirector/ResourceRedirector.cs +++ b/Plugins/ResourceRedirector/ResourceRedirector.cs @@ -55,7 +55,7 @@ namespace ResourceRedirector if (!File.Exists(path)) return __result; - Chainloader.Log($"Loading emulated asset {path}"); + BepInLogger.Log($"Loading emulated asset {path}"); return new AssetBundleLoadAssetOperationSimulation(AssetLoader.LoadTexture(path)); } @@ -66,7 +66,7 @@ namespace ResourceRedirector if (!File.Exists(path)) return __result; - Chainloader.Log($"Loading emulated asset {path}"); + BepInLogger.Log($"Loading emulated asset {path}"); return new AssetBundleLoadAssetOperationSimulation(AssetLoader.LoadAudioClip(path, AudioType.WAV)); } @@ -77,7 +77,7 @@ namespace ResourceRedirector if (!File.Exists(path)) return __result; - Chainloader.Log($"Loading emulated asset {path}"); + BepInLogger.Log($"Loading emulated asset {path}"); return new AssetBundleLoadAssetOperationSimulation(AssetLoader.LoadTextAsset(path)); } diff --git a/Plugins/Screencap/ScreenshotManager.cs b/Plugins/Screencap/ScreenshotManager.cs index 22ba3da..2450b85 100644 --- a/Plugins/Screencap/ScreenshotManager.cs +++ b/Plugins/Screencap/ScreenshotManager.cs @@ -49,7 +49,7 @@ namespace Screencap while (!File.Exists(filename)) yield return new WaitForSeconds(0.01f); - Chainloader.Log($"Screenshot saved to {filename}", true); + BepInLogger.Log($"Screenshot saved to {filename}", true); } void TakeCharScreenshot(string filename) @@ -59,7 +59,7 @@ namespace Screencap File.WriteAllBytes(filename, tex.EncodeToPNG()); Destroy(tex); Illusion.Game.Utils.Sound.Play(SystemSE.photo); - Chainloader.Log($"Character screenshot saved to {filename}", true); + BepInLogger.Log($"Character screenshot saved to {filename}", true); } Texture2D RenderCamera(Camera cam)