diff --git a/NewHorizons/External/Configs/StarSystemConfig.cs b/NewHorizons/External/Configs/StarSystemConfig.cs index 23533a08..a939a456 100644 --- a/NewHorizons/External/Configs/StarSystemConfig.cs +++ b/NewHorizons/External/Configs/StarSystemConfig.cs @@ -1,4 +1,4 @@ -using System.ComponentModel; +using System.ComponentModel; using Newtonsoft.Json; namespace NewHorizons.External.Configs @@ -51,11 +51,6 @@ namespace NewHorizons.External.Configs /// public bool startHere; - /// - /// Relative path to the image file to use as the subtitle image (replaces the eote banner) - /// - public string subtitle; - public class NomaiCoordinates { public int[] x; diff --git a/NewHorizons/Handlers/SubtitlesHandler.cs b/NewHorizons/Handlers/SubtitlesHandler.cs index 26cdf081..6e302802 100644 --- a/NewHorizons/Handlers/SubtitlesHandler.cs +++ b/NewHorizons/Handlers/SubtitlesHandler.cs @@ -1,8 +1,9 @@ -using System.Collections.Generic; +using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using NewHorizons.Utility; using OWML.Common; +using Logger = NewHorizons.Utility.Logger; namespace NewHorizons.Handlers { @@ -48,7 +49,9 @@ namespace NewHorizons.Handlers } public static void AddSubtitle(IModBehaviour mod, string filepath) - { + { + Logger.Log($"Adding subtitle for {mod.ModHelper.Manifest.Name}"); + var tex = ImageUtilities.GetTexture(mod, filepath); if (tex == null) return; diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index b2bcbcd8..0a965afc 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -1,4 +1,4 @@ -using HarmonyLib; +using HarmonyLib; using NewHorizons.Builder.Props; using NewHorizons.Components; using NewHorizons.External.Configs; @@ -316,11 +316,6 @@ namespace NewHorizons if (name != "SolarSystem") SetDefaultSystem(name); } - if (starSystemConfig.subtitle != null) - { - SubtitlesHandler.AddSubtitle(mod, starSystemConfig.subtitle); - } - var system = new NewHorizonsSystem(name, starSystemConfig, mod); SystemDict[name] = system; } @@ -347,6 +342,10 @@ namespace NewHorizons { LoadTranslations(folder, mod); } + if (File.Exists($"{mod.ModHelper.Manifest.ModFolderPath}subtitle.png")) + { + SubtitlesHandler.AddSubtitle(mod, "subtitle.png"); + } } catch (Exception ex) {