1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 04:02:59 +08:00

change DrawableProfileScore and DrawableProfileWeightedScore to take SoloScoreInfo and APIBeatmap instead of APIScore

This commit is contained in:
tsunyoku 2022-07-17 14:08:04 +01:00
parent 1f288157f4
commit e8d88e29c6
2 changed files with 9 additions and 7 deletions

View File

@ -31,7 +31,8 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
private const float performance_background_shear = 0.45f;
protected readonly APIScore Score;
protected readonly SoloScoreInfo Score;
protected readonly APIBeatmap Beatmap;
[Resolved]
private OsuColour colours { get; set; }
@ -39,9 +40,10 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
[Resolved]
private OverlayColourProvider colourProvider { get; set; }
public DrawableProfileScore(APIScore score)
public DrawableProfileScore(SoloScoreInfo score, APIBeatmap beatmap)
{
Score = score;
Beatmap = beatmap;
RelativeSizeAxes = Axes.X;
Height = height;
@ -84,7 +86,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
Spacing = new Vector2(0, 2),
Children = new Drawable[]
{
new ScoreBeatmapMetadataContainer(Score.Beatmap),
new ScoreBeatmapMetadataContainer(Beatmap),
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
@ -94,11 +96,11 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
{
new OsuSpriteText
{
Text = $"{Score.Beatmap?.DifficultyName}",
Text = $"{Beatmap.DifficultyName}",
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular),
Colour = colours.Yellow
},
new DrawableDate(Score.Date, 12)
new DrawableDate(Score.EndedAt ?? DateTimeOffset.Now, 12)
{
Colour = colourProvider.Foreground1
}

View File

@ -18,8 +18,8 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
{
private readonly double weight;
public DrawableProfileWeightedScore(APIScore score, double weight)
: base(score)
public DrawableProfileWeightedScore(SoloScoreInfo score, APIBeatmap beatmap, double weight)
: base(score, beatmap)
{
this.weight = weight;
}