1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Tint attempt count red when no attempts remain

This commit is contained in:
Dean Herbert 2021-10-26 16:40:45 +09:00
parent 708d40931b
commit bffd9162ba

View File

@ -14,6 +14,9 @@ namespace osu.Game.Screens.OnlinePlay.Components
{
private OsuSpriteText attemptDisplay;
[Resolved]
private OsuColour colours { get; set; }
public RoomLocalUserInfo()
{
AutoSizeAxes = Axes.Both;
@ -54,6 +57,9 @@ namespace osu.Game.Screens.OnlinePlay.Components
{
int remaining = MaxAttempts.Value.Value - UserScore.Value.PlaylistItemAttempts.Sum(a => a.Attempts);
attemptDisplay.Text += $" ({remaining} remaining)";
if (remaining == 0)
attemptDisplay.Colour = colours.RedLight;
}
}
else