diff --git a/NewHorizons/External/Configs/TitleScreenConfig.cs b/NewHorizons/External/Configs/TitleScreenConfig.cs index 3ae2f0ee..92ef0bbb 100644 --- a/NewHorizons/External/Configs/TitleScreenConfig.cs +++ b/NewHorizons/External/Configs/TitleScreenConfig.cs @@ -40,10 +40,15 @@ namespace NewHorizons.External.Configs public SkyboxModule Skybox; /// - /// Relative path to music to replace the title screen music with. + /// The music audio that will play on the title screen. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list. /// public string music; + /// + /// The ambience audio that will play on the title screen. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list. + /// + public string ambience; + /// /// Changes the speed the main menu planet and the skybox rotates. /// diff --git a/NewHorizons/Handlers/TitleSceneHandler.cs b/NewHorizons/Handlers/TitleSceneHandler.cs index 8d04e7fa..9f72f6b9 100644 --- a/NewHorizons/Handlers/TitleSceneHandler.cs +++ b/NewHorizons/Handlers/TitleSceneHandler.cs @@ -60,6 +60,13 @@ namespace NewHorizons.Handlers Delay.FireOnNextUpdate(() => musicSource.AssignAudioLibraryClip(audioType)); } + if (!string.IsNullOrEmpty(config.ambience)) + { + var ambienceSource = SearchUtilities.Find("Scene/AudioSource_Ambience").GetComponent(); + var audioType = AudioTypeHandler.GetAudioType(config.ambience, mod); + Delay.FireOnNextUpdate(() => ambienceSource.AssignAudioLibraryClip(audioType)); + } + if (config.MenuPlanet != null) { if (config.MenuPlanet.destroyMenuPlanet)