mirror of
https://github.com/ppy/osu.git
synced 2026-05-17 02:22:35 +08:00
Use truncation to 2dp of star rating in ranked play card to be consistent with everything else (#37756)
Closes https://github.com/ppy/osu/issues/37755.
This commit is contained in:
committed by
GitHub
Unverified
parent
a22c2eaadf
commit
c8bfb34117
@@ -108,7 +108,9 @@ namespace osu.Game.Tests.Visual.RankedPlay
|
||||
Retries = Enumerable.Range(-2, 100).Select(x => x % 12 - 6).ToArray(),
|
||||
};
|
||||
|
||||
beatmap.StarRating = i + 1;
|
||||
// the .009 part exercises behaviour of truncating star rating to 2dp
|
||||
// it should be discarded completely on display
|
||||
beatmap.StarRating = i + 1.009;
|
||||
|
||||
flow.Add(new RankedPlayCardContent(beatmap)
|
||||
{
|
||||
|
||||
+2
-2
@@ -1,7 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@@ -12,6 +11,7 @@ using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Utils;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Card
|
||||
@@ -107,7 +107,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Card
|
||||
},
|
||||
new TruncatingSpriteText
|
||||
{
|
||||
Text = FormattableString.Invariant($"{beatmap.StarRating:F2}"),
|
||||
Text = beatmap.StarRating.FormatStarRating(),
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreRight,
|
||||
Font = OsuFont.GetFont(size: 9, weight: FontWeight.Bold),
|
||||
|
||||
Reference in New Issue
Block a user