mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 09:37:23 +08:00
Add combobreak sound
This commit is contained in:
parent
9858419c69
commit
7dd1479050
@ -66,6 +66,7 @@ namespace osu.Game.Screens.Play
|
|||||||
private IAPIProvider api;
|
private IAPIProvider api;
|
||||||
|
|
||||||
private SampleChannel sampleRestart;
|
private SampleChannel sampleRestart;
|
||||||
|
private SampleChannel sampleComboBreak;
|
||||||
|
|
||||||
protected ScoreProcessor ScoreProcessor { get; private set; }
|
protected ScoreProcessor ScoreProcessor { get; private set; }
|
||||||
protected DrawableRuleset DrawableRuleset { get; private set; }
|
protected DrawableRuleset DrawableRuleset { get; private set; }
|
||||||
@ -80,6 +81,8 @@ namespace osu.Game.Screens.Play
|
|||||||
[Cached(Type = typeof(IBindable<IReadOnlyList<Mod>>))]
|
[Cached(Type = typeof(IBindable<IReadOnlyList<Mod>>))]
|
||||||
protected new readonly Bindable<IReadOnlyList<Mod>> Mods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<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 allowPause;
|
||||||
private readonly bool showResults;
|
private readonly bool showResults;
|
||||||
|
|
||||||
@ -107,12 +110,15 @@ namespace osu.Game.Screens.Play
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
sampleRestart = audio.Samples.Get(@"Gameplay/restart");
|
sampleRestart = audio.Samples.Get(@"Gameplay/restart");
|
||||||
|
sampleComboBreak = audio.Samples.Get(@"Gameplay/combobreak");
|
||||||
|
|
||||||
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
|
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
|
||||||
showStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
showStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||||
|
|
||||||
ScoreProcessor = DrawableRuleset.CreateScoreProcessor();
|
ScoreProcessor = DrawableRuleset.CreateScoreProcessor();
|
||||||
ScoreProcessor.Mods.BindTo(Mods);
|
ScoreProcessor.Mods.BindTo(Mods);
|
||||||
|
ScoreProcessor.Combo.BindTo(Combo);
|
||||||
|
Combo.BindValueChanged(onComboChange);
|
||||||
|
|
||||||
if (!ScoreProcessor.Mode.Disabled)
|
if (!ScoreProcessor.Mode.Disabled)
|
||||||
config.BindWith(OsuSetting.ScoreDisplayMode, ScoreProcessor.Mode);
|
config.BindWith(OsuSetting.ScoreDisplayMode, ScoreProcessor.Mode);
|
||||||
@ -264,6 +270,12 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private ScheduledDelegate onCompletionEvent;
|
private ScheduledDelegate onCompletionEvent;
|
||||||
|
|
||||||
|
private void onComboChange(ValueChangedEvent<int> combo)
|
||||||
|
{
|
||||||
|
if (combo.NewValue == 0 && combo.OldValue > 20)
|
||||||
|
sampleComboBreak?.Play();
|
||||||
|
}
|
||||||
|
|
||||||
private void onCompletion()
|
private void onCompletion()
|
||||||
{
|
{
|
||||||
// Only show the completion screen if the player hasn't failed
|
// Only show the completion screen if the player hasn't failed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user