subtitles start cycling before the main menu is visible #844

This commit is contained in:
xen-42 2024-10-02 23:45:14 -04:00
parent 95cd20fca7
commit 72b7a86294

View File

@ -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<LayoutElement>();
layout.minHeight = SUBTITLE_HEIGHT;
_titleCanvasGroup = SearchUtilities.Find("TitleCanvas").GetComponent<CanvasGroup>();
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--;