From 72b7a86294025bfea296b2869c989685ce3f9281 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Wed, 2 Oct 2024 23:45:14 -0400 Subject: [PATCH] subtitles start cycling before the main menu is visible #844 --- NewHorizons/Handlers/SubtitlesHandler.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NewHorizons/Handlers/SubtitlesHandler.cs b/NewHorizons/Handlers/SubtitlesHandler.cs index d3fe3fb8..9fd87d44 100644 --- a/NewHorizons/Handlers/SubtitlesHandler.cs +++ b/NewHorizons/Handlers/SubtitlesHandler.cs @@ -1,3 +1,4 @@ +using NewHorizons.Utility; using NewHorizons.Utility.Files; using NewHorizons.Utility.OWML; using OWML.Common; @@ -31,6 +32,8 @@ namespace NewHorizons.Handlers private static List<(IModBehaviour mod, string filePath)> _additionalSubtitles = new(); + private CanvasGroup _titleCanvasGroup; + public static void RegisterAdditionalSubtitle(IModBehaviour mod, string filePath) { _additionalSubtitles.Add((mod, filePath)); @@ -64,6 +67,8 @@ namespace NewHorizons.Handlers var layout = GetComponent(); layout.minHeight = SUBTITLE_HEIGHT; + _titleCanvasGroup = SearchUtilities.Find("TitleCanvas").GetComponent(); + CheckForEOTE(); // We add our subtitles as a child object so that their sizing doesnt shift the layout of the main menu @@ -137,6 +142,12 @@ namespace NewHorizons.Handlers return; } + // Fix subtitles start cycling before the main menu is visible #844 + if (_titleCanvasGroup.alpha < 1) + { + return; + } + if (pauseTimer > 0) { pauseTimer--;