Remove subtitle from system config, default to "subtitle.png"

This commit is contained in:
Nick 2022-05-25 19:25:34 -04:00
parent f53d7356c6
commit c0e6c1191a
3 changed files with 11 additions and 14 deletions

View File

@ -1,4 +1,4 @@
using System.ComponentModel; using System.ComponentModel;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace NewHorizons.External.Configs namespace NewHorizons.External.Configs
@ -51,11 +51,6 @@ namespace NewHorizons.External.Configs
/// </summary> /// </summary>
public bool startHere; public bool startHere;
/// <summary>
/// Relative path to the image file to use as the subtitle image (replaces the eote banner)
/// </summary>
public string subtitle;
public class NomaiCoordinates public class NomaiCoordinates
{ {
public int[] x; public int[] x;

View File

@ -1,8 +1,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using NewHorizons.Utility; using NewHorizons.Utility;
using OWML.Common; using OWML.Common;
using Logger = NewHorizons.Utility.Logger;
namespace NewHorizons.Handlers namespace NewHorizons.Handlers
{ {
@ -49,6 +50,8 @@ namespace NewHorizons.Handlers
public static void AddSubtitle(IModBehaviour mod, string filepath) public static void AddSubtitle(IModBehaviour mod, string filepath)
{ {
Logger.Log($"Adding subtitle for {mod.ModHelper.Manifest.Name}");
var tex = ImageUtilities.GetTexture(mod, filepath); var tex = ImageUtilities.GetTexture(mod, filepath);
if (tex == null) return; if (tex == null) return;

View File

@ -1,4 +1,4 @@
using HarmonyLib; using HarmonyLib;
using NewHorizons.Builder.Props; using NewHorizons.Builder.Props;
using NewHorizons.Components; using NewHorizons.Components;
using NewHorizons.External.Configs; using NewHorizons.External.Configs;
@ -316,11 +316,6 @@ namespace NewHorizons
if (name != "SolarSystem") SetDefaultSystem(name); if (name != "SolarSystem") SetDefaultSystem(name);
} }
if (starSystemConfig.subtitle != null)
{
SubtitlesHandler.AddSubtitle(mod, starSystemConfig.subtitle);
}
var system = new NewHorizonsSystem(name, starSystemConfig, mod); var system = new NewHorizonsSystem(name, starSystemConfig, mod);
SystemDict[name] = system; SystemDict[name] = system;
} }
@ -347,6 +342,10 @@ namespace NewHorizons
{ {
LoadTranslations(folder, mod); LoadTranslations(folder, mod);
} }
if (File.Exists($"{mod.ModHelper.Manifest.ModFolderPath}subtitle.png"))
{
SubtitlesHandler.AddSubtitle(mod, "subtitle.png");
}
} }
catch (Exception ex) catch (Exception ex)
{ {