diff --git a/NewHorizons/Handlers/SubtitlesHandler.cs b/NewHorizons/Handlers/SubtitlesHandler.cs index 64e0759d..26cdf081 100644 --- a/NewHorizons/Handlers/SubtitlesHandler.cs +++ b/NewHorizons/Handlers/SubtitlesHandler.cs @@ -31,20 +31,24 @@ namespace NewHorizons.Handlers { randomizer = new System.Random(); + GetComponent().alpha = 1; graphic = GetComponent(); image = GetComponent(); + graphic.enabled = true; + image.enabled = true; + + if (!Main.HasDLC) image.sprite = null; // Just in case. I don't know how not having the dlc changes the subtitle game object + if (!eoteSubtitleHasBeenInserted) { - // TODO: only insert if hasDLC - possibleSubtitles.Insert(0, image.sprite); // ensure that the Echoes of the Eye subtitle always appears first + if (image.sprite != null) possibleSubtitles.Insert(0, image.sprite); // ensure that the Echoes of the Eye subtitle always appears first eoteSubtitleHasBeenInserted = true; } } public static void AddSubtitle(IModBehaviour mod, string filepath) { - var tex = ImageUtilities.GetTexture(mod, filepath); if (tex == null) return; @@ -60,6 +64,8 @@ namespace NewHorizons.Handlers public void Update() { + if (image.sprite == null) image.sprite = possibleSubtitles[0]; + // don't fade transition subtitles if there's only one subtitle if (possibleSubtitles.Count <= 1) return; diff --git a/NewHorizons/Handlers/TitleSceneHandler.cs b/NewHorizons/Handlers/TitleSceneHandler.cs index 0f3149a9..9a28229b 100644 --- a/NewHorizons/Handlers/TitleSceneHandler.cs +++ b/NewHorizons/Handlers/TitleSceneHandler.cs @@ -14,9 +14,15 @@ namespace NewHorizons.Handlers public static void InitSubtitles() { GameObject subtitleContainer = GameObject.Find("TitleMenu/TitleCanvas/TitleLayoutGroup/Logo_EchoesOfTheEye"); - subtitleContainer.AddComponent(); + + if (subtitleContainer == null) + { + Logger.LogError("No subtitle container found! Failed to load subtitles."); + return; + } - // TODO: if no subtitleContainer found, make one + subtitleContainer.SetActive(true); + subtitleContainer.AddComponent(); } public static void DisplayBodyOnTitleScreen(List bodies)