mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
feat: renamed subtitleFilepath to subtitle, fixed a modulus that was supposed to be a plus, added a todo
This commit is contained in:
parent
4ae8d71f2c
commit
e636e2a844
@ -4,7 +4,7 @@ namespace NewHorizons.External.Configs
|
||||
{
|
||||
public class StarSystemConfig
|
||||
{
|
||||
public string subtitleFilepath;
|
||||
public string subtitle;
|
||||
|
||||
[DefaultValue(true)] public bool canEnterViaWarpDrive = true;
|
||||
[DefaultValue(true)] public bool enableTimeLoop = true;
|
||||
|
||||
@ -1,16 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.UI;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
@ -44,6 +33,7 @@ namespace NewHorizons.Handlers
|
||||
|
||||
if (!eoteSubtitleHasBeenInserted)
|
||||
{
|
||||
// TODO: only insert if hasDLC
|
||||
possibleSubtitles.Insert(0, image.sprite); // ensure that the Echoes of the Eye subtitle always appears first
|
||||
eoteSubtitleHasBeenInserted = true;
|
||||
}
|
||||
@ -103,8 +93,9 @@ namespace NewHorizons.Handlers
|
||||
|
||||
// note, this makes the code more confusing, but Random.Next(min, max) generates a random number on the range [min, max)
|
||||
// that is, the below code will generate numbers up to and including Count-1, not Count.
|
||||
var newIndexOffset = randomizer.Next(1, possibleSubtitles.Count);
|
||||
subtitleIndex = (subtitleIndex % newIndexOffset) % possibleSubtitles.Count;
|
||||
var newIndexOffset = randomizer.Next(1, possibleSubtitles.Count);
|
||||
subtitleIndex = (subtitleIndex + newIndexOffset) % possibleSubtitles.Count;
|
||||
NewHorizons.Utility.Logger.Log("NEW SPRITE INDEX OFFSET " + newIndexOffset + " NEW SPRITE INDEX " + subtitleIndex);
|
||||
|
||||
image.sprite = possibleSubtitles[subtitleIndex];
|
||||
}
|
||||
|
||||
@ -15,6 +15,8 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
GameObject subtitleContainer = GameObject.Find("TitleMenu/TitleCanvas/TitleLayoutGroup/Logo_EchoesOfTheEye");
|
||||
subtitleContainer.AddComponent<SubtitlesHandler>();
|
||||
|
||||
// TODO: if no subtitleContainer found, make one
|
||||
}
|
||||
|
||||
public static void DisplayBodyOnTitleScreen(List<NewHorizonsBody> bodies)
|
||||
|
||||
@ -314,9 +314,9 @@ namespace NewHorizons
|
||||
if (name != "SolarSystem") SetDefaultSystem(name);
|
||||
}
|
||||
|
||||
if (starSystemConfig.subtitleFilepath != null)
|
||||
if (starSystemConfig.subtitle != null)
|
||||
{
|
||||
SubtitlesHandler.AddSubtitle(mod, starSystemConfig.subtitleFilepath);
|
||||
SubtitlesHandler.AddSubtitle(mod, starSystemConfig.subtitle);
|
||||
}
|
||||
|
||||
var system = new NewHorizonsSystem(name, starSystemConfig, mod);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user