SHA256
Add WithEndCondition to RenderSession
This commit is contained in:
2 files changed
+9
-2
No files matched your search
@@ -29,6 +29,8 @@ public class RenderSession
|
|||||||
|
|
||||||
private bool _timePatch = true;
|
private bool _timePatch = true;
|
||||||
private bool _screenPatch = true;
|
private bool _screenPatch = true;
|
||||||
|
|
||||||
|
private static Func<bool> _endCondition = () => scrController.instance.state == States.Won;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets whether automatic rendering is enabled.
|
/// Sets whether automatic rendering is enabled.
|
||||||
@@ -60,6 +62,12 @@ public class RenderSession
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RenderSession WithEndCondition(Func<bool> endCondition)
|
||||||
|
{
|
||||||
|
_endCondition = endCondition;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Applies the configured flags and initiates the render session.
|
/// Applies the configured flags and initiates the render session.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -70,6 +78,7 @@ public class RenderSession
|
|||||||
RenderContext.Auto = _auto;
|
RenderContext.Auto = _auto;
|
||||||
RenderContext.TimePatch = _timePatch;
|
RenderContext.TimePatch = _timePatch;
|
||||||
RenderContext.ScreenPatch = _screenPatch;
|
RenderContext.ScreenPatch = _screenPatch;
|
||||||
|
RenderContext.EndCondition = _endCondition;
|
||||||
|
|
||||||
RenderManager.Instance.levelPath = levelPath;
|
RenderManager.Instance.levelPath = levelPath;
|
||||||
RenderManager.Instance.Configuration = renderConfig;
|
RenderManager.Instance.Configuration = renderConfig;
|
||||||
|
|||||||
@@ -79,8 +79,6 @@ namespace ADOFAIRenderer.Patch.Engine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[HarmonyPatch(typeof(AudioSource), "SetScheduledEndTime", typeof(double))]
|
[HarmonyPatch(typeof(AudioSource), "SetScheduledEndTime", typeof(double))]
|
||||||
public static class AudioSourceSetScheduledEndTimePatch
|
public static class AudioSourceSetScheduledEndTimePatch
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user