Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMOD fade-outs #564

Merged
merged 5 commits into from
Nov 13, 2024
Merged

Conversation

Metious
Copy link
Member

@Metious Metious commented Nov 10, 2024

Changes made in this pull request

  • The game now respects fade-out points for custom sounds.

You can add a fade-out point using one of the two methods:

  1. Directly on the Sound object when you're creating one. This makes the Sound always fade-out when fading is allowed
  2. On the Channel object after the sound is played. This approach is manual and only applies the fade-out once.

REQUIRES THOROUGH TESTING

Copy link
Member

@LeeTwentyThree LeeTwentyThree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a fix.

channel.stop();
return false;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
channel.getDelay(out ulong _, out ulong _, out bool stopChannels);
if (stopChannels)
return false;

This prevents unnecessary and conflicting fade points from cluttering the sound channel.

@LeeTwentyThree LeeTwentyThree merged commit 9d4a89e into SubnauticaModding:master Nov 13, 2024
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2024
@@ -761,14 +778,22 @@ public static bool FMOD_CustomEmitter_Play_Prefix(FMOD_CustomEmitter __instance)

[HarmonyPatch(typeof(FMOD_CustomEmitter), nameof(FMOD_CustomEmitter.Stop))]
[HarmonyPrefix]
public static bool FMOD_CustomEmitter_Stop_Prefix(FMOD_CustomEmitter __instance)
public static bool FMOD_CustomEmitter_Stop_Prefix(FMOD_CustomEmitter __instance, STOP_MODE stopMode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Causes #573. This method in BZ doesn't take a STOP_MODE parameter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants