diff --git a/Patch/Game/DetailedResultsPatch.cs b/Patch/Game/DetailedResultsPatch.cs new file mode 100644 index 0000000..d250ee2 --- /dev/null +++ b/Patch/Game/DetailedResultsPatch.cs @@ -0,0 +1,25 @@ +using ADOFAIRenderer.Core; +using HarmonyLib; + +namespace ADOFAIRenderer.Patch.Game; + +[HarmonyPatch(typeof(DetailedResults))] +// ReSharper disable once InconsistentNaming +public static class DetailedResultsPatch +{ + [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; + } +} diff --git a/Patch/Game/scrControllerPatch.cs b/Patch/Game/scrControllerPatch.cs index a12d8da..cbd98a9 100644 --- a/Patch/Game/scrControllerPatch.cs +++ b/Patch/Game/scrControllerPatch.cs @@ -41,4 +41,38 @@ public static class scrControllerPatch { return !RenderManager.IsActive; } + + [HarmonyPostfix] + [HarmonyPatch("OnLandOnPortal")] + public static void PreventWinTextsPostfix(scrController __instance) + { + if (!RenderManager.IsActive || __instance == null) return; + + if (__instance.txtCongrats) + { + __instance.txtCongrats.text = string.Empty; + __instance.txtCongrats.gameObject.SetActive(false); + } + + if (__instance.txtAprilCongrats) + { + __instance.txtAprilCongrats.text = string.Empty; + __instance.txtAprilCongrats.gameObject.SetActive(false); + } + + if (__instance.txtAllStrictClear) + { + __instance.txtAllStrictClear.text = string.Empty; + __instance.txtAllStrictClear.gameObject.SetActive(false); + } + + if (__instance.detailedResults) + { + __instance.detailedResults.enabled = false; + if (__instance.detailedResults.gameObject != null) + { + __instance.detailedResults.gameObject.SetActive(false); + } + } + } } \ No newline at end of file