1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-16 10:12:54 +08:00

Merge pull request #10817 from peppy/fix-combo-break-sounds

Fix combo break sounds playing during seek
This commit is contained in:
Bartłomiej Dach 2020-11-13 21:46:03 +01:00 committed by GitHub
commit 1482b26a94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,12 +38,21 @@ namespace osu.Game.Screens.Play
processor.Combo.BindValueChanged(onComboChange);
}
[Resolved(canBeNull: true)]
private ISamplePlaybackDisabler samplePlaybackDisabler { get; set; }
private void onComboChange(ValueChangedEvent<int> combo)
{
if (combo.NewValue == 0 && (combo.OldValue > 20 || (alwaysPlay.Value && firstTime)))
{
comboBreakSample?.Play();
firstTime = false;
// combo break isn't a pausable sound itself as we want to let it play out.
// we still need to disable during seeks, though.
if (samplePlaybackDisabler?.SamplePlaybackDisabled.Value == true)
return;
comboBreakSample?.Play();
}
}
}