Add RenderSession.WithOutputPath

This commit is contained in:
copecone committed 2026-08-18 11:02:08 +09:00
1 parent d8712c971e
commit 2a5ceb4889
4 files changed
+26 -13

No files matched your search

+16 -5
View File
@@ -1,6 +1,7 @@
using System;
using ADOFAIRenderer.Core;
using ADOFAIRenderer.Data;
using ADOFAIRenderer.Util;
namespace ADOFAIRenderer.API;
@@ -29,13 +30,14 @@ public class RenderSession
private bool _timePatch = true;
private bool _screenPatch = true;
private static Func<bool> _endCondition = () => scrController.instance.state == States.Won;
private Func<bool> _endCondition = () => scrController.instance.state == States.Won;
private string? _outputPath = null;
/// <summary>
/// Sets whether automatic rendering is enabled.
/// Sets whether auto mode is enabled.
/// </summary>
/// <param name="enabled"><c>true</c> to enable automatic rendering; otherwise, <c>false</c>. Default is <c>true</c>.</param>
/// <param name="enabled"><c>true</c> to enable auto mode; otherwise, <c>false</c>. Default is <c>true</c>.</param>
/// <returns>The current <see cref="RenderSession"/> instance for method chaining.</returns>
public RenderSession WithAuto(bool enabled = true)
{
@@ -73,6 +75,12 @@ public class RenderSession
return this;
}
public RenderSession WithOutputPath(string? outputPath)
{
_outputPath = outputPath;
return this;
}
/// <summary>
/// Applies the configured flags and initiates the render session.
/// </summary>
@@ -89,7 +97,10 @@ public class RenderSession
RenderManager.Instance.Configuration = renderConfig;
RenderManager.Instance.StartLoadingOverride();
RenderManager.Instance.SetupCaptureDirectory();
if (_outputPath is null) RenderManager.Instance.SetupCaptureDirectory();
else FileUtil.CreateDirectory(_outputPath);
RenderManager.Instance.SetupGameScene();
}
}