1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Merge pull request #27517 from Joehuu/fix-failed-s-accuracy-circle

Fix results screen accuracy circle not showing correctly for failed S with no flair
This commit is contained in:
Bartłomiej Dach 2024-03-07 10:46:24 +01:00 committed by GitHub
commit 74e3c47c2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 34 additions and 21 deletions

View File

@ -88,8 +88,20 @@ namespace osu.Game.Tests.Visual.Ranking
AddAssert("play time not displayed", () => !this.ChildrenOfType<ExpandedPanelMiddleContent.PlayedOnText>().Any());
}
private void showPanel(ScoreInfo score) =>
Child = new ExpandedPanelMiddleContentContainer(score);
[Test]
public void TestFailedSDisplay([Values] bool withFlair)
{
AddStep("show failed S score", () =>
{
var score = TestResources.CreateTestScoreInfo(createTestBeatmap(new RealmUser()));
score.Rank = ScoreRank.A;
score.Accuracy = 0.975;
showPanel(score, withFlair);
});
}
private void showPanel(ScoreInfo score, bool withFlair = false) =>
Child = new ExpandedPanelMiddleContentContainer(score, withFlair);
private BeatmapInfo createTestBeatmap([NotNull] RealmUser author)
{
@ -107,7 +119,7 @@ namespace osu.Game.Tests.Visual.Ranking
private partial class ExpandedPanelMiddleContentContainer : Container
{
public ExpandedPanelMiddleContentContainer(ScoreInfo score)
public ExpandedPanelMiddleContentContainer(ScoreInfo score, bool withFlair)
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
@ -119,7 +131,7 @@ namespace osu.Game.Tests.Visual.Ranking
RelativeSizeAxes = Axes.Both,
Colour = Color4Extensions.FromHex("#444"),
},
new ExpandedPanelMiddleContent(score)
new ExpandedPanelMiddleContent(score, withFlair)
};
}
}

View File

@ -194,11 +194,11 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
rankText = new RankText(score.Rank)
};
if (withFlair)
{
if (isFailedSDueToMisses)
AddInternal(failedSRankText = new RankText(ScoreRank.S));
if (withFlair)
{
var applauseSamples = new List<string> { applauseSampleName };
if (score.Rank >= ScoreRank.B)
// when rank is B or higher, play legacy applause sample on legacy skins.
@ -326,8 +326,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
{
rankText.Appear();
if (!withFlair) return;
if (withFlair)
{
Schedule(() =>
{
isTicking = false;
@ -346,6 +346,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
});
}
}
}
if (isFailedSDueToMisses)
{