1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-27 17:40:10 +08:00
Files
osu-lazer/osu.Game.Tests/Visual/RankedPlay/TestSceneStarRatingSequence.cs
T
Bartłomiej Dach c148e2056e Fix illegible star rating text colour in ranked play intro animation (#37429)
Closes https://github.com/ppy/osu/issues/37406.

I almost applied

```diff
diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Intro/StarRatingSequence.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Intro/StarRatingSequence.cs
index 318572d28f..76719a7de8 100644
--- a/osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Intro/StarRatingSequence.cs
+++ b/osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Intro/StarRatingSequence.cs
@@ -5,8 +5,10 @@
 using osu.Framework.Allocation;
 using osu.Framework.Audio;
 using osu.Framework.Audio.Sample;
+using osu.Framework.Extensions.Color4Extensions;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Effects;
 using osu.Framework.Graphics.Shapes;
 using osu.Framework.Graphics.Sprites;
 using osu.Framework.Graphics.Transforms;
@@ -134,6 +136,14 @@ private void load(OsuColour colour, AudioManager audio)
                     Anchor = Anchor.BottomLeft,
                     Origin = Anchor.BottomLeft,
                     Colour = colour.ForStarDifficulty(Math.Max(difficulty, 0.1)),
+                    EdgeEffect = difficulty < OsuColour.STAR_DIFFICULTY_DEFINED_COLOUR_CUTOFF
+                        ? default
+                        : new EdgeEffectParameters
+                        {
+                            Type = EdgeEffectType.Glow,
+                            Colour = colour.ForStarDifficultyText(difficulty).Opacity((difficulty - OsuColour.STAR_DIFFICULTY_DEFINED_COLOUR_CUTOFF) / (10 - OsuColour.STAR_DIFFICULTY_DEFINED_COLOUR_CUTOFF) / 2),
+                            Radius = 4
+                        },
                     Height = 0
                 });

```

as a bonus but I'm not that confident in myself.

---------

Co-authored-by: Dean Herbert <pe@ppy.sh>
2026-04-20 23:50:25 +09:00

34 lines
1001 B
C#

// 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 NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Intro;
namespace osu.Game.Tests.Visual.RankedPlay
{
[TestFixture]
public partial class TestSceneStarRatingSequence : RankedPlayTestScene
{
[Test]
public void TestBasicAppearance()
{
float starRating = 5;
AddSliderStep("set star rating", 0f, 10, 5, sr => starRating = sr);
AddStep("play sequence", () =>
{
StarRatingSequence sequence;
Child = sequence = new StarRatingSequence
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre
};
double delay = 0;
sequence.Play(ref delay, starRating);
});
}
}
}