Fix combo break sounds playing when seeking

This commit is contained in:
Dean Herbert 2020-11-13 13:15:54 +09:00
parent 030df8234a
commit 43626573df
1 changed files with 10 additions and 1 deletions

View File

@ -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();
}
}
}