From f8b7fe608ed275a7d62243055d3b80814bd273a881a721545e0257c26aa540cf Mon Sep 17 00:00:00 2001 From: copecone Date: Mon, 29 Jun 2026 22:54:34 +0900 Subject: [PATCH] Refactor Patches --- Patch/Game/EndscreenLanternsPatch.cs | 2 +- Patch/Game/PersistencePatch.cs | 6 ++++-- Patch/Game/scnGamePatch.cs | 2 +- Patch/Game/scrCameraPatch.cs | 6 ++++-- Patch/Game/scrPortalParticlesPatch.cs | 2 +- obfuscar.xml | 0 6 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 obfuscar.xml diff --git a/Patch/Game/EndscreenLanternsPatch.cs b/Patch/Game/EndscreenLanternsPatch.cs index acf6da2..a2a8acd 100644 --- a/Patch/Game/EndscreenLanternsPatch.cs +++ b/Patch/Game/EndscreenLanternsPatch.cs @@ -11,7 +11,7 @@ namespace ADOFAIRenderer.Patch.Game [HarmonyPrefix] [HarmonyPatch("Show")] [SuppressMessage("ReSharper", "InconsistentNaming")] - public static bool PrefixShow(EndscreenLanterns __instance, ref int __result) + public static bool ForceHide(EndscreenLanterns __instance, ref int __result) { if (!RenderManager.IsActive) return true; if (__instance != null) diff --git a/Patch/Game/PersistencePatch.cs b/Patch/Game/PersistencePatch.cs index aaee7e8..f7a1e39 100644 --- a/Patch/Game/PersistencePatch.cs +++ b/Patch/Game/PersistencePatch.cs @@ -3,11 +3,13 @@ using HarmonyLib; namespace ADOFAIRenderer.Patch.Game { - [HarmonyPatch(typeof(Persistence), "skipIntroBehavior", MethodType.Getter)] + [HarmonyPatch(typeof(Persistence))] public static class PersistencePatch { + [HarmonyPostfix] + [HarmonyPatch("skipIntroBehavior", MethodType.Getter)] // ReSharper disable once InconsistentNaming - public static void Postfix(ref SkipIntroBehavior __result) + public static void LockSkipIntroBehavior(ref SkipIntroBehavior __result) { if (RenderManager.IsActive && scrConductor.instance != null && diff --git a/Patch/Game/scnGamePatch.cs b/Patch/Game/scnGamePatch.cs index a97ffb2..f86fcdb 100644 --- a/Patch/Game/scnGamePatch.cs +++ b/Patch/Game/scnGamePatch.cs @@ -13,7 +13,7 @@ namespace ADOFAIRenderer.Patch.Game [HarmonyPrefix] [HarmonyPatch("UpdateVideo")] // ReSharper disable once InconsistentNaming - public static bool Prefix(scnGame __instance) + public static bool ReplaceVideo(scnGame __instance) { // Only replace when rendering is active if (!RenderManager.IsActive) diff --git a/Patch/Game/scrCameraPatch.cs b/Patch/Game/scrCameraPatch.cs index 3189c92..79eb7b8 100644 --- a/Patch/Game/scrCameraPatch.cs +++ b/Patch/Game/scrCameraPatch.cs @@ -3,12 +3,14 @@ using HarmonyLib; namespace ADOFAIRenderer.Patch.Game { - [HarmonyPatch(typeof(scrCamera), "SetCustomFrameRate")] + [HarmonyPatch(typeof(scrCamera))] // ReSharper disable once InconsistentNaming public class scrCameraPatch { + [HarmonyPrefix] + [HarmonyPatch("SetCustomFrameRate")] [SuppressMessage("ReSharper", "InconsistentNaming")] - private static bool Prefix(scrCamera __instance, bool enable, float frame) + private static bool FixCamRT(scrCamera __instance, bool enable, float frame) { // There is an issue that `mainTexture.Release` triggers even if `mainTexture` is `camRT`, so mod tries to fix it if (enable || __instance.enableCustomFPS != enable) return true; diff --git a/Patch/Game/scrPortalParticlesPatch.cs b/Patch/Game/scrPortalParticlesPatch.cs index 7c0a401..1a07347 100644 --- a/Patch/Game/scrPortalParticlesPatch.cs +++ b/Patch/Game/scrPortalParticlesPatch.cs @@ -10,7 +10,7 @@ namespace ADOFAIRenderer.Patch.Game [HarmonyPostfix] [HarmonyPatch("Start")] // ReSharper disable once InconsistentNaming - public static void Postfix(scrPortalParticles __instance) + public static void ForceScaledTime(scrPortalParticles __instance) { if (__instance == null) return; diff --git a/obfuscar.xml b/obfuscar.xml new file mode 100644 index 0000000..473a0f4