mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 09:02:58 +08:00
Simplify playback logic
This commit is contained in:
parent
4dbcb41dd1
commit
44a594ba05
@ -4,6 +4,7 @@
|
|||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
@ -85,9 +86,6 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly Easing ACCURACY_TRANSFORM_EASING = Easing.OutPow10;
|
public static readonly Easing ACCURACY_TRANSFORM_EASING = Easing.OutPow10;
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private SkinManager skins { get; set; }
|
|
||||||
|
|
||||||
private readonly ScoreInfo score;
|
private readonly ScoreInfo score;
|
||||||
|
|
||||||
private CircularProgress accuracyCircle;
|
private CircularProgress accuracyCircle;
|
||||||
@ -101,7 +99,6 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
|||||||
private PoolableSkinnableSample swooshUpSound;
|
private PoolableSkinnableSample swooshUpSound;
|
||||||
private PoolableSkinnableSample rankImpactSound;
|
private PoolableSkinnableSample rankImpactSound;
|
||||||
private PoolableSkinnableSample rankApplauseSound;
|
private PoolableSkinnableSample rankApplauseSound;
|
||||||
private PoolableSkinnableSample rankLegacyApplauseSound;
|
|
||||||
|
|
||||||
private readonly Bindable<double> tickPlaybackRate = new Bindable<double>();
|
private readonly Bindable<double> tickPlaybackRate = new Bindable<double>();
|
||||||
|
|
||||||
@ -263,11 +260,15 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
|||||||
if (isFailedSDueToMisses)
|
if (isFailedSDueToMisses)
|
||||||
AddInternal(failedSRankText = new RankText(ScoreRank.S));
|
AddInternal(failedSRankText = new RankText(ScoreRank.S));
|
||||||
|
|
||||||
|
var applauseSamples = new List<string> { applauseSampleName };
|
||||||
|
if (score.Rank >= ScoreRank.B)
|
||||||
|
// when rank is B or higher, play legacy applause sample on legacy skins.
|
||||||
|
applauseSamples.Insert(0, @"applause");
|
||||||
|
|
||||||
AddRangeInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
rankImpactSound = new PoolableSkinnableSample(new SampleInfo(impactSampleName)),
|
rankImpactSound = new PoolableSkinnableSample(new SampleInfo(impactSampleName)),
|
||||||
rankApplauseSound = new PoolableSkinnableSample(new SampleInfo(applauseSampleName)),
|
rankApplauseSound = new PoolableSkinnableSample(new SampleInfo(applauseSamples.ToArray())),
|
||||||
rankLegacyApplauseSound = new PoolableSkinnableSample(new SampleInfo("applause")),
|
|
||||||
scoreTickSound = new PoolableSkinnableSample(new SampleInfo(@"Results/score-tick")),
|
scoreTickSound = new PoolableSkinnableSample(new SampleInfo(@"Results/score-tick")),
|
||||||
badgeTickSound = new PoolableSkinnableSample(new SampleInfo(@"Results/badge-dink")),
|
badgeTickSound = new PoolableSkinnableSample(new SampleInfo(@"Results/badge-dink")),
|
||||||
badgeMaxSound = new PoolableSkinnableSample(new SampleInfo(@"Results/badge-dink-max")),
|
badgeMaxSound = new PoolableSkinnableSample(new SampleInfo(@"Results/badge-dink-max")),
|
||||||
@ -401,20 +402,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
|||||||
{
|
{
|
||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
if (skins.CurrentSkin.Value is LegacySkin)
|
rankApplauseSound.VolumeTo(applause_volume);
|
||||||
{
|
rankApplauseSound.Play();
|
||||||
// only play legacy "applause" sound if score rank is B or higher.
|
|
||||||
if (score.Rank >= ScoreRank.B)
|
|
||||||
{
|
|
||||||
rankLegacyApplauseSound.VolumeTo(applause_volume);
|
|
||||||
rankLegacyApplauseSound.Play();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rankApplauseSound.VolumeTo(applause_volume);
|
|
||||||
rankApplauseSound.Play();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user