mirror of https://github.com/ppy/osu
Fix combo break sounds playing when seeking
This commit is contained in:
parent
030df8234a
commit
43626573df
|
@ -38,12 +38,21 @@ protected override void LoadComplete()
|
|||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue