SHA256
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
3797cb7077
9 files changed
+112
-3
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -35,8 +35,9 @@ namespace ADOFAIRenderer.Component
|
||||
public int Bitrate;
|
||||
public string Codec;
|
||||
public double EndWaitTime;
|
||||
public bool ShowHitText;
|
||||
|
||||
public RenderSettings(double targetFPS, double videoFPS, int renderWidth, int renderHeight, int bitrate, string codec, double endWaitTime)
|
||||
public RenderSettings(double targetFPS, double videoFPS, int renderWidth, int renderHeight, int bitrate, string codec, double endWaitTime, bool showHitText)
|
||||
{
|
||||
TargetFPS = targetFPS;
|
||||
VideoFPS = videoFPS;
|
||||
@@ -47,6 +48,7 @@ namespace ADOFAIRenderer.Component
|
||||
Bitrate = bitrate;
|
||||
Codec = codec;
|
||||
EndWaitTime = endWaitTime;
|
||||
ShowHitText = showHitText;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace ADOFAIRenderer.Patch.ClassPatch
|
||||
{
|
||||
[HarmonyPatch(typeof(EndscreenLanterns))]
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public static class EndscreenLanternsPatch
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch("Show")]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public static bool PrefixShow(EndscreenLanterns __instance, ref int __result)
|
||||
{
|
||||
if (!RenderMod.IsRendering) return true;
|
||||
if (__instance != null)
|
||||
{
|
||||
__instance.Hide();
|
||||
}
|
||||
__result = 0; // Return 0 lanterns shown
|
||||
return false; // Skip original Show method
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch("Hide")]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public static void PrefixHide(EndscreenLanterns __instance)
|
||||
{
|
||||
if (__instance == null) return;
|
||||
|
||||
var traverse = Traverse.Create(__instance);
|
||||
|
||||
// Kill lampSequences (private Sequence[] lampSequences) via reflection
|
||||
var lampSequencesField = traverse.Field("lampSequences");
|
||||
var lampSequencesObj = lampSequencesField.GetValue();
|
||||
if (lampSequencesObj is System.Array lampSequencesArray)
|
||||
{
|
||||
for (var i = 0; i < lampSequencesArray.Length; i++)
|
||||
{
|
||||
var item = lampSequencesArray.GetValue(i);
|
||||
if (item == null) continue;
|
||||
try
|
||||
{
|
||||
var killMethod = item.GetType().GetMethod("Kill", new[] { typeof(bool) });
|
||||
killMethod?.Invoke(item, new object[] { false });
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore reflection errors
|
||||
}
|
||||
lampSequencesArray.SetValue(null, i);
|
||||
}
|
||||
}
|
||||
|
||||
// Kill chainSequence (private Sequence chainSequence) via reflection
|
||||
var chainSequenceField = traverse.Field("chainSequence");
|
||||
var chainSequenceObj = chainSequenceField.GetValue();
|
||||
if (chainSequenceObj == null) return;
|
||||
{
|
||||
try
|
||||
{
|
||||
var killMethod = chainSequenceObj.GetType().GetMethod("Kill", new[] { typeof(bool) });
|
||||
killMethod?.Invoke(chainSequenceObj, new object[] { false });
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore reflection errors
|
||||
}
|
||||
chainSequenceField.SetValue(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ADOFAIRenderer.Patch.ClassPatch
|
||||
{
|
||||
[HarmonyPatch(typeof(scrPortalParticles))]
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public static class scrPortalParticlesPatch
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch("Start")]
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public static void Postfix(scrPortalParticles __instance)
|
||||
{
|
||||
if (__instance == null) return;
|
||||
|
||||
var particleSystems = __instance.GetComponentsInChildren<ParticleSystem>(true);
|
||||
foreach (var ps in particleSystems)
|
||||
{
|
||||
if (ps == null) continue;
|
||||
|
||||
var main = ps.main;
|
||||
main.useUnscaledTime = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using ADOFAIRenderer.Component;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace ADOFAIRenderer.Patch
|
||||
@@ -7,7 +8,7 @@ namespace ADOFAIRenderer.Patch
|
||||
{
|
||||
public static bool Prefix()
|
||||
{
|
||||
return !RenderMod.IsRendering;
|
||||
return !RenderMod.IsRendering || RenderManager.Configuration.ShowHitText;
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
-1
@@ -20,6 +20,9 @@ namespace ADOFAIRenderer.UI
|
||||
[Header("Dropdown")]
|
||||
[SerializeField] private TMP_Dropdown codecDropdown = null!;
|
||||
|
||||
[Header("Toggle")]
|
||||
[SerializeField] private Toggle showHitTextToggle = null!;
|
||||
|
||||
private Button _buttonComponent = null!;
|
||||
|
||||
private void Start()
|
||||
@@ -85,6 +88,8 @@ namespace ADOFAIRenderer.UI
|
||||
var selectedCodecIndex = codecDropdown.value;
|
||||
var selectedCodecName = codecDropdown.options[selectedCodecIndex].text;
|
||||
|
||||
var showHitText = showHitTextToggle != null && showHitTextToggle.isOn;
|
||||
|
||||
RenderManager.Configuration = new RenderManager.RenderSettings
|
||||
{
|
||||
TargetFPS = targetFPS,
|
||||
@@ -93,7 +98,8 @@ namespace ADOFAIRenderer.UI
|
||||
RenderHeight = renderHeight,
|
||||
Bitrate = bitrate,
|
||||
Codec = selectedCodecName,
|
||||
EndWaitTime = waitAfterEnd
|
||||
EndWaitTime = waitAfterEnd,
|
||||
ShowHitText = showHitText
|
||||
};
|
||||
|
||||
RenderManager.Instance.SetupCaptureDirectory();
|
||||
|
||||
Reference in new issue
Block a user