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();
|
randomizer = new System.Random();
|
||||||
|
|
||||||
|
GetComponent<CanvasGroup>().alpha = 1;
|
||||||
graphic = GetComponent<Graphic>();
|
graphic = GetComponent<Graphic>();
|
||||||
image = GetComponent<UnityEngine.UI.Image>();
|
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)
|
if (!eoteSubtitleHasBeenInserted)
|
||||||
{
|
{
|
||||||
// TODO: only insert if hasDLC
|
if (image.sprite != null) possibleSubtitles.Insert(0, image.sprite); // ensure that the Echoes of the Eye subtitle always appears first
|
||||||
possibleSubtitles.Insert(0, image.sprite); // ensure that the Echoes of the Eye subtitle always appears first
|
|
||||||
eoteSubtitleHasBeenInserted = true;
|
eoteSubtitleHasBeenInserted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddSubtitle(IModBehaviour mod, string filepath)
|
public static void AddSubtitle(IModBehaviour mod, string filepath)
|
||||||
{
|
{
|
||||||
|
|
||||||
var tex = ImageUtilities.GetTexture(mod, filepath);
|
var tex = ImageUtilities.GetTexture(mod, filepath);
|
||||||
if (tex == null) return;
|
if (tex == null) return;
|
||||||
|
|
||||||
@ -60,6 +64,8 @@ namespace NewHorizons.Handlers
|
|||||||
|
|
||||||
public void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
|
if (image.sprite == null) image.sprite = possibleSubtitles[0];
|
||||||
|
|
||||||
// don't fade transition subtitles if there's only one subtitle
|
// don't fade transition subtitles if there's only one subtitle
|
||||||
if (possibleSubtitles.Count <= 1) return;
|
if (possibleSubtitles.Count <= 1) return;
|
||||||
|
|
||||||
|
|||||||
@ -14,9 +14,15 @@ namespace NewHorizons.Handlers
|
|||||||
public static void InitSubtitles()
|
public static void InitSubtitles()
|
||||||
{
|
{
|
||||||
GameObject subtitleContainer = GameObject.Find("TitleMenu/TitleCanvas/TitleLayoutGroup/Logo_EchoesOfTheEye");
|
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)
|
public static void DisplayBodyOnTitleScreen(List<NewHorizonsBody> bodies)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user