Merge pull request #8451 from peppy/fix-slider-end-sounds

Only play slider end sounds if tracking
This commit is contained in:
Dan Balasescu 2020-03-27 20:38:59 +09:00 committed by GitHub
commit 3763457a1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -11,6 +11,7 @@
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Skinning;
using osu.Game.Rulesets.Scoring;
using osuTK.Graphics;
using osu.Game.Skinning;
@ -196,6 +197,14 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
ApplyResult(r => r.Type = r.Judgement.MaxResult);
}
public override void PlaySamples()
{
// rather than doing it this way, we should probably attach the sample to the tail circle.
// this can only be done after we stop using LegacyLastTick.
if (TailCircle.Result.Type != HitResult.Miss)
base.PlaySamples();
}
protected override void UpdateStateTransforms(ArmedState state)
{
base.UpdateStateTransforms(state);

View File

@ -344,7 +344,7 @@ protected virtual void ApplySkin(ISkinSource skin, bool allowFallback)
/// Plays all the hit sounds for this <see cref="DrawableHitObject"/>.
/// This is invoked automatically when this <see cref="DrawableHitObject"/> is hit.
/// </summary>
public void PlaySamples() => Samples?.Play();
public virtual void PlaySamples() => Samples?.Play();
protected override void Update()
{