From 0f7b985c5e804007a20491f7862973ab64b7fc56 Mon Sep 17 00:00:00 2001 From: Terry Hearst Date: Sat, 26 Aug 2023 22:16:35 -0400 Subject: [PATCH] Merge Patcher into PatchEntryPoint --- PatchEntryPoint.cs | 19 +++++++++++++++++-- Patcher.cs | 29 ----------------------------- 2 files changed, 17 insertions(+), 31 deletions(-) delete mode 100644 Patcher.cs diff --git a/PatchEntryPoint.cs b/PatchEntryPoint.cs index f747828..b5e7a34 100644 --- a/PatchEntryPoint.cs +++ b/PatchEntryPoint.cs @@ -1,12 +1,27 @@ -using System; +using HarmonyLib; +using System; +using UnityEngine.SceneManagement; namespace DiamondTimeViewer { public static class PatchEntryPoint { + private static bool IsPatched; + public static void Start() { - Patcher.OnStartup(); + SceneManager.sceneLoaded += beginPatch; + Config.Init(); + } + + private static void beginPatch(Scene scene, LoadSceneMode loadSceneMode) + { + if (!IsPatched) + { + new Harmony("com.thearst3rd.diamondtimeviewer").PatchAll(); + IsPatched = true; + SceneManager.sceneLoaded -= beginPatch; + } } } } diff --git a/Patcher.cs b/Patcher.cs deleted file mode 100644 index f16255a..0000000 --- a/Patcher.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using HarmonyLib; -using UnityEngine.SceneManagement; - -namespace DiamondTimeViewer -{ - public static class Patcher - { - private static bool IsPatched; - - public static void OnStartup() - { - SceneManager.sceneLoaded += beginPatch; - Config.Init(); - } - - private static void beginPatch(Scene scene, LoadSceneMode loadSceneMode) - { - if (!IsPatched) - { - new Harmony("com.thearst3rd.diamondviewer").PatchAll(); - IsPatched = true; - SceneManager.sceneLoaded -= beginPatch; - } - } - } -}