mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Make UserHistoryGraph non-abstract
This commit is contained in:
@ -8,15 +8,22 @@ using static osu.Game.Users.User;
|
||||
|
||||
namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||
{
|
||||
public abstract class UserHistoryGraph : UserGraph<DateTime, long>
|
||||
public class UserHistoryGraph : UserGraph<DateTime, long>
|
||||
{
|
||||
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";
|
||||
|
||||
protected override float GetDataPointHeight(long playCount) => playCount;
|
||||
|
||||
protected override UserGraphTooltip GetTooltip() => new HistoryGraphTooltip(TooltipCounterName);
|
||||
|
||||
protected override object GetTooltipContent(DateTime date, long playCount)
|
||||
{
|
||||
return new TooltipDisplayContent
|
||||
@ -26,8 +33,13 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||
};
|
||||
}
|
||||
|
||||
protected abstract class HistoryGraphTooltip : UserGraphTooltip
|
||||
protected class HistoryGraphTooltip : UserGraphTooltip
|
||||
{
|
||||
public HistoryGraphTooltip(string tooltipCounterName)
|
||||
: base(tooltipCounterName)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool SetContent(object content)
|
||||
{
|
||||
if (!(content is TooltipDisplayContent info))
|
||||
|
Reference in New Issue
Block a user