diff --git a/docs/src/content/docs/guides/title-screens.md b/docs/src/content/docs/guides/title-screens.md index 8c415471..c0373246 100644 --- a/docs/src/content/docs/guides/title-screens.md +++ b/docs/src/content/docs/guides/title-screens.md @@ -146,6 +146,25 @@ UnityEvent GetTitleScreenLoadedEvent(); UnityEvent GetAllTitleScreensLoadedEvent(); ``` +### Example usage + +```csharp title="YourModBehaviour.cs" +NewHorizons = ModHelper.Interaction.TryGetModApi("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 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.