mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
example
This commit is contained in:
parent
e94fc11bb9
commit
627599b71d
@ -146,6 +146,25 @@ UnityEvent<string> GetTitleScreenLoadedEvent();
|
|||||||
UnityEvent GetAllTitleScreensLoadedEvent();
|
UnityEvent GetAllTitleScreensLoadedEvent();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Example usage
|
||||||
|
|
||||||
|
```csharp title="YourModBehaviour.cs"
|
||||||
|
NewHorizons = ModHelper.Interaction.TryGetModApi<INewHorizons>("xen.NewHorizons");
|
||||||
|
NewHorizons.GetTitleScreenLoadedEvent().AddListener(OnTitleScreenLoaded);
|
||||||
|
NewHorizons.GetAllTitleScreensLoadedEvent().AddListener(OnAllTitleScreensLoaded);
|
||||||
|
```
|
||||||
|
|
||||||
|
```csharp title="YourModBehaviour.cs"
|
||||||
|
public void OnTitleScreenLoaded(string modUniqueName)
|
||||||
|
{
|
||||||
|
ModHelper.Console.WriteLine($"Title screen loaded: " + modUniqueName, MessageType.Success);
|
||||||
|
}
|
||||||
|
public void OnAllTitleScreensLoaded()
|
||||||
|
{
|
||||||
|
ModHelper.Console.WriteLine($"All title screens loaded", MessageType.Success);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Sharing
|
## Sharing
|
||||||
|
|
||||||
New Horizons will randomly select a valid title screen each time the user enters the main menu and then if `shareTitleScreen` is set to `true` it will build all the other shareable title screens (that also have matching `disableNHPlanets` values). If it doesn't have share set to true then it will only show the randomly selected.
|
New Horizons will randomly select a valid title screen each time the user enters the main menu and then if `shareTitleScreen` is set to `true` it will build all the other shareable title screens (that also have matching `disableNHPlanets` values). If it doesn't have share set to true then it will only show the randomly selected.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user