Files
ADOFAIRenderer/Patch/Game/scrUIControllerPatch.cs
T
2026-10-15 16:17:13 +09:00

36 lines
1.4 KiB
C#

using ADOFAIRenderer.Core;
using HarmonyLib;
namespace ADOFAIRenderer.Patch.Game;
/// <summary>
/// Hides the end-screen lanterns again right after the game shows them.
/// <para>
/// Patched member: <c>scrUIController.ShowEndscreenLanterns()</c>, which calls <c>EndscreenLanterns.Show</c> for each player's
/// lantern set (and fades the end-screen flash in co-op). <c>scrController.OnLandOnPortal</c> calls it on a win.
/// </para>
/// <para>
/// Active while <see cref="RenderManager.IsActive"/> (stage &gt;= OnScene). Works together with <see cref="EndscreenLanternsPatch"/>,
/// which already skips <c>EndscreenLanterns.Show</c> during a render.
/// </para>
/// </summary>
[HarmonyPatch(typeof(scrUIController))]
// ReSharper disable once InconsistentNaming
public class scrUIControllerPatch
{
/// <summary>
/// Postfix of <c>scrUIController.ShowEndscreenLanterns</c>: calls <c>HideEndscreenLanterns()</c>, which runs
/// <c>EndscreenLanterns.Hide</c> on every lantern set.
/// </summary>
/// <param name="__instance">The UI controller.</param>
[HarmonyPostfix]
[HarmonyPatch("ShowEndscreenLanterns")]
// ReSharper disable once InconsistentNaming
public static void PreventEndscreenLanternsPostfix(scrUIController __instance)
{
if (RenderManager.IsActive && __instance != null)
{
__instance.HideEndscreenLanterns();
}
}
}