From 4abdaf33b491428d5cc75f6b206f42ccfc37fea1cc6d1e34b543076db81aec69 Mon Sep 17 00:00:00 2001 From: copecone Date: Sat, 23 May 2026 23:46:15 +0900 Subject: [PATCH] Fix Intro Skip Problem --- Component/RenderManager.cs | 10 ++++------ Patch/ClassPatch/PersistencePatch.cs | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 Patch/ClassPatch/PersistencePatch.cs diff --git a/Component/RenderManager.cs b/Component/RenderManager.cs index 8255ba6..c1a341f 100644 --- a/Component/RenderManager.cs +++ b/Component/RenderManager.cs @@ -166,10 +166,10 @@ namespace ADOFAIRenderer.Component scrConductor.instance.song.time = -1000; } - private string FindFFmpegPath() + private static string FindFFmpegPath() { - bool isWindows = Application.platform == RuntimePlatform.WindowsPlayer; - string ffmpegName = isWindows ? "ffmpeg.exe" : "ffmpeg"; + var isWindows = Application.platform == RuntimePlatform.WindowsPlayer; + var ffmpegName = isWindows ? "ffmpeg.exe" : "ffmpeg"; // 1. Mods/ADOFAIRenderer/ffmpeg var path1 = Path.Combine(MelonEnvironment.ModsDirectory, "ADOFAIRenderer", ffmpegName); @@ -181,9 +181,7 @@ namespace ADOFAIRenderer.Component // 3. GameRootDirectory/ffmpeg var path3 = Path.Combine(MelonEnvironment.GameRootDirectory, ffmpegName); - if (File.Exists(path3)) return path3; - - return ""; + return File.Exists(path3) ? path3 : ""; } private void StartFFmpegThread() diff --git a/Patch/ClassPatch/PersistencePatch.cs b/Patch/ClassPatch/PersistencePatch.cs new file mode 100644 index 0000000..3fca96c --- /dev/null +++ b/Patch/ClassPatch/PersistencePatch.cs @@ -0,0 +1,19 @@ +using HarmonyLib; + +namespace ADOFAIRenderer.Patch.ClassPatch +{ + [HarmonyPatch(typeof(Persistence), "skipIntroBehavior", MethodType.Getter)] + public static class PersistencePatch + { + // ReSharper disable once InconsistentNaming + public static void Postfix(ref SkipIntroBehavior __result) + { + if (RenderMod.IsRendering && + scrConductor.instance != null && + !scrConductor.instance.hasSongStarted) + { + __result = SkipIntroBehavior.Off; + } + } + } +}