mirror of
https://github.com/ppy/osu
synced 2025-02-05 21:01:37 +00:00
Fix combo break sound not playing after rewind
This commit is contained in:
parent
43626573df
commit
4b5743d993
@ -17,8 +17,9 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private SkinnableSound comboBreakSample;
|
private SkinnableSound comboBreakSample;
|
||||||
|
|
||||||
private Bindable<bool> alwaysPlay;
|
private Bindable<bool> alwaysPlayFirst;
|
||||||
private bool firstTime = true;
|
|
||||||
|
private double? firstBreakTime;
|
||||||
|
|
||||||
public ComboEffects(ScoreProcessor processor)
|
public ComboEffects(ScoreProcessor processor)
|
||||||
{
|
{
|
||||||
@ -29,7 +30,7 @@ namespace osu.Game.Screens.Play
|
|||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
InternalChild = comboBreakSample = new SkinnableSound(new SampleInfo("Gameplay/combobreak"));
|
InternalChild = comboBreakSample = new SkinnableSound(new SampleInfo("Gameplay/combobreak"));
|
||||||
alwaysPlay = config.GetBindable<bool>(OsuSetting.AlwaysPlayFirstComboBreak);
|
alwaysPlayFirst = config.GetBindable<bool>(OsuSetting.AlwaysPlayFirstComboBreak);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -41,11 +42,21 @@ namespace osu.Game.Screens.Play
|
|||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
private ISamplePlaybackDisabler samplePlaybackDisabler { get; set; }
|
private ISamplePlaybackDisabler samplePlaybackDisabler { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private GameplayClock gameplayClock { get; set; }
|
||||||
|
|
||||||
private void onComboChange(ValueChangedEvent<int> combo)
|
private void onComboChange(ValueChangedEvent<int> combo)
|
||||||
{
|
{
|
||||||
if (combo.NewValue == 0 && (combo.OldValue > 20 || (alwaysPlay.Value && firstTime)))
|
// handle the case of rewinding before the first combo break time.
|
||||||
|
if (gameplayClock.CurrentTime < firstBreakTime)
|
||||||
|
firstBreakTime = null;
|
||||||
|
|
||||||
|
if (gameplayClock.ElapsedFrameTime < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (combo.NewValue == 0 && (combo.OldValue > 20 || (alwaysPlayFirst.Value && firstBreakTime == null)))
|
||||||
{
|
{
|
||||||
firstTime = false;
|
firstBreakTime = gameplayClock.CurrentTime;
|
||||||
|
|
||||||
// combo break isn't a pausable sound itself as we want to let it play out.
|
// combo break isn't a pausable sound itself as we want to let it play out.
|
||||||
// we still need to disable during seeks, though.
|
// we still need to disable during seeks, though.
|
||||||
|
@ -302,12 +302,12 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
ScoreProcessor,
|
ScoreProcessor,
|
||||||
HealthProcessor,
|
HealthProcessor,
|
||||||
|
new ComboEffects(ScoreProcessor),
|
||||||
breakTracker = new BreakTracker(DrawableRuleset.GameplayStartTime, ScoreProcessor)
|
breakTracker = new BreakTracker(DrawableRuleset.GameplayStartTime, ScoreProcessor)
|
||||||
{
|
{
|
||||||
Breaks = working.Beatmap.Breaks
|
Breaks = working.Beatmap.Breaks
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
new ComboEffects(ScoreProcessor)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user