Display "replays watched" tooltip for replays subsection

This commit is contained in:
Salman Ahmed
2021-04-12 21:51:04 +03:00
parent 84e1ff79a0
commit 8f84abf348
6 changed files with 20 additions and 10 deletions

View File

@ -11,20 +11,22 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
{
public class UserHistoryGraph : UserGraph<DateTime, long>
{
private readonly string tooltipCounterName;
[CanBeNull]
public UserHistoryCount[] Values
{
set => Data = value?.Select(v => new KeyValuePair<DateTime, long>(v.Date, v.Count)).ToArray();
}
/// <summary>
/// Text describing the value being plotted on the graph, which will be displayed as a prefix to the value in the <see cref="HistoryGraphTooltip"/>.
/// </summary>
public string TooltipCounterName { get; set; } = "Plays";
public UserHistoryGraph(string tooltipCounterName)
{
this.tooltipCounterName = tooltipCounterName;
}
protected override float GetDataPointHeight(long playCount) => playCount;
protected override UserGraphTooltip GetTooltip() => new HistoryGraphTooltip(TooltipCounterName);
protected override UserGraphTooltip GetTooltip() => new HistoryGraphTooltip(tooltipCounterName);
protected override object GetTooltipContent(DateTime date, long playCount)
{