mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 19:22:56 +08:00
Fix code quality
This commit is contained in:
parent
8c54708582
commit
764513feea
@ -31,30 +31,31 @@ namespace osu.Game.Screens.Select.Details
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Height = height;
|
Height = height;
|
||||||
Anchor = Anchor.BottomCentre;
|
|
||||||
Origin = Anchor.BottomCentre;
|
Anchor = Anchor.BottomLeft;
|
||||||
|
Origin = Anchor.BottomLeft;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
contentContainer = new Container
|
contentContainer = new Container
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.BottomCentre,
|
Origin = Anchor.BottomLeft,
|
||||||
Height = height,
|
RelativeSizeAxes = Axes.Both,
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopLeft,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopLeft,
|
||||||
Margin = new MarginPadding { Top = 5 },
|
Margin = new MarginPadding { Top = 5 },
|
||||||
Text = @"your personal best".ToUpper(),
|
Text = @"your personal best".ToUpper(),
|
||||||
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold),
|
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold),
|
||||||
},
|
},
|
||||||
scoreContainer = new Container
|
scoreContainer = new Container
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.BottomCentre,
|
Origin = Anchor.BottomLeft,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
}
|
}
|
||||||
@ -62,22 +63,25 @@ namespace osu.Game.Screens.Select.Details
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Score.BindValueChanged(score => onScoreChanged(score.NewValue));
|
Score.BindValueChanged(onScoreChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onScoreChanged(APILegacyUserTopScoreInfo score)
|
private void onScoreChanged(ValueChangedEvent<APILegacyUserTopScoreInfo> score)
|
||||||
{
|
{
|
||||||
if (score != null)
|
var newScore = score.NewValue;
|
||||||
|
|
||||||
|
if (newScore == null)
|
||||||
{
|
{
|
||||||
scoreContainer.Clear();
|
|
||||||
scoreContainer.Add(new LeaderboardScore(score.Score, score.Position)
|
|
||||||
{
|
|
||||||
Action = () => ScoreSelected?.Invoke(score.Score)
|
|
||||||
});
|
|
||||||
Show();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Hide();
|
Hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scoreContainer.Child = new LeaderboardScore(newScore.Score, newScore.Position)
|
||||||
|
{
|
||||||
|
Action = () => ScoreSelected?.Invoke(newScore.Score)
|
||||||
|
};
|
||||||
|
|
||||||
|
Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PopIn()
|
protected override void PopIn()
|
||||||
|
@ -215,8 +215,10 @@ namespace osu.Game.Screens.Select
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
BeatmapDetails.Leaderboard.ScoreSelected += s => this.Push(new SoloResults(s));
|
void displayScore(ScoreInfo score) => this.Push(new SoloResults(score));
|
||||||
BeatmapDetails.TopScore.ScoreSelected += s => this.Push(new SoloResults(s));
|
|
||||||
|
BeatmapDetails.Leaderboard.ScoreSelected += displayScore;
|
||||||
|
BeatmapDetails.TopScore.ScoreSelected += displayScore;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
|
Loading…
Reference in New Issue
Block a user