mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 07:22:55 +08:00
Fixed applause sound stopping after switching scores
This commit is contained in:
parent
a96603f025
commit
76a377f3e0
@ -83,8 +83,6 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
|||||||
private Container<RankBadge> badges;
|
private Container<RankBadge> badges;
|
||||||
private RankText rankText;
|
private RankText rankText;
|
||||||
|
|
||||||
private SkinnableSound applauseSound;
|
|
||||||
|
|
||||||
public AccuracyCircle(ScoreInfo score, bool withFlair)
|
public AccuracyCircle(ScoreInfo score, bool withFlair)
|
||||||
{
|
{
|
||||||
this.score = score;
|
this.score = score;
|
||||||
@ -211,13 +209,6 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
|||||||
},
|
},
|
||||||
rankText = new RankText(score.Rank)
|
rankText = new RankText(score.Rank)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (withFlair)
|
|
||||||
{
|
|
||||||
AddInternal(applauseSound = score.Rank >= ScoreRank.A
|
|
||||||
? new SkinnableSound(new SampleInfo("Results/rankpass", "applause"))
|
|
||||||
: new SkinnableSound(new SampleInfo("Results/rankfail")));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ScoreRank getRank(ScoreRank rank)
|
private ScoreRank getRank(ScoreRank rank)
|
||||||
@ -256,7 +247,6 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
|||||||
|
|
||||||
using (BeginDelayedSequence(TEXT_APPEAR_DELAY, true))
|
using (BeginDelayedSequence(TEXT_APPEAR_DELAY, true))
|
||||||
{
|
{
|
||||||
this.Delay(-1440).Schedule(() => applauseSound?.Play());
|
|
||||||
rankText.Appear();
|
rankText.Appear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
|
using osu.Game.Audio;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
@ -19,7 +20,9 @@ using osu.Game.Online.API;
|
|||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
|
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
||||||
using osu.Game.Screens.Ranking.Statistics;
|
using osu.Game.Screens.Ranking.Statistics;
|
||||||
|
using osu.Game.Skinning;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Ranking
|
namespace osu.Game.Screens.Ranking
|
||||||
@ -56,6 +59,8 @@ namespace osu.Game.Screens.Ranking
|
|||||||
private readonly bool allowRetry;
|
private readonly bool allowRetry;
|
||||||
private readonly bool allowWatchingReplay;
|
private readonly bool allowWatchingReplay;
|
||||||
|
|
||||||
|
private SkinnableSound applauseSound;
|
||||||
|
|
||||||
protected ResultsScreen(ScoreInfo score, bool allowRetry, bool allowWatchingReplay = true)
|
protected ResultsScreen(ScoreInfo score, bool allowRetry, bool allowWatchingReplay = true)
|
||||||
{
|
{
|
||||||
Score = score;
|
Score = score;
|
||||||
@ -146,6 +151,13 @@ namespace osu.Game.Screens.Ranking
|
|||||||
bool shouldFlair = player != null && !Score.Mods.Any(m => m is ModAutoplay);
|
bool shouldFlair = player != null && !Score.Mods.Any(m => m is ModAutoplay);
|
||||||
|
|
||||||
ScorePanelList.AddScore(Score, shouldFlair);
|
ScorePanelList.AddScore(Score, shouldFlair);
|
||||||
|
|
||||||
|
if (shouldFlair)
|
||||||
|
{
|
||||||
|
AddInternal(applauseSound = Score.Rank >= ScoreRank.A
|
||||||
|
? new SkinnableSound(new SampleInfo("Results/rankpass", "applause"))
|
||||||
|
: new SkinnableSound(new SampleInfo("Results/rankfail")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allowWatchingReplay)
|
if (allowWatchingReplay)
|
||||||
@ -183,6 +195,11 @@ namespace osu.Game.Screens.Ranking
|
|||||||
api.Queue(req);
|
api.Queue(req);
|
||||||
|
|
||||||
statisticsPanel.State.BindValueChanged(onStatisticsStateChanged, true);
|
statisticsPanel.State.BindValueChanged(onStatisticsStateChanged, true);
|
||||||
|
|
||||||
|
using(BeginDelayedSequence(AccuracyCircle.ACCURACY_TRANSFORM_DELAY + AccuracyCircle.TEXT_APPEAR_DELAY, true))
|
||||||
|
{
|
||||||
|
this.Delay(-1000).Schedule(() => applauseSound?.Play());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
Loading…
Reference in New Issue
Block a user