mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Change config to a list of infos
This commit is contained in:
parent
d9441f5140
commit
d827d6956d
@ -8,6 +8,15 @@ namespace NewHorizons.External.Configs
|
|||||||
{
|
{
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class TitleScreenConfig
|
public class TitleScreenConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Create title screens
|
||||||
|
/// </summary>
|
||||||
|
public TitleScreenInfo[] titleScreens;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonObject]
|
||||||
|
public class TitleScreenInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Colour of the text on the main menu
|
/// Colour of the text on the main menu
|
||||||
|
|||||||
@ -119,7 +119,7 @@ namespace NewHorizons.Handlers
|
|||||||
subtitleContainer.AddComponent<SubtitlesHandler>();
|
subtitleContainer.AddComponent<SubtitlesHandler>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void BuildConfig(IModBehaviour mod, TitleScreenConfig config)
|
public static void BuildConfig(IModBehaviour mod, TitleScreenInfo config)
|
||||||
{
|
{
|
||||||
if (config.menuTextTint != null)
|
if (config.menuTextTint != null)
|
||||||
{
|
{
|
||||||
@ -436,7 +436,7 @@ namespace NewHorizons.Handlers
|
|||||||
TitleScreenBuilders[mod].Add(builder);
|
TitleScreenBuilders[mod].Add(builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RegisterBuilder(IModBehaviour mod, TitleScreenConfig config)
|
public static void RegisterBuilder(IModBehaviour mod, TitleScreenInfo config)
|
||||||
=> RegisterBuilder(mod,
|
=> RegisterBuilder(mod,
|
||||||
new TitleScreenConfigBuilder(mod, config));
|
new TitleScreenConfigBuilder(mod, config));
|
||||||
|
|
||||||
@ -522,9 +522,9 @@ namespace NewHorizons.Handlers
|
|||||||
internal class TitleScreenConfigBuilder : ITitleScreenBuilder
|
internal class TitleScreenConfigBuilder : ITitleScreenBuilder
|
||||||
{
|
{
|
||||||
public IModBehaviour mod;
|
public IModBehaviour mod;
|
||||||
public TitleScreenConfig config;
|
public TitleScreenInfo config;
|
||||||
|
|
||||||
public TitleScreenConfigBuilder(IModBehaviour mod, TitleScreenConfig config)
|
public TitleScreenConfigBuilder(IModBehaviour mod, TitleScreenInfo config)
|
||||||
{
|
{
|
||||||
this.mod = mod;
|
this.mod = mod;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
|
|||||||
@ -860,6 +860,10 @@ namespace NewHorizons
|
|||||||
}
|
}
|
||||||
|
|
||||||
TitleScreenConfigs[mod] = titleScreenConfig;
|
TitleScreenConfigs[mod] = titleScreenConfig;
|
||||||
|
foreach (var info in titleScreenConfig.titleScreens)
|
||||||
|
{
|
||||||
|
TitleSceneHandler.RegisterBuilder(mod, info);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadTranslations(string folder, IModBehaviour mod)
|
private void LoadTranslations(string folder, IModBehaviour mod)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user