SHA256
forked from ADOFAIEditorForum/ADOFAIRenderer
Fix Intro Skip Problem
This commit is contained in:
1 parent
6133d28877
commit
4abdaf33b4
2 files changed
+23
-6
No files matched your search
@@ -166,10 +166,10 @@ namespace ADOFAIRenderer.Component
|
|||||||
scrConductor.instance.song.time = -1000;
|
scrConductor.instance.song.time = -1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string FindFFmpegPath()
|
private static string FindFFmpegPath()
|
||||||
{
|
{
|
||||||
bool isWindows = Application.platform == RuntimePlatform.WindowsPlayer;
|
var isWindows = Application.platform == RuntimePlatform.WindowsPlayer;
|
||||||
string ffmpegName = isWindows ? "ffmpeg.exe" : "ffmpeg";
|
var ffmpegName = isWindows ? "ffmpeg.exe" : "ffmpeg";
|
||||||
|
|
||||||
// 1. Mods/ADOFAIRenderer/ffmpeg
|
// 1. Mods/ADOFAIRenderer/ffmpeg
|
||||||
var path1 = Path.Combine(MelonEnvironment.ModsDirectory, "ADOFAIRenderer", ffmpegName);
|
var path1 = Path.Combine(MelonEnvironment.ModsDirectory, "ADOFAIRenderer", ffmpegName);
|
||||||
@@ -181,9 +181,7 @@ namespace ADOFAIRenderer.Component
|
|||||||
|
|
||||||
// 3. GameRootDirectory/ffmpeg
|
// 3. GameRootDirectory/ffmpeg
|
||||||
var path3 = Path.Combine(MelonEnvironment.GameRootDirectory, ffmpegName);
|
var path3 = Path.Combine(MelonEnvironment.GameRootDirectory, ffmpegName);
|
||||||
if (File.Exists(path3)) return path3;
|
return File.Exists(path3) ? path3 : "";
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StartFFmpegThread()
|
private void StartFFmpegThread()
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user