diff --git a/API/RenderSession.cs b/API/RenderSession.cs index 98ff516..c891904 100644 --- a/API/RenderSession.cs +++ b/API/RenderSession.cs @@ -29,6 +29,8 @@ public class RenderSession private bool _timePatch = true; private bool _screenPatch = true; + + private static Func _endCondition = () => scrController.instance.state == States.Won; /// /// Sets whether automatic rendering is enabled. @@ -60,6 +62,12 @@ public class RenderSession return this; } + public RenderSession WithEndCondition(Func endCondition) + { + _endCondition = endCondition; + return this; + } + /// /// Applies the configured flags and initiates the render session. /// @@ -70,6 +78,7 @@ public class RenderSession RenderContext.Auto = _auto; RenderContext.TimePatch = _timePatch; RenderContext.ScreenPatch = _screenPatch; + RenderContext.EndCondition = _endCondition; RenderManager.Instance.levelPath = levelPath; RenderManager.Instance.Configuration = renderConfig; diff --git a/Patch/Engine/AudioPatches.cs b/Patch/Engine/AudioPatches.cs index ce2a88c..b6f3dc8 100644 --- a/Patch/Engine/AudioPatches.cs +++ b/Patch/Engine/AudioPatches.cs @@ -79,8 +79,6 @@ namespace ADOFAIRenderer.Patch.Engine } } - - [HarmonyPatch(typeof(AudioSource), "SetScheduledEndTime", typeof(double))] public static class AudioSourceSetScheduledEndTimePatch {