1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Separate unprocessed PP placeholder to own class

This commit is contained in:
Salman Ahmed 2022-07-25 09:07:51 +03:00
parent fa1bc0fe0e
commit 91d1c9686c
2 changed files with 29 additions and 15 deletions

View File

@ -23,8 +23,8 @@ using osuTK.Graphics;
using osu.Framework.Localisation;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Scoring.Drawables;
namespace osu.Game.Overlays.BeatmapSet.Scores
{
@ -182,7 +182,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
if (score.PP != null)
content.Add(new StatisticText(score.PP, format: @"N0"));
else
content.Add(new ProcessingPPIcon());
content.Add(new UnprocessedPerformancePointsPlaceholder { Size = new Vector2(text_size) });
}
content.Add(new ScoreboardTime(score.Date, text_size)
@ -247,18 +247,5 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
Colour = colours.GreenLight;
}
}
private class ProcessingPPIcon : SpriteIcon, IHasTooltip
{
public LocalisableString TooltipText => ScoresStrings.StatusProcessing;
public ProcessingPPIcon()
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Size = new Vector2(text_size);
Icon = FontAwesome.Solid.ExclamationTriangle;
}
}
}
}

View File

@ -0,0 +1,27 @@
// 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.
#nullable disable
using osu.Framework.Graphics;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Scoring.Drawables
{
/// <summary>
/// A placeholder used in PP columns for scores with unprocessed PP value.
/// </summary>
public class UnprocessedPerformancePointsPlaceholder : SpriteIcon, IHasTooltip
{
public LocalisableString TooltipText => ScoresStrings.StatusProcessing;
public UnprocessedPerformancePointsPlaceholder()
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Icon = FontAwesome.Solid.ExclamationTriangle;
}
}
}