mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
feat: handling for when the player does not have the dlc
This commit is contained in:
parent
a42ef6f46a
commit
3ec36b7b18
@ -31,20 +31,24 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
randomizer = new System.Random();
|
||||
|
||||
GetComponent<CanvasGroup>().alpha = 1;
|
||||
graphic = GetComponent<Graphic>();
|
||||
image = GetComponent<UnityEngine.UI.Image>();
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@ -14,9 +14,15 @@ namespace NewHorizons.Handlers
|
||||
public static void InitSubtitles()
|
||||
{
|
||||
GameObject subtitleContainer = GameObject.Find("TitleMenu/TitleCanvas/TitleLayoutGroup/Logo_EchoesOfTheEye");
|
||||
subtitleContainer.AddComponent<SubtitlesHandler>();
|
||||
|
||||
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<SubtitlesHandler>();
|
||||
}
|
||||
|
||||
public static void DisplayBodyOnTitleScreen(List<NewHorizonsBody> bodies)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user