Removed audio fade in feature that wasn't working

This commit is contained in:
josshmot 2025-04-05 12:18:08 +10:00
parent 5cf7c18a51
commit 8fcf7d3031
2 changed files with 5 additions and 13 deletions

View File

@ -153,9 +153,8 @@ namespace NewHorizons.Components
completeCreditsLoad = (fromScene, toScene) =>
{
// Patch new music
// Patch new music clip
var musicSource = Locator.FindObjectsOfType<OWAudioSource>().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,7 +175,7 @@ namespace NewHorizons.Components
while (Locator.FindObjectsOfType<CreditsScrollSection>().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;
}
}

View File

@ -45,13 +45,6 @@ namespace NewHorizons.External.Modules
[DefaultValue(false)]
public bool audioLooping;
/// <summary>
/// Length of the credits music fade in.
/// Note: only applies when creditsType is set to "custom".
/// </summary>
[DefaultValue(0f)]
public float audioFadeInLength;
/// <summary>
/// Duration of the credits scroll in seconds.
/// Note: only applies when creditsType is set to "custom".