mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Add user top score on selected beatmap
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user