1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-18 06:27:18 +08:00

Add combobreak sound

This commit is contained in:
Welsar55 2019-06-26 00:20:33 -05:00
parent 9858419c69
commit 7dd1479050

View File

@ -66,6 +66,7 @@ namespace osu.Game.Screens.Play
private IAPIProvider api;
private SampleChannel sampleRestart;
private SampleChannel sampleComboBreak;
protected ScoreProcessor ScoreProcessor { get; private set; }
protected DrawableRuleset DrawableRuleset { get; private set; }
@ -80,6 +81,8 @@ namespace osu.Game.Screens.Play
[Cached(Type = typeof(IBindable<IReadOnlyList<Mod>>))]
protected new readonly Bindable<IReadOnlyList<Mod>> Mods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
protected readonly BindableInt Combo = new BindableInt();
private readonly bool allowPause;
private readonly bool showResults;
@ -107,12 +110,15 @@ namespace osu.Game.Screens.Play
return;
sampleRestart = audio.Samples.Get(@"Gameplay/restart");
sampleComboBreak = audio.Samples.Get(@"Gameplay/combobreak");
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
showStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
ScoreProcessor = DrawableRuleset.CreateScoreProcessor();
ScoreProcessor.Mods.BindTo(Mods);
ScoreProcessor.Combo.BindTo(Combo);
Combo.BindValueChanged(onComboChange);
if (!ScoreProcessor.Mode.Disabled)
config.BindWith(OsuSetting.ScoreDisplayMode, ScoreProcessor.Mode);
@ -264,6 +270,12 @@ namespace osu.Game.Screens.Play
private ScheduledDelegate onCompletionEvent;
private void onComboChange(ValueChangedEvent<int> combo)
{
if (combo.NewValue == 0 && combo.OldValue > 20)
sampleComboBreak?.Play();
}
private void onCompletion()
{
// Only show the completion screen if the player hasn't failed