Add user top score on selected beatmap

This commit is contained in:
Andrei Zavatski
2019-07-08 11:49:33 +03:00
parent a0efd50f62
commit 67a6abb96c
3 changed files with 41 additions and 26 deletions

View File

@ -23,10 +23,8 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
private Color4 backgroundHoveredColour;
private readonly Box background;
private readonly TopScoreUserSection userSection;
private readonly TopScoreStatisticsSection statisticsSection;
public DrawableTopScore()
public DrawableTopScore(ScoreInfo score, int position = 1)
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
@ -61,16 +59,18 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
{
new Drawable[]
{
userSection = new TopScoreUserSection
new TopScoreUserSection(position)
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Score = score,
},
null,
statisticsSection = new TopScoreStatisticsSection
new TopScoreStatisticsSection
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
Score = score,
}
},
},
@ -91,18 +91,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
background.Colour = backgroundIdleColour;
}
/// <summary>
/// Sets the score to be displayed.
/// </summary>
public ScoreInfo Score
{
set
{
userSection.Score = value;
statisticsSection.Score = value;
}
}
protected override bool OnHover(HoverEvent e)
{
background.FadeColour(backgroundHoveredColour, fade_duration, Easing.OutQuint);