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

Fade out pause loop sound when the game window is inactive #32450

Merged
merged 2 commits into from
Mar 20, 2025

Conversation

peppy
Copy link
Member

@peppy peppy commented Mar 19, 2025

Closes #32432.

@bdach bdach self-requested a review March 19, 2025 10:41
if (host != null)
{
windowActive = host.IsActive.GetBoundCopy();
windowActive.BindValueChanged(_ => Schedule(() => pauseLoop.VolumeTo(targetVolume, 1000, Easing.Out)));
Copy link
Collaborator

Choose a reason for hiding this comment

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

BindValueChanged() callback in BDL rather than in LoadComplete()? Also what's with the schedule, is it a workaround for this being in BDL?

Copy link
Member Author

Choose a reason for hiding this comment

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

The schedule is very unfortunate. It seems the window active flag is not always on the update thread...

JetBrains Rider-EAP 2025-03-19 at 10 55 36

Copy link
Collaborator

Choose a reason for hiding this comment

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

I figured that might have been the case as well, sure.

@peppy peppy force-pushed the no-pause-loop-when-inactive-window branch from d949f8b to c1604a7 Compare March 19, 2025 10:56
@peppy peppy merged commit 85ef743 into ppy:master Mar 20, 2025
9 of 17 checks passed
@peppy peppy deleted the no-pause-loop-when-inactive-window branch March 24, 2025 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pause loop continues playing even if the window is inactive
2 participants