diff --git a/Bundle/Linux/fonts b/Bundle/Linux/fonts index a8f4055..825b5e3 100644 Binary files a/Bundle/Linux/fonts and b/Bundle/Linux/fonts differ diff --git a/Bundle/Linux/scenes b/Bundle/Linux/scenes index 0a00db6..7d1b7a8 100644 Binary files a/Bundle/Linux/scenes and b/Bundle/Linux/scenes differ diff --git a/Bundle/Win64/fonts b/Bundle/Win64/fonts index e06dafe..bfb62b2 100644 Binary files a/Bundle/Win64/fonts and b/Bundle/Win64/fonts differ diff --git a/Bundle/Win64/scenes b/Bundle/Win64/scenes index b8596e5..65deb6c 100644 Binary files a/Bundle/Win64/scenes and b/Bundle/Win64/scenes differ diff --git a/Component/RenderManager.cs b/Component/RenderManager.cs index 55122ae..43546fb 100644 --- a/Component/RenderManager.cs +++ b/Component/RenderManager.cs @@ -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; } } diff --git a/Patch/ClassPatch/EndscreenLanternsPatch.cs b/Patch/ClassPatch/EndscreenLanternsPatch.cs new file mode 100644 index 0000000..1bc1bc4 --- /dev/null +++ b/Patch/ClassPatch/EndscreenLanternsPatch.cs @@ -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); + } + } + } +} diff --git a/Patch/ClassPatch/scrPortalParticlesPatch.cs b/Patch/ClassPatch/scrPortalParticlesPatch.cs new file mode 100644 index 0000000..2e58f69 --- /dev/null +++ b/Patch/ClassPatch/scrPortalParticlesPatch.cs @@ -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(true); + foreach (var ps in particleSystems) + { + if (ps == null) continue; + + var main = ps.main; + main.useUnscaledTime = false; + } + } + } +} diff --git a/Patch/ShowHitTextPatch.cs b/Patch/ShowHitTextPatch.cs index f760019..b2717d9 100644 --- a/Patch/ShowHitTextPatch.cs +++ b/Patch/ShowHitTextPatch.cs @@ -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; } } } \ No newline at end of file diff --git a/UI/RenderButton.cs b/UI/RenderButton.cs index b6a586e..012459c 100644 --- a/UI/RenderButton.cs +++ b/UI/RenderButton.cs @@ -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();