mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 15:05:34 +08:00
Tidy up LeaderboardScore
This commit is contained in:
parent
1699daaf7f
commit
7387dbd9fc
@ -21,6 +21,10 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
public class LeaderboardScore : Container, IStateful<Visibility>
|
public class LeaderboardScore : Container, IStateful<Visibility>
|
||||||
{
|
{
|
||||||
public static readonly float HEIGHT = 60;
|
public static readonly float HEIGHT = 60;
|
||||||
|
|
||||||
|
public readonly int RankPosition;
|
||||||
|
public readonly Score Score;
|
||||||
|
|
||||||
private const float corner_radius = 5;
|
private const float corner_radius = 5;
|
||||||
private const float edge_margin = 5;
|
private const float edge_margin = 5;
|
||||||
private const float background_alpha = 0.25f;
|
private const float background_alpha = 0.25f;
|
||||||
@ -35,9 +39,6 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
private Container flagBadgeContainer;
|
private Container flagBadgeContainer;
|
||||||
private FillFlowContainer<ScoreModIcon> modsContainer;
|
private FillFlowContainer<ScoreModIcon> modsContainer;
|
||||||
|
|
||||||
public readonly int Rank;
|
|
||||||
public readonly Score Score;
|
|
||||||
|
|
||||||
private Visibility state;
|
private Visibility state;
|
||||||
public Visibility State
|
public Visibility State
|
||||||
{
|
{
|
||||||
@ -49,10 +50,8 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case Visibility.Hidden:
|
case Visibility.Hidden:
|
||||||
foreach (Drawable d in new Drawable[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer, })
|
foreach (var d in new Drawable[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer })
|
||||||
{
|
|
||||||
d.FadeOut();
|
d.FadeOut();
|
||||||
}
|
|
||||||
|
|
||||||
Alpha = 0;
|
Alpha = 0;
|
||||||
|
|
||||||
@ -60,7 +59,6 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
avatar.MoveToX(75);
|
avatar.MoveToX(75);
|
||||||
nameLabel.MoveToX(150);
|
nameLabel.MoveToX(150);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Visibility.Visible:
|
case Visibility.Visible:
|
||||||
FadeIn(200);
|
FadeIn(200);
|
||||||
content.MoveToY(0, 800, EasingTypes.OutQuint);
|
content.MoveToY(0, 800, EasingTypes.OutQuint);
|
||||||
@ -92,7 +90,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
public LeaderboardScore(Score score, int rank)
|
public LeaderboardScore(Score score, int rank)
|
||||||
{
|
{
|
||||||
Score = score;
|
Score = score;
|
||||||
Rank = rank;
|
RankPosition = rank;
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Height = HEIGHT;
|
Height = HEIGHT;
|
||||||
@ -111,7 +109,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Font = @"Exo2.0-MediumItalic",
|
Font = @"Exo2.0-MediumItalic",
|
||||||
TextSize = 22,
|
TextSize = 22,
|
||||||
Text = Rank.ToString(),
|
Text = RankPosition.ToString(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user