mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Make a config
This commit is contained in:
parent
ffe41747fb
commit
3ea4a3ab2d
5
NewHorizons/External/Configs/AddonConfig.cs
vendored
5
NewHorizons/External/Configs/AddonConfig.cs
vendored
@ -44,5 +44,10 @@ namespace NewHorizons.External.Configs
|
||||
/// The dimensions of the Echoes of the Eye subtitle is 669 x 67, so aim for that size
|
||||
/// </summary>
|
||||
public string subtitlePath = "subtitle.png";
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public MainMenuConfig mainMenuConfig;
|
||||
}
|
||||
}
|
||||
|
||||
19
NewHorizons/External/Configs/MainMenuConfig.cs
vendored
Normal file
19
NewHorizons/External/Configs/MainMenuConfig.cs
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
using NewHorizons.External.SerializableData;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External.Configs
|
||||
{
|
||||
[JsonObject]
|
||||
public class MainMenuConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Colour of the text on the main menu
|
||||
/// </summary>
|
||||
public MColor menuTextTint;
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,13 @@
|
||||
using NewHorizons.Builder.Body;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OWML;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace NewHorizons.Handlers
|
||||
{
|
||||
@ -25,6 +27,18 @@ namespace NewHorizons.Handlers
|
||||
subtitleContainer.AddComponent<SubtitlesHandler>();
|
||||
}
|
||||
|
||||
public static void SetUp(MainMenuConfig config)
|
||||
{
|
||||
if (config.menuTextTint != null)
|
||||
{
|
||||
var buttons = GameObject.FindObjectOfType<TitleScreenManager>()._mainMenu.GetComponentsInChildren<Text>();
|
||||
foreach (var button in buttons)
|
||||
{
|
||||
button.color = config.menuTextTint.ToColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DisplayBodyOnTitleScreen(List<NewHorizonsBody> bodies)
|
||||
{
|
||||
// Try loading one planet why not
|
||||
|
||||
@ -430,6 +430,8 @@ namespace NewHorizons
|
||||
NHLogger.LogError($"Failed to make title screen bodies: {e}");
|
||||
}
|
||||
TitleSceneHandler.InitSubtitles();
|
||||
|
||||
TitleSceneHandler.SetUp(new MainMenuConfig() { menuTextTint = new External.SerializableData.MColor(128, 128, 255) });
|
||||
}
|
||||
|
||||
// EOTU fixes
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user