SHA256
Compare commits
5
Commits
| Author | SHA256 | Date | |
|---|---|---|---|
|
|
fa0f175bae
|
||
|
|
ab19a3a777
|
||
|
|
e210da9bb0
|
||
|
|
5316840811
|
||
|
|
6d2d7785b9
|
No files matched your search
@@ -1,6 +0,0 @@
|
|||||||
namespace ADOFAIRenderer.API;
|
|
||||||
|
|
||||||
public class Core
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
using System;
|
||||||
|
using ADOFAIRenderer.Core;
|
||||||
|
using ADOFAIRenderer.Data;
|
||||||
|
|
||||||
|
namespace ADOFAIRenderer.API;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fluent builder for configuring and starting a render session.
|
||||||
|
/// </summary>
|
||||||
|
public class RenderSession
|
||||||
|
{
|
||||||
|
private bool _auto = true;
|
||||||
|
|
||||||
|
public enum PatchType { Time, Screen }
|
||||||
|
private bool _timePatch = true;
|
||||||
|
private bool _screenPatch = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets whether automatic rendering is enabled.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="enabled"><c>true</c> to enable automatic rendering; 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)
|
||||||
|
{
|
||||||
|
_auto = enabled;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RenderSession WithPatch(PatchType patchType, bool enabled = true)
|
||||||
|
{
|
||||||
|
switch (patchType)
|
||||||
|
{
|
||||||
|
case PatchType.Time: _timePatch = enabled; break;
|
||||||
|
case PatchType.Screen: _screenPatch = enabled; break;
|
||||||
|
default: throw new ArgumentOutOfRangeException(nameof(patchType), patchType, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Applies the configured flags and initiates the render session.
|
||||||
|
/// </summary>
|
||||||
|
public void Start(RenderConfig renderConfig, string levelPath)
|
||||||
|
{
|
||||||
|
RenderContext.Auto = _auto;
|
||||||
|
RenderContext.TimePatch = _timePatch;
|
||||||
|
RenderContext.ScreenPatch = _screenPatch;
|
||||||
|
|
||||||
|
RenderManager.Instance.levelPath = levelPath;
|
||||||
|
RenderManager.Instance.Configuration = renderConfig;
|
||||||
|
|
||||||
|
RenderManager.Instance.SetupCaptureDirectory();
|
||||||
|
RenderManager.Instance.SetupGameScene();
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
-4
@@ -21,11 +21,19 @@ using ThreadPriority = System.Threading.ThreadPriority;
|
|||||||
|
|
||||||
namespace ADOFAIRenderer.Core
|
namespace ADOFAIRenderer.Core
|
||||||
{
|
{
|
||||||
internal static class RenderFlags
|
internal static class RenderContext
|
||||||
{
|
{
|
||||||
public static bool Auto = true;
|
public static bool Auto = true;
|
||||||
public static bool TimePatch = true;
|
public static bool TimePatch = true;
|
||||||
public static bool ScreenPatch = true;
|
public static bool ScreenPatch = true;
|
||||||
|
public static Func<bool> EndCondition = () => scrController.instance.state == States.Won;
|
||||||
|
|
||||||
|
public static void Reset()
|
||||||
|
{
|
||||||
|
Auto = true;
|
||||||
|
TimePatch = true; ScreenPatch = true;
|
||||||
|
EndCondition = () => scrController.instance.state == States.Won;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class RenderManager : MonoBehaviour
|
internal class RenderManager : MonoBehaviour
|
||||||
@@ -201,7 +209,7 @@ namespace ADOFAIRenderer.Core
|
|||||||
_originalInputOffset = scrConductor.currentPreset.inputOffset;
|
_originalInputOffset = scrConductor.currentPreset.inputOffset;
|
||||||
scrConductor.currentPreset.inputOffset = 0;
|
scrConductor.currentPreset.inputOffset = 0;
|
||||||
|
|
||||||
RDC.auto = RenderFlags.Auto;
|
RDC.auto = RenderContext.Auto;
|
||||||
AccessTools.Field(typeof(scrController), "disableCongratsMessage")
|
AccessTools.Field(typeof(scrController), "disableCongratsMessage")
|
||||||
.SetValue(scrController.instance, true);
|
.SetValue(scrController.instance, true);
|
||||||
|
|
||||||
@@ -233,14 +241,14 @@ namespace ADOFAIRenderer.Core
|
|||||||
StopFFmpeg(false);
|
StopFFmpeg(false);
|
||||||
EndRender();
|
EndRender();
|
||||||
}
|
}
|
||||||
else if (scrController.instance.state == States.Won)
|
else if (RenderContext.EndCondition())
|
||||||
{
|
{
|
||||||
if (wonFrame == -1)
|
if (wonFrame == -1)
|
||||||
{
|
{
|
||||||
wonFrame = frameCount;
|
wonFrame = frameCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
var extraFrames = (long)Math.Ceiling(Configuration.DelayAfterLevelEnd * Configuration.RenderFPS);
|
var extraFrames = (long)Math.Ceiling(Configuration.DelayAfterEnd * Configuration.RenderFPS);
|
||||||
|
|
||||||
if (frameCount - wonFrame < extraFrames) return;
|
if (frameCount - wonFrame < extraFrames) return;
|
||||||
ResetRenderState(success: true);
|
ResetRenderState(success: true);
|
||||||
|
|||||||
+19
-11
@@ -55,26 +55,26 @@ namespace ADOFAIRenderer.Data
|
|||||||
public static List<RenderPreset> GetPresets()
|
public static List<RenderPreset> GetPresets()
|
||||||
{
|
{
|
||||||
var presets = new List<RenderPreset>();
|
var presets = new List<RenderPreset>();
|
||||||
string dir = GetPresetsDirectory();
|
var dir = GetPresetsDirectory();
|
||||||
if (!Directory.Exists(dir))
|
|
||||||
{
|
if (!Directory.Exists(dir)) return presets;
|
||||||
return presets;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string[] files = Directory.GetFiles(dir, "*.json");
|
var files = Directory.GetFiles(dir, "*.json");
|
||||||
foreach (string file in files)
|
foreach (var file in files)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string json = File.ReadAllText(file);
|
var json = File.ReadAllText(file);
|
||||||
var jObject = JsonConvert.DeserializeObject<JObject>(json);
|
var jObject = JsonConvert.DeserializeObject<JObject>(json);
|
||||||
if (jObject != null)
|
if (jObject == null) continue;
|
||||||
{
|
|
||||||
var configToken = jObject["Config"];
|
var configToken = jObject["Config"];
|
||||||
if (configToken is JObject configObj)
|
if (configToken is JObject configObj)
|
||||||
{
|
{
|
||||||
|
TryChangeKey(configObj, "DelayAfterLevelEnd", "DelayAfterEnd");
|
||||||
|
|
||||||
// 1. legacy EncodingConfig -> VideoConfig
|
// 1. legacy EncodingConfig -> VideoConfig
|
||||||
if (configObj["EncodingConfig"] is JObject oldEncodingConfigObj)
|
if (configObj["EncodingConfig"] is JObject oldEncodingConfigObj)
|
||||||
{
|
{
|
||||||
@@ -152,7 +152,6 @@ namespace ADOFAIRenderer.Data
|
|||||||
presets.Add(preset);
|
presets.Add(preset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
MelonLogger.Warning($"프리셋 파일 '{Path.GetFileName(file)}' 로드 중 오류 발생: {ex.Message}");
|
MelonLogger.Warning($"프리셋 파일 '{Path.GetFileName(file)}' 로드 중 오류 발생: {ex.Message}");
|
||||||
@@ -167,6 +166,15 @@ namespace ADOFAIRenderer.Data
|
|||||||
return presets;
|
return presets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void TryChangeKey(JObject configObj, string keyBefore, string targetKey)
|
||||||
|
{
|
||||||
|
var legacyToken = configObj[keyBefore];
|
||||||
|
if (legacyToken != null && legacyToken.Type != JTokenType.Null)
|
||||||
|
configObj[targetKey] = legacyToken;
|
||||||
|
|
||||||
|
configObj.Remove(keyBefore);
|
||||||
|
}
|
||||||
|
|
||||||
public static void DeletePreset(string name)
|
public static void DeletePreset(string name)
|
||||||
{
|
{
|
||||||
string dir = GetPresetsDirectory();
|
string dir = GetPresetsDirectory();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using ADOFAIRenderer.Util.FFmpeg;
|
|||||||
|
|
||||||
namespace ADOFAIRenderer.Data
|
namespace ADOFAIRenderer.Data
|
||||||
{
|
{
|
||||||
internal class RenderConfig
|
public class RenderConfig
|
||||||
{
|
{
|
||||||
public double RenderFPS { get; set; }
|
public double RenderFPS { get; set; }
|
||||||
public double VideoFPS { get; set; }
|
public double VideoFPS { get; set; }
|
||||||
@@ -14,18 +14,18 @@ namespace ADOFAIRenderer.Data
|
|||||||
public AudioEncodingConfig AudioConfig { get; set; } = new();
|
public AudioEncodingConfig AudioConfig { get; set; } = new();
|
||||||
public AdvancedConfig AdvancedConfig { get; set; } = new();
|
public AdvancedConfig AdvancedConfig { get; set; } = new();
|
||||||
|
|
||||||
public double DelayAfterLevelEnd { get; set; }
|
public double DelayAfterEnd { get; set; }
|
||||||
public bool ShowJudgementText { get; set; }
|
public bool ShowJudgementText { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class AdvancedConfig
|
public class AdvancedConfig
|
||||||
{
|
{
|
||||||
public int? RandomSeed { get; set; } = null;
|
public int? RandomSeed { get; set; } = null;
|
||||||
public bool ProcessAudio { get; set; } = true;
|
public bool ProcessAudio { get; set; } = true;
|
||||||
public bool NonTile { get; set; } = false;
|
public bool NonTile { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class VideoEncodingConfig
|
public class VideoEncodingConfig
|
||||||
{
|
{
|
||||||
public Codec Codec { get; set; } = Codec.H264;
|
public Codec Codec { get; set; } = Codec.H264;
|
||||||
public RateControlMode RateControlMode { get; set; } = RateControlMode.CBR;
|
public RateControlMode RateControlMode { get; set; } = RateControlMode.CBR;
|
||||||
@@ -35,10 +35,10 @@ namespace ADOFAIRenderer.Data
|
|||||||
// ReSharper disable once InconsistentNaming
|
// ReSharper disable once InconsistentNaming
|
||||||
public int QP { get; set; } = 18;
|
public int QP { get; set; } = 18;
|
||||||
public double KeyframeInterval { get; set; } = 2.0;
|
public double KeyframeInterval { get; set; } = 2.0;
|
||||||
public bool ForceSoftwareEncoder { get; set; } = false;
|
public bool ForceSoftwareEncoder { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class AudioEncodingConfig
|
public class AudioEncodingConfig
|
||||||
{
|
{
|
||||||
private int _audioSampleRate = 44100;
|
private int _audioSampleRate = 44100;
|
||||||
private int _audioChannels = 2;
|
private int _audioChannels = 2;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace ADOFAIRenderer.Patch.Engine
|
|||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public static bool Prefix(ref float __result)
|
public static bool Prefix(ref float __result)
|
||||||
{
|
{
|
||||||
if (!RenderManager.IsCapturingActive || !RenderFlags.TimePatch) return true;
|
if (!RenderManager.IsCapturingActive || !RenderContext.TimePatch) return true;
|
||||||
__result = (float)(TimeSpent + RenderManager.Instance.timeBase);
|
__result = (float)(TimeSpent + RenderManager.Instance.timeBase);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ namespace ADOFAIRenderer.Patch.Engine
|
|||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public static bool Prefix(ref double __result)
|
public static bool Prefix(ref double __result)
|
||||||
{
|
{
|
||||||
if (!RenderManager.IsCapturingActive || !RenderFlags.TimePatch) return true;
|
if (!RenderManager.IsCapturingActive || !RenderContext.TimePatch) return true;
|
||||||
__result = TimeSpent + RenderManager.Instance.timeBase;
|
__result = TimeSpent + RenderManager.Instance.timeBase;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ namespace ADOFAIRenderer.Patch.Engine
|
|||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public static bool Prefix(ref float __result)
|
public static bool Prefix(ref float __result)
|
||||||
{
|
{
|
||||||
if (!RenderManager.IsCapturingActive || !RenderFlags.TimePatch) return true;
|
if (!RenderManager.IsCapturingActive || !RenderContext.TimePatch) return true;
|
||||||
__result = (float)(TimeSpent + RenderManager.Instance.unscaledTimeBase);
|
__result = (float)(TimeSpent + RenderManager.Instance.unscaledTimeBase);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ namespace ADOFAIRenderer.Patch.Engine
|
|||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public static bool Prefix(ref double __result)
|
public static bool Prefix(ref double __result)
|
||||||
{
|
{
|
||||||
if (!RenderManager.IsCapturingActive || !RenderFlags.TimePatch) return true;
|
if (!RenderManager.IsCapturingActive || !RenderContext.TimePatch) return true;
|
||||||
__result = TimeSpent + RenderManager.Instance.unscaledTimeBase;
|
__result = TimeSpent + RenderManager.Instance.unscaledTimeBase;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ namespace ADOFAIRenderer.Patch.Engine
|
|||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public static bool Prefix(ref double __result)
|
public static bool Prefix(ref double __result)
|
||||||
{
|
{
|
||||||
if (!RenderManager.IsCapturingActive || !RenderFlags.TimePatch) return true;
|
if (!RenderManager.IsCapturingActive || !RenderContext.TimePatch) return true;
|
||||||
__result = TimeSpent + RenderManager.Instance.dspTimeBase;
|
__result = TimeSpent + RenderManager.Instance.dspTimeBase;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@ namespace ADOFAIRenderer.Patch.Engine
|
|||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public static bool Prefix(ref int __result)
|
public static bool Prefix(ref int __result)
|
||||||
{
|
{
|
||||||
if (!RenderManager.IsCapturingActive || !RenderFlags.TimePatch) return true;
|
if (!RenderManager.IsCapturingActive || !RenderContext.TimePatch) return true;
|
||||||
__result = (int)(RenderManager.Instance.frameCount + RenderManager.Instance.frameCountBase);
|
__result = (int)(RenderManager.Instance.frameCount + RenderManager.Instance.frameCountBase);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ namespace ADOFAIRenderer.Patch.Engine
|
|||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public static bool Prefix(ref float __result)
|
public static bool Prefix(ref float __result)
|
||||||
{
|
{
|
||||||
if (!RenderManager.IsCapturingActive || !RenderFlags.TimePatch) return true;
|
if (!RenderManager.IsCapturingActive || !RenderContext.TimePatch) return true;
|
||||||
__result = (float)(1 / RenderManager.Instance.Configuration.RenderFPS);
|
__result = (float)(1 / RenderManager.Instance.Configuration.RenderFPS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ namespace ADOFAIRenderer.Patch.Engine
|
|||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public static bool Prefix(ref float __result)
|
public static bool Prefix(ref float __result)
|
||||||
{
|
{
|
||||||
if (!RenderManager.IsCapturingActive || !RenderFlags.TimePatch) return true;
|
if (!RenderManager.IsCapturingActive || !RenderContext.TimePatch) return true;
|
||||||
__result = (float)(1 / RenderManager.Instance.Configuration.RenderFPS);
|
__result = (float)(1 / RenderManager.Instance.Configuration.RenderFPS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ namespace ADOFAIRenderer.Patch.Engine
|
|||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public static bool Prefix(ref int __result)
|
public static bool Prefix(ref int __result)
|
||||||
{
|
{
|
||||||
if (!RenderManager.IsActive || !RenderFlags.ScreenPatch || !RenderManager.Instance) return true;
|
if (!RenderManager.IsActive || !RenderContext.ScreenPatch || !RenderManager.Instance) return true;
|
||||||
__result = RenderManager.Instance.Configuration.RenderWidth;
|
__result = RenderManager.Instance.Configuration.RenderWidth;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ namespace ADOFAIRenderer.Patch.Engine
|
|||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public static bool Prefix(ref int __result)
|
public static bool Prefix(ref int __result)
|
||||||
{
|
{
|
||||||
if (!RenderManager.IsActive || !RenderFlags.ScreenPatch || !RenderManager.Instance) return true;
|
if (!RenderManager.IsActive || !RenderContext.ScreenPatch || !RenderManager.Instance) return true;
|
||||||
__result = RenderManager.Instance.Configuration.RenderHeight;
|
__result = RenderManager.Instance.Configuration.RenderHeight;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace ADOFAIRenderer.Patch.Game
|
|||||||
if (RenderManager.Instance.wonFrame != -1)
|
if (RenderManager.Instance.wonFrame != -1)
|
||||||
{
|
{
|
||||||
var elapsedFrames = RenderManager.Instance.frameCount - RenderManager.Instance.wonFrame;
|
var elapsedFrames = RenderManager.Instance.frameCount - RenderManager.Instance.wonFrame;
|
||||||
var remainingTime = RenderManager.Instance.Configuration.DelayAfterLevelEnd - elapsedFrames / RenderManager.Instance.Configuration.RenderFPS;
|
var remainingTime = RenderManager.Instance.Configuration.DelayAfterEnd - elapsedFrames / RenderManager.Instance.Configuration.RenderFPS;
|
||||||
if (remainingTime < 0) remainingTime = 0;
|
if (remainingTime < 0) remainingTime = 0;
|
||||||
___txt.text += $"\nWaiting for {remainingTime:F1}s..";
|
___txt.text += $"\nWaiting for {remainingTime:F1}s..";
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-13
@@ -47,7 +47,7 @@ namespace ADOFAIRenderer.UI
|
|||||||
_doubleValidator
|
_doubleValidator
|
||||||
.AddLimits("RenderFPS", new PositiveOnlyDoubleLimit(), new RangeDoubleLimit(0, 9600))
|
.AddLimits("RenderFPS", new PositiveOnlyDoubleLimit(), new RangeDoubleLimit(0, 9600))
|
||||||
.AddLimits("VideoFPS", new PositiveOnlyDoubleLimit(), new RangeDoubleLimit(0, 4800))
|
.AddLimits("VideoFPS", new PositiveOnlyDoubleLimit(), new RangeDoubleLimit(0, 4800))
|
||||||
.AddLimits("DelayAfterLevelEnd", new PositiveOnlyDoubleLimit(), new RangeDoubleLimit(0, 86400));
|
.AddLimits("DelayAfterEnd", new PositiveOnlyDoubleLimit(), new RangeDoubleLimit(0, 86400));
|
||||||
|
|
||||||
_intValidator.SetupValidation();
|
_intValidator.SetupValidation();
|
||||||
_doubleValidator.SetupValidation();
|
_doubleValidator.SetupValidation();
|
||||||
@@ -650,7 +650,7 @@ namespace ADOFAIRenderer.UI
|
|||||||
var heightField = _root.Q<IntegerField>("RenderHeight");
|
var heightField = _root.Q<IntegerField>("RenderHeight");
|
||||||
var renderFpsField = _root.Q<DoubleField>("RenderFPS");
|
var renderFpsField = _root.Q<DoubleField>("RenderFPS");
|
||||||
var videoFpsField = _root.Q<DoubleField>("VideoFPS");
|
var videoFpsField = _root.Q<DoubleField>("VideoFPS");
|
||||||
var delayField = _root.Q<DoubleField>("DelayAfterLevelEnd");
|
var delayField = _root.Q<DoubleField>("DelayAfterEnd");
|
||||||
var showJudgementText = _root.Q<Toggle>("ShowJudgementText");
|
var showJudgementText = _root.Q<Toggle>("ShowJudgementText");
|
||||||
|
|
||||||
// Copy validated values to Configuration manually
|
// Copy validated values to Configuration manually
|
||||||
@@ -659,7 +659,7 @@ namespace ADOFAIRenderer.UI
|
|||||||
config.RenderHeight = heightField.value;
|
config.RenderHeight = heightField.value;
|
||||||
config.RenderFPS = renderFpsField.value;
|
config.RenderFPS = renderFpsField.value;
|
||||||
config.VideoFPS = videoFpsField.value;
|
config.VideoFPS = videoFpsField.value;
|
||||||
config.DelayAfterLevelEnd = delayField.value;
|
config.DelayAfterEnd = delayField.value;
|
||||||
|
|
||||||
if (showJudgementText != null)
|
if (showJudgementText != null)
|
||||||
config.ShowJudgementText = showJudgementText.value;
|
config.ShowJudgementText = showJudgementText.value;
|
||||||
@@ -676,7 +676,7 @@ namespace ADOFAIRenderer.UI
|
|||||||
var heightField = _root.Q<IntegerField>("RenderHeight");
|
var heightField = _root.Q<IntegerField>("RenderHeight");
|
||||||
var renderFpsField = _root.Q<DoubleField>("RenderFPS");
|
var renderFpsField = _root.Q<DoubleField>("RenderFPS");
|
||||||
var videoFpsField = _root.Q<DoubleField>("VideoFPS");
|
var videoFpsField = _root.Q<DoubleField>("VideoFPS");
|
||||||
var delayField = _root.Q<DoubleField>("DelayAfterLevelEnd");
|
var delayField = _root.Q<DoubleField>("DelayAfterEnd");
|
||||||
|
|
||||||
if (widthField == null || string.IsNullOrEmpty(widthField.text) ||
|
if (widthField == null || string.IsNullOrEmpty(widthField.text) ||
|
||||||
heightField == null || string.IsNullOrEmpty(heightField.text) ||
|
heightField == null || string.IsNullOrEmpty(heightField.text) ||
|
||||||
@@ -703,14 +703,14 @@ namespace ADOFAIRenderer.UI
|
|||||||
var heightField = _root.Q<IntegerField>("RenderHeight");
|
var heightField = _root.Q<IntegerField>("RenderHeight");
|
||||||
var renderFpsField = _root.Q<DoubleField>("RenderFPS");
|
var renderFpsField = _root.Q<DoubleField>("RenderFPS");
|
||||||
var videoFpsField = _root.Q<DoubleField>("VideoFPS");
|
var videoFpsField = _root.Q<DoubleField>("VideoFPS");
|
||||||
var delayField = _root.Q<DoubleField>("DelayAfterLevelEnd");
|
var delayField = _root.Q<DoubleField>("DelayAfterEnd");
|
||||||
var showJudgementText = _root.Q<Toggle>("ShowJudgementText");
|
var showJudgementText = _root.Q<Toggle>("ShowJudgementText");
|
||||||
|
|
||||||
if (widthField != null) widthField.value = config.RenderWidth;
|
if (widthField != null) widthField.value = config.RenderWidth;
|
||||||
if (heightField != null) heightField.value = config.RenderHeight;
|
if (heightField != null) heightField.value = config.RenderHeight;
|
||||||
if (renderFpsField != null) renderFpsField.value = config.RenderFPS;
|
if (renderFpsField != null) renderFpsField.value = config.RenderFPS;
|
||||||
if (videoFpsField != null) videoFpsField.value = config.VideoFPS;
|
if (videoFpsField != null) videoFpsField.value = config.VideoFPS;
|
||||||
if (delayField != null) delayField.value = config.DelayAfterLevelEnd;
|
if (delayField != null) delayField.value = config.DelayAfterEnd;
|
||||||
if (showJudgementText != null) showJudgementText.value = config.ShowJudgementText;
|
if (showJudgementText != null) showJudgementText.value = config.ShowJudgementText;
|
||||||
|
|
||||||
RenderManager.Instance.Configuration = config;
|
RenderManager.Instance.Configuration = config;
|
||||||
@@ -1039,7 +1039,7 @@ namespace ADOFAIRenderer.UI
|
|||||||
var heightField = _root.Q<IntegerField>("RenderHeight");
|
var heightField = _root.Q<IntegerField>("RenderHeight");
|
||||||
var renderFpsField = _root.Q<DoubleField>("RenderFPS");
|
var renderFpsField = _root.Q<DoubleField>("RenderFPS");
|
||||||
var videoFpsField = _root.Q<DoubleField>("VideoFPS");
|
var videoFpsField = _root.Q<DoubleField>("VideoFPS");
|
||||||
var delayField = _root.Q<DoubleField>("DelayAfterLevelEnd");
|
var delayField = _root.Q<DoubleField>("DelayAfterEnd");
|
||||||
var showJudgementText = _root.Q<Toggle>("ShowJudgementText");
|
var showJudgementText = _root.Q<Toggle>("ShowJudgementText");
|
||||||
|
|
||||||
var currentConfig = new RenderConfig
|
var currentConfig = new RenderConfig
|
||||||
@@ -1048,14 +1048,13 @@ namespace ADOFAIRenderer.UI
|
|||||||
RenderHeight = heightField.value,
|
RenderHeight = heightField.value,
|
||||||
RenderFPS = renderFpsField.value,
|
RenderFPS = renderFpsField.value,
|
||||||
VideoFPS = videoFpsField.value,
|
VideoFPS = videoFpsField.value,
|
||||||
DelayAfterLevelEnd = delayField.value,
|
DelayAfterEnd = delayField.value,
|
||||||
ShowJudgementText = showJudgementText?.value ?? true
|
ShowJudgementText = showJudgementText?.value ?? true,
|
||||||
|
VideoConfig = RenderManager.Instance.Configuration.VideoConfig,
|
||||||
|
AudioConfig = RenderManager.Instance.Configuration.AudioConfig,
|
||||||
|
AdvancedConfig = RenderManager.Instance.Configuration.AdvancedConfig
|
||||||
};
|
};
|
||||||
|
|
||||||
currentConfig.VideoConfig = RenderManager.Instance.Configuration.VideoConfig;
|
|
||||||
currentConfig.AudioConfig = RenderManager.Instance.Configuration.AudioConfig;
|
|
||||||
currentConfig.AdvancedConfig = RenderManager.Instance.Configuration.AdvancedConfig;
|
|
||||||
|
|
||||||
PresetManager.SavePreset(presetName, currentConfig);
|
PresetManager.SavePreset(presetName, currentConfig);
|
||||||
nameField.value = string.Empty;
|
nameField.value = string.Empty;
|
||||||
refreshPresets();
|
refreshPresets();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
namespace ADOFAIRenderer.Util.FFmpeg
|
namespace ADOFAIRenderer.Util.FFmpeg
|
||||||
{
|
{
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
internal enum Codec
|
public enum Codec
|
||||||
{
|
{
|
||||||
H264, H265, VP9, AV1, VVC
|
H264, H265, VP9, AV1, VVC
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
namespace ADOFAIRenderer.Util.FFmpeg
|
namespace ADOFAIRenderer.Util.FFmpeg
|
||||||
{
|
{
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
internal enum RateControlMode
|
public enum RateControlMode
|
||||||
{
|
{
|
||||||
CBR,
|
CBR,
|
||||||
VBR,
|
VBR,
|
||||||
|
|||||||
Reference in new issue
Block a user