SHA256
43 lines
1.6 KiB
C#
43 lines
1.6 KiB
C#
using ADOFAIRenderer.Core;
|
|
using HarmonyLib;
|
|
|
|
namespace ADOFAIRenderer.Patch.Game;
|
|
|
|
/// <summary>
|
|
/// Hides the detailed results panel (per-judgement hit counts) that the game shows on the clear screen.
|
|
/// <para>
|
|
/// Patched member: <c>DetailedResults.Show()</c>. The game calls it from <c>scrController.OnLandOnPortal</c> when a level is won
|
|
/// (and detailed results are enabled); it builds the result text per player, enables the component and activates
|
|
/// <c>scrController.detailedResults</c>.
|
|
/// </para>
|
|
/// <para>
|
|
/// Active while <see cref="RenderManager.IsActive"/> (stage >= OnScene), so the panel does not appear in the rendered video
|
|
/// during the delay after the level end.
|
|
/// </para>
|
|
/// </summary>
|
|
[HarmonyPatch(typeof(DetailedResults))]
|
|
// ReSharper disable once InconsistentNaming
|
|
public static class DetailedResultsPatch
|
|
{
|
|
/// <summary>
|
|
/// Prefix of <c>DetailedResults.Show</c>. While rendering, disables the component and deactivates its GameObject.
|
|
/// </summary>
|
|
/// <param name="__instance">The DetailedResults component being shown.</param>
|
|
/// <returns>True to run the original method (not rendering); false to skip it (rendering).</returns>
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch("Show")]
|
|
// ReSharper disable once InconsistentNaming
|
|
public static bool PreventShow(DetailedResults __instance)
|
|
{
|
|
if (!RenderManager.IsActive) return true;
|
|
|
|
if (__instance)
|
|
{
|
|
__instance.enabled = false;
|
|
if (__instance.gameObject) __instance.gameObject.SetActive(false);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|