From ab2bf1118afffc5dae04371d4f91ec752eada38e Mon Sep 17 00:00:00 2001 From: xen-42 Date: Fri, 4 Oct 2024 15:08:49 -0400 Subject: [PATCH] Add an API method for setting spawn ID --- NewHorizons/INewHorizons.cs | 7 +++++++ NewHorizons/NewHorizonsApi.cs | 2 ++ 2 files changed, 9 insertions(+) diff --git a/NewHorizons/INewHorizons.cs b/NewHorizons/INewHorizons.cs index 71337802..12002b1e 100644 --- a/NewHorizons/INewHorizons.cs +++ b/NewHorizons/INewHorizons.cs @@ -214,5 +214,12 @@ namespace NewHorizons /// /// void AddSubtitle(IModBehaviour mod, string filePath); + + /// + /// Whatever system the player is warping to next, they will spawn at the spawn point with this ID + /// Gets reset after warping. Is also overriden by entering a system-changing black hole or warp volume by their `spawnPointID` + /// + /// + void SetNextSpawnID(string id); } } diff --git a/NewHorizons/NewHorizonsApi.cs b/NewHorizons/NewHorizonsApi.cs index c9193f61..348991c0 100644 --- a/NewHorizons/NewHorizonsApi.cs +++ b/NewHorizons/NewHorizonsApi.cs @@ -342,5 +342,7 @@ namespace NewHorizons public string GetTranslationForOtherText(string text) => TranslationHandler.GetTranslation(text, TranslationHandler.TextType.OTHER); public void AddSubtitle(IModBehaviour mod, string filePath) => SubtitlesHandler.RegisterAdditionalSubtitle(mod, filePath); + + public void SetNextSpawnID(string id) => PlayerSpawnHandler.TargetSpawnID = id; } }