2019-01-24 08:43:03 +00: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.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-12-14 10:51:27 +00:00
|
|
|
|
using System.Collections.Generic;
|
2018-11-28 07:33:42 +00:00
|
|
|
|
using System.Linq;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2018-06-04 01:26:30 +00:00
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
2019-04-02 05:51:28 +00:00
|
|
|
|
using osu.Framework.Graphics.Effects;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
2019-02-12 04:04:46 +00:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2019-12-15 10:18:12 +00:00
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
2018-10-02 03:02:47 +00:00
|
|
|
|
using osu.Framework.Input.Events;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2019-12-15 10:18:12 +00:00
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2019-12-17 03:25:28 +00:00
|
|
|
|
using osu.Game.Overlays;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Game.Rulesets.UI;
|
2019-12-17 03:25:28 +00:00
|
|
|
|
using osu.Game.Screens.Select;
|
2018-11-28 07:12:57 +00:00
|
|
|
|
using osu.Game.Scoring;
|
2019-06-17 17:57:57 +00:00
|
|
|
|
using osu.Game.Users.Drawables;
|
2018-12-14 10:51:27 +00:00
|
|
|
|
using osuTK;
|
|
|
|
|
using osuTK.Graphics;
|
2019-07-14 09:47:35 +00:00
|
|
|
|
using Humanizer;
|
2019-11-01 15:46:13 +00:00
|
|
|
|
using osu.Game.Online.API;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-12-14 10:51:27 +00:00
|
|
|
|
namespace osu.Game.Online.Leaderboards
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2019-12-17 03:25:28 +00:00
|
|
|
|
public class LeaderboardScore : OsuClickableContainer, IHasContextMenu
|
2018-12-14 10:51:27 +00:00
|
|
|
|
{
|
2018-12-22 06:20:35 +00:00
|
|
|
|
public const float HEIGHT = 60;
|
|
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
|
private const float corner_radius = 5;
|
|
|
|
|
private const float edge_margin = 5;
|
|
|
|
|
private const float background_alpha = 0.25f;
|
2019-07-14 09:47:35 +00:00
|
|
|
|
private const float rank_width = 35;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-12-14 10:51:27 +00:00
|
|
|
|
protected Container RankContainer { get; private set; }
|
|
|
|
|
|
2018-12-22 06:20:35 +00:00
|
|
|
|
private readonly ScoreInfo score;
|
2020-02-20 05:51:25 +00:00
|
|
|
|
private readonly int? rank;
|
2019-11-03 23:39:51 +00:00
|
|
|
|
private readonly bool allowHighlight;
|
2018-12-14 10:51:27 +00:00
|
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
|
private Box background;
|
|
|
|
|
private Container content;
|
|
|
|
|
private Drawable avatar;
|
2018-12-14 10:51:27 +00:00
|
|
|
|
private Drawable scoreRank;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
private OsuSpriteText nameLabel;
|
|
|
|
|
private GlowingSpriteText scoreLabel;
|
|
|
|
|
private Container flagBadgeContainer;
|
|
|
|
|
private FillFlowContainer<ModIcon> modsContainer;
|
|
|
|
|
|
2018-12-14 10:51:27 +00:00
|
|
|
|
private List<ScoreComponentLabel> statisticsLabels;
|
2019-12-17 20:56:30 +00:00
|
|
|
|
|
2020-02-13 10:04:23 +00:00
|
|
|
|
[Resolved(CanBeNull = true)]
|
2020-01-03 19:34:26 +00:00
|
|
|
|
private DialogOverlay dialogOverlay { get; set; }
|
2018-12-14 10:51:27 +00:00
|
|
|
|
|
2020-02-20 05:51:25 +00:00
|
|
|
|
public LeaderboardScore(ScoreInfo score, int? rank, bool allowHighlight = true)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2018-12-14 10:51:27 +00:00
|
|
|
|
this.score = score;
|
2019-07-14 09:47:35 +00:00
|
|
|
|
this.rank = rank;
|
2019-11-03 23:39:51 +00:00
|
|
|
|
this.allowHighlight = allowHighlight;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
2018-12-22 06:20:35 +00:00
|
|
|
|
Height = HEIGHT;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2020-01-03 19:34:26 +00:00
|
|
|
|
private void load(IAPIProvider api, OsuColour colour)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2018-12-22 06:20:35 +00:00
|
|
|
|
var user = score.User;
|
2018-12-14 10:51:27 +00:00
|
|
|
|
|
2018-12-22 06:20:35 +00:00
|
|
|
|
statisticsLabels = GetStatistics(score).Select(s => new ScoreComponentLabel(s)).ToList();
|
2018-12-14 10:51:27 +00:00
|
|
|
|
|
2019-06-17 18:55:07 +00:00
|
|
|
|
DrawableAvatar innerAvatar;
|
2019-03-17 04:43:23 +00:00
|
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
|
Width = rank_width,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
2018-12-27 06:30:02 +00:00
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
2019-07-14 09:47:35 +00:00
|
|
|
|
Font = OsuFont.GetFont(size: 20, italics: true),
|
2020-02-20 05:51:25 +00:00
|
|
|
|
Text = rank == null ? "-" : rank.Value.ToMetric(decimals: rank < 100000 ? 1 : 0),
|
2018-04-13 09:19:50 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
content = new Container
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Padding = new MarginPadding { Left = rank_width, },
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
CornerRadius = corner_radius,
|
|
|
|
|
Masking = true,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
background = new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2019-11-03 23:39:51 +00:00
|
|
|
|
Colour = user.Id == api.LocalUser.Value.Id && allowHighlight ? colour.Green : Color4.Black,
|
2018-04-13 09:19:50 +00:00
|
|
|
|
Alpha = background_alpha,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Padding = new MarginPadding(edge_margin),
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
avatar = new DelayedLoadWrapper(
|
2019-06-17 18:55:07 +00:00
|
|
|
|
innerAvatar = new DrawableAvatar(user)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
CornerRadius = corner_radius,
|
|
|
|
|
Masking = true,
|
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
|
Radius = 1,
|
|
|
|
|
Colour = Color4.Black.Opacity(0.2f),
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.None,
|
2018-12-22 06:20:35 +00:00
|
|
|
|
Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2),
|
2018-04-13 09:19:50 +00:00
|
|
|
|
},
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
|
AutoSizeAxes = Axes.X,
|
2018-12-22 06:20:35 +00:00
|
|
|
|
Position = new Vector2(HEIGHT - edge_margin, 0f),
|
2018-04-13 09:19:50 +00:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
nameLabel = new OsuSpriteText
|
|
|
|
|
{
|
2018-12-14 10:51:27 +00:00
|
|
|
|
Text = user.Username,
|
2019-02-12 04:04:46 +00:00
|
|
|
|
Font = OsuFont.GetFont(size: 23, weight: FontWeight.Bold, italics: true)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
},
|
|
|
|
|
new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Direction = FillDirection.Horizontal,
|
|
|
|
|
Spacing = new Vector2(10f, 0f),
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
flagBadgeContainer = new Container
|
|
|
|
|
{
|
2018-06-04 01:22:44 +00:00
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
2018-04-13 09:19:50 +00:00
|
|
|
|
Size = new Vector2(87f, 20f),
|
|
|
|
|
Masking = true,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2019-06-17 17:57:57 +00:00
|
|
|
|
new UpdateableFlag(user.Country)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
|
|
|
|
Width = 30,
|
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
new FillFlowContainer
|
|
|
|
|
{
|
2018-06-04 01:22:44 +00:00
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
2018-04-13 09:19:50 +00:00
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Direction = FillDirection.Horizontal,
|
|
|
|
|
Spacing = new Vector2(10f, 0f),
|
2018-06-04 01:22:44 +00:00
|
|
|
|
Margin = new MarginPadding { Left = edge_margin },
|
2018-12-14 10:51:27 +00:00
|
|
|
|
Children = statisticsLabels
|
2018-04-13 09:19:50 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Anchor = Anchor.TopRight,
|
|
|
|
|
Origin = Anchor.TopRight,
|
|
|
|
|
Direction = FillDirection.Horizontal,
|
|
|
|
|
Spacing = new Vector2(5f, 0f),
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2019-07-21 09:14:55 +00:00
|
|
|
|
scoreLabel = new GlowingSpriteText
|
|
|
|
|
{
|
|
|
|
|
TextColour = Color4.White,
|
2020-03-11 01:18:41 +00:00
|
|
|
|
GlowColour = Color4Extensions.FromHex(@"83ccfa"),
|
2019-07-21 09:14:55 +00:00
|
|
|
|
Text = score.TotalScore.ToString(@"N0"),
|
|
|
|
|
Font = OsuFont.Numeric.With(size: 23),
|
|
|
|
|
},
|
2018-12-14 10:51:27 +00:00
|
|
|
|
RankContainer = new Container
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
|
|
|
|
Size = new Vector2(40f, 20f),
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
2019-06-17 17:04:09 +00:00
|
|
|
|
scoreRank = new UpdateableRank(score.Rank)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
2018-12-14 10:51:27 +00:00
|
|
|
|
Size = new Vector2(40f)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
modsContainer = new FillFlowContainer<ModIcon>
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomRight,
|
|
|
|
|
Origin = Anchor.BottomRight,
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Direction = FillDirection.Horizontal,
|
2019-09-11 23:08:01 +00:00
|
|
|
|
Spacing = new Vector2(1),
|
2018-12-22 06:20:35 +00:00
|
|
|
|
ChildrenEnumerable = score.Mods.Select(mod => new ModIcon(mod) { Scale = new Vector2(0.375f) })
|
2018-04-13 09:19:50 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
2019-03-17 04:43:23 +00:00
|
|
|
|
|
|
|
|
|
innerAvatar.OnLoadComplete += d => d.FadeInFromZero(200);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Show()
|
|
|
|
|
{
|
2018-12-14 10:51:27 +00:00
|
|
|
|
foreach (var d in new[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, modsContainer }.Concat(statisticsLabels))
|
2018-04-13 09:19:50 +00:00
|
|
|
|
d.FadeOut();
|
|
|
|
|
|
|
|
|
|
Alpha = 0;
|
|
|
|
|
|
|
|
|
|
content.MoveToY(75);
|
|
|
|
|
avatar.MoveToX(75);
|
|
|
|
|
nameLabel.MoveToX(150);
|
|
|
|
|
|
|
|
|
|
this.FadeIn(200);
|
|
|
|
|
content.MoveToY(0, 800, Easing.OutQuint);
|
|
|
|
|
|
|
|
|
|
using (BeginDelayedSequence(100, true))
|
|
|
|
|
{
|
|
|
|
|
avatar.FadeIn(300, Easing.OutQuint);
|
|
|
|
|
nameLabel.FadeIn(350, Easing.OutQuint);
|
|
|
|
|
|
|
|
|
|
avatar.MoveToX(0, 300, Easing.OutQuint);
|
|
|
|
|
nameLabel.MoveToX(0, 350, Easing.OutQuint);
|
|
|
|
|
|
|
|
|
|
using (BeginDelayedSequence(250, true))
|
|
|
|
|
{
|
|
|
|
|
scoreLabel.FadeIn(200);
|
|
|
|
|
scoreRank.FadeIn(200);
|
|
|
|
|
|
|
|
|
|
using (BeginDelayedSequence(50, true))
|
|
|
|
|
{
|
2018-12-14 10:51:27 +00:00
|
|
|
|
var drawables = new Drawable[] { flagBadgeContainer, modsContainer }.Concat(statisticsLabels).ToArray();
|
2018-04-13 09:19:50 +00:00
|
|
|
|
for (int i = 0; i < drawables.Length; i++)
|
|
|
|
|
drawables[i].FadeIn(100 + i * 50);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-22 06:23:32 +00:00
|
|
|
|
protected virtual IEnumerable<LeaderboardScoreStatistic> GetStatistics(ScoreInfo model) => new[]
|
|
|
|
|
{
|
2019-04-02 10:55:24 +00:00
|
|
|
|
new LeaderboardScoreStatistic(FontAwesome.Solid.Link, "Max Combo", model.MaxCombo.ToString()),
|
2020-02-03 15:11:36 +00:00
|
|
|
|
new LeaderboardScoreStatistic(FontAwesome.Solid.Crosshairs, "Accuracy", model.DisplayAccuracy)
|
2018-12-22 06:23:32 +00:00
|
|
|
|
};
|
|
|
|
|
|
2018-10-02 03:02:47 +00:00
|
|
|
|
protected override bool OnHover(HoverEvent e)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
|
|
|
|
background.FadeTo(0.5f, 300, Easing.OutQuint);
|
2018-10-02 03:02:47 +00:00
|
|
|
|
return base.OnHover(e);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-10-02 03:02:47 +00:00
|
|
|
|
protected override void OnHoverLost(HoverLostEvent e)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
|
|
|
|
background.FadeTo(background_alpha, 200, Easing.OutQuint);
|
2018-10-02 03:02:47 +00:00
|
|
|
|
base.OnHoverLost(e);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-06-04 01:26:30 +00:00
|
|
|
|
private class ScoreComponentLabel : Container, IHasTooltip
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2018-06-04 01:22:44 +00:00
|
|
|
|
private const float icon_size = 20;
|
|
|
|
|
private readonly FillFlowContainer content;
|
|
|
|
|
|
2018-06-04 01:26:30 +00:00
|
|
|
|
public override bool Contains(Vector2 screenSpacePos) => content.Contains(screenSpacePos);
|
2018-06-04 01:22:44 +00:00
|
|
|
|
|
2019-11-12 09:45:42 +00:00
|
|
|
|
public string TooltipText { get; }
|
2018-06-04 01:26:30 +00:00
|
|
|
|
|
2018-12-22 06:20:35 +00:00
|
|
|
|
public ScoreComponentLabel(LeaderboardScoreStatistic statistic)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2019-11-12 09:45:42 +00:00
|
|
|
|
TooltipText = statistic.Name;
|
2018-12-14 10:51:27 +00:00
|
|
|
|
AutoSizeAxes = Axes.Both;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-06-04 01:26:30 +00:00
|
|
|
|
Child = content = new FillFlowContainer
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2018-06-04 01:22:44 +00:00
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Direction = FillDirection.Horizontal,
|
|
|
|
|
Children = new Drawable[]
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2018-06-04 01:22:44 +00:00
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
|
Origin = Anchor.CentreLeft,
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
new SpriteIcon
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(icon_size),
|
|
|
|
|
Rotation = 45,
|
2020-03-11 01:18:41 +00:00
|
|
|
|
Colour = Color4Extensions.FromHex(@"3087ac"),
|
2019-04-02 10:55:24 +00:00
|
|
|
|
Icon = FontAwesome.Solid.Square,
|
2018-06-04 01:22:44 +00:00
|
|
|
|
Shadow = true,
|
|
|
|
|
},
|
|
|
|
|
new SpriteIcon
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(icon_size - 6),
|
2020-03-11 01:18:41 +00:00
|
|
|
|
Colour = Color4Extensions.FromHex(@"a4edff"),
|
2018-12-22 06:20:35 +00:00
|
|
|
|
Icon = statistic.Icon,
|
2018-06-04 01:22:44 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2019-07-21 09:14:55 +00:00
|
|
|
|
new GlowingSpriteText
|
2018-06-04 01:22:44 +00:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
|
Origin = Anchor.CentreLeft,
|
2019-07-21 09:14:55 +00:00
|
|
|
|
TextColour = Color4.White,
|
2020-03-11 01:18:41 +00:00
|
|
|
|
GlowColour = Color4Extensions.FromHex(@"83ccfa"),
|
2019-07-21 09:14:55 +00:00
|
|
|
|
Text = statistic.Value,
|
|
|
|
|
Font = OsuFont.GetFont(size: 17, weight: FontWeight.Bold),
|
2018-06-04 01:22:44 +00:00
|
|
|
|
},
|
2018-04-13 09:19:50 +00:00
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-22 06:20:35 +00:00
|
|
|
|
|
|
|
|
|
public class LeaderboardScoreStatistic
|
|
|
|
|
{
|
2019-03-27 10:29:27 +00:00
|
|
|
|
public IconUsage Icon;
|
2018-12-22 06:20:35 +00:00
|
|
|
|
public string Value;
|
|
|
|
|
public string Name;
|
|
|
|
|
|
2019-03-27 10:29:27 +00:00
|
|
|
|
public LeaderboardScoreStatistic(IconUsage icon, string name, string value)
|
2018-12-22 06:20:35 +00:00
|
|
|
|
{
|
|
|
|
|
Icon = icon;
|
|
|
|
|
Name = name;
|
|
|
|
|
Value = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-12-17 03:25:28 +00:00
|
|
|
|
|
2019-12-17 20:56:30 +00:00
|
|
|
|
public MenuItem[] ContextMenuItems
|
2019-12-17 03:25:28 +00:00
|
|
|
|
{
|
2019-12-19 06:41:07 +00:00
|
|
|
|
get
|
2019-12-17 20:56:30 +00:00
|
|
|
|
{
|
2019-12-19 06:41:07 +00:00
|
|
|
|
List<MenuItem> items = new List<MenuItem>();
|
|
|
|
|
|
|
|
|
|
if (score.ID != 0)
|
2020-01-06 08:20:09 +00:00
|
|
|
|
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(score))));
|
2019-12-19 06:41:07 +00:00
|
|
|
|
|
|
|
|
|
return items.ToArray();
|
|
|
|
|
}
|
2019-12-17 20:56:30 +00:00
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|