2022-12-24 17:58:38 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Online.Solo;
|
|
|
|
using osu.Game.Scoring;
|
|
|
|
using osu.Game.Screens.Ranking.Statistics.User;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Ranking.Statistics
|
|
|
|
{
|
|
|
|
public partial class SoloStatisticsPanel : StatisticsPanel
|
|
|
|
{
|
|
|
|
private readonly ScoreInfo achievedScore;
|
|
|
|
|
|
|
|
public SoloStatisticsPanel(ScoreInfo achievedScore)
|
|
|
|
{
|
|
|
|
this.achievedScore = achievedScore;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Bindable<SoloStatisticsUpdate?> StatisticsUpdate { get; } = new Bindable<SoloStatisticsUpdate?>();
|
|
|
|
|
2023-06-01 13:35:14 +08:00
|
|
|
protected override ICollection<StatisticItem> CreateStatisticItems(ScoreInfo newScore, IBeatmap playableBeatmap)
|
2022-12-24 17:58:38 +08:00
|
|
|
{
|
2023-06-01 13:35:14 +08:00
|
|
|
var items = base.CreateStatisticItems(newScore, playableBeatmap);
|
2022-12-24 17:58:38 +08:00
|
|
|
|
2022-12-24 18:27:42 +08:00
|
|
|
if (newScore.UserID > 1
|
|
|
|
&& newScore.UserID == achievedScore.UserID
|
|
|
|
&& newScore.OnlineID > 0
|
|
|
|
&& newScore.OnlineID == achievedScore.OnlineID)
|
2022-12-24 17:58:38 +08:00
|
|
|
{
|
2023-06-01 13:35:14 +08:00
|
|
|
items = items.Append(new StatisticItem("Overall Ranking", () => new OverallRanking
|
2022-12-24 17:58:38 +08:00
|
|
|
{
|
2023-06-01 13:35:14 +08:00
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
StatisticsUpdate = { BindTarget = StatisticsUpdate }
|
|
|
|
})).ToArray();
|
2022-12-24 17:58:38 +08:00
|
|
|
}
|
|
|
|
|
2023-06-01 13:35:14 +08:00
|
|
|
return items;
|
2022-12-24 17:58:38 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|