From 8fcf7d303163b995433b76882fb3c574974c9d12 Mon Sep 17 00:00:00 2001 From: josshmot Date: Sat, 5 Apr 2025 12:18:08 +1000 Subject: [PATCH] Removed audio fade in feature that wasn't working --- NewHorizons/Components/NHGameOverManager.cs | 11 +++++------ NewHorizons/External/Modules/GameOverModule.cs | 7 ------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/NewHorizons/Components/NHGameOverManager.cs b/NewHorizons/Components/NHGameOverManager.cs index f1055799..6dd351ad 100644 --- a/NewHorizons/Components/NHGameOverManager.cs +++ b/NewHorizons/Components/NHGameOverManager.cs @@ -153,9 +153,8 @@ namespace NewHorizons.Components completeCreditsLoad = (fromScene, toScene) => { - // Patch new music + // Patch new music clip var musicSource = Locator.FindObjectsOfType().Where(x => x.name == "AudioSource").Single(); - musicSource.Stop(); if (mod is not null) { AudioUtilities.SetAudioClip(musicSource, gameOver.audio, mod); @@ -164,10 +163,10 @@ namespace NewHorizons.Components { // We can't load in custom music if an IModBehaviour cannot be provided. This should only happen if called via TryHijackDeathSequence(). NHLogger.LogWarning("Credits called using TryHijackDeathSequence(), custom credits audio cannot not be loaded."); + return; } - musicSource.SetMaxVolume(gameOver.audioVolume); musicSource.loop = gameOver.audioLooping; - musicSource.FadeIn(gameOver.audioFadeInLength); + musicSource._maxSourceVolume = gameOver.audioVolume; // Janky wait until credits are built Task.Run( () => @@ -176,11 +175,11 @@ namespace NewHorizons.Components while (Locator.FindObjectsOfType().Length == 0) { if (Time.time > startTime + 0.1f) { - NHLogger.LogError("Timeout while waiting for credits to be built. Scroll duration couldn't be changed."); + NHLogger.LogError("Timeout while waiting for credits to be built. Scroll duration won't be changed."); return; } } - + // Patch scroll duration var creditsScroll = Locator.FindObjectOfType(); creditsScroll._scrollDuration = gameOver.length; diff --git a/NewHorizons/External/Modules/GameOverModule.cs b/NewHorizons/External/Modules/GameOverModule.cs index 2fae76ee..4c10830e 100644 --- a/NewHorizons/External/Modules/GameOverModule.cs +++ b/NewHorizons/External/Modules/GameOverModule.cs @@ -45,13 +45,6 @@ namespace NewHorizons.External.Modules [DefaultValue(false)] public bool audioLooping; - /// - /// Length of the credits music fade in. - /// Note: only applies when creditsType is set to "custom". - /// - [DefaultValue(0f)] - public float audioFadeInLength; - /// /// Duration of the credits scroll in seconds. /// Note: only applies when creditsType is set to "custom".