mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
change to string event
This commit is contained in:
parent
cfaa0dc55a
commit
325180589f
@ -91,15 +91,6 @@ namespace NewHorizons.Handlers
|
||||
// default to displaying nh planets if no title screen builders
|
||||
else
|
||||
DisplayBodiesOnTitleScreen();
|
||||
|
||||
try
|
||||
{
|
||||
Main.Instance.OnTitleScreenLoaded?.Invoke();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
NHLogger.LogError($"Error in event handler for OnTitleScreenLoaded: {e}");
|
||||
}
|
||||
}
|
||||
|
||||
public static void InitSubtitles()
|
||||
@ -465,6 +456,15 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
NHLogger.LogError(e);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Main.Instance.OnTitleScreenLoaded?.Invoke(mod.ModHelper.Manifest.UniqueName);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
NHLogger.LogError($"Error in event handler for OnTitleScreenLoaded on title screen {mod.ModHelper.Manifest.UniqueName}: {e}");
|
||||
}
|
||||
}
|
||||
|
||||
public IModBehaviour Mod => mod;
|
||||
@ -500,6 +500,15 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
NHLogger.LogError(e);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Main.Instance.OnTitleScreenLoaded?.Invoke(mod.ModHelper.Manifest.UniqueName);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
NHLogger.LogError($"Error in event handler for OnTitleScreenLoaded on title screen {mod.ModHelper.Manifest.UniqueName}: {e}");
|
||||
}
|
||||
}
|
||||
|
||||
public IModBehaviour Mod => mod;
|
||||
|
||||
@ -75,9 +75,10 @@ namespace NewHorizons
|
||||
UnityEvent<string> GetBodyLoadedEvent();
|
||||
|
||||
/// <summary>
|
||||
/// An event invoked when NH has finished building the title screen.
|
||||
/// An event invoked when NH has finished building a title screen.
|
||||
/// Gives the unique name of the mod the title screen builder was from.
|
||||
/// </summary>
|
||||
UnityEvent GetTitleScreenLoadedEvent();
|
||||
UnityEvent<string> GetTitleScreenLoadedEvent();
|
||||
#endregion
|
||||
|
||||
#region Querying configs
|
||||
|
||||
@ -107,11 +107,11 @@ namespace NewHorizons
|
||||
public ShipWarpController ShipWarpController { get; private set; }
|
||||
|
||||
// API events
|
||||
public class StarSystemEvent : UnityEvent<string> { }
|
||||
public StarSystemEvent OnChangeStarSystem = new();
|
||||
public StarSystemEvent OnStarSystemLoaded = new();
|
||||
public StarSystemEvent OnPlanetLoaded = new();
|
||||
public UnityEvent OnTitleScreenLoaded = new();
|
||||
public class StringEvent : UnityEvent<string> { }
|
||||
public StringEvent OnChangeStarSystem = new();
|
||||
public StringEvent OnStarSystemLoaded = new();
|
||||
public StringEvent OnPlanetLoaded = new();
|
||||
public StringEvent OnTitleScreenLoaded = new();
|
||||
|
||||
/// <summary>
|
||||
/// Depending on platform, the AsyncOwnershipStatus might not be ready by the time we go to check it.
|
||||
|
||||
@ -90,7 +90,7 @@ namespace NewHorizons
|
||||
public UnityEvent<string> GetChangeStarSystemEvent() => Main.Instance.OnChangeStarSystem;
|
||||
public UnityEvent<string> GetStarSystemLoadedEvent() => Main.Instance.OnStarSystemLoaded;
|
||||
public UnityEvent<string> GetBodyLoadedEvent() => Main.Instance.OnPlanetLoaded;
|
||||
public UnityEvent GetTitleScreenLoadedEvent() => Main.Instance.OnTitleScreenLoaded;
|
||||
public UnityEvent<string> GetTitleScreenLoadedEvent() => Main.Instance.OnTitleScreenLoaded;
|
||||
|
||||
public bool SetDefaultSystem(string name)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user