2019-01-24 16:43:03 +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.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2017-09-13 10:41:10 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
2017-09-13 11:13:45 +08:00
|
|
|
|
using osu.Framework;
|
2017-09-13 10:41:10 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2019-02-21 18:04:31 +08:00
|
|
|
|
using osu.Framework.Bindables;
|
2021-08-29 20:00:28 +08:00
|
|
|
|
using osu.Framework.Extensions.LocalisationExtensions;
|
2017-09-13 10:41:10 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
2019-03-27 18:29:27 +08:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2018-10-02 11:02:47 +08:00
|
|
|
|
using osu.Framework.Input.Events;
|
2017-09-13 10:41:10 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Beatmaps.Drawables;
|
2021-11-15 13:38:14 +08:00
|
|
|
|
using osu.Game.Extensions;
|
2017-09-13 10:41:10 +08:00
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2021-10-29 16:58:46 +08:00
|
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
2021-08-07 04:50:57 +08:00
|
|
|
|
using osu.Game.Resources.Localisation.Web;
|
2019-10-04 22:56:42 +08:00
|
|
|
|
using osu.Game.Rulesets;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-25 17:26:27 +08:00
|
|
|
|
namespace osu.Game.Overlays.BeatmapSet
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
|
|
|
|
public class BeatmapPicker : Container
|
|
|
|
|
{
|
|
|
|
|
private const float tile_icon_padding = 7;
|
|
|
|
|
private const float tile_spacing = 2;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2021-08-07 04:50:57 +08:00
|
|
|
|
private readonly OsuSpriteText version, starRating, starRatingText;
|
|
|
|
|
private readonly FillFlowContainer starRatingContainer;
|
2017-09-14 05:25:23 +08:00
|
|
|
|
private readonly Statistic plays, favourites;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-10-04 22:56:42 +08:00
|
|
|
|
public readonly DifficultiesContainer Difficulties;
|
|
|
|
|
|
2021-10-29 16:58:46 +08:00
|
|
|
|
public readonly Bindable<APIBeatmap> Beatmap = new Bindable<APIBeatmap>();
|
|
|
|
|
private APIBeatmapSet beatmapSet;
|
2019-02-28 12:31:40 +08:00
|
|
|
|
|
2021-10-29 16:58:46 +08:00
|
|
|
|
public APIBeatmapSet BeatmapSet
|
2017-09-14 05:25:23 +08:00
|
|
|
|
{
|
2019-02-28 12:58:19 +08:00
|
|
|
|
get => beatmapSet;
|
2017-09-14 05:25:23 +08:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value == beatmapSet) return;
|
2019-02-28 12:31:40 +08:00
|
|
|
|
|
2017-09-14 05:25:23 +08:00
|
|
|
|
beatmapSet = value;
|
2018-04-18 15:04:02 +08:00
|
|
|
|
updateDisplay();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-14 05:25:23 +08:00
|
|
|
|
public BeatmapPicker()
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-13 10:41:10 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2019-10-04 22:56:42 +08:00
|
|
|
|
Difficulties = new DifficultiesContainer
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
2019-08-23 22:57:31 +08:00
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
2020-02-17 04:43:33 +08:00
|
|
|
|
Margin = new MarginPadding { Left = -(tile_icon_padding + tile_spacing / 2), Bottom = 10 },
|
2017-09-13 10:41:10 +08:00
|
|
|
|
OnLostHover = () =>
|
|
|
|
|
{
|
|
|
|
|
showBeatmap(Beatmap.Value);
|
2021-08-07 04:50:57 +08:00
|
|
|
|
starRatingContainer.FadeOut(100);
|
2017-09-13 10:41:10 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Spacing = new Vector2(5f),
|
2021-08-07 04:50:57 +08:00
|
|
|
|
Children = new Drawable[]
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
|
|
|
|
version = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
2020-02-17 04:43:33 +08:00
|
|
|
|
Font = OsuFont.GetFont(size: 17, weight: FontWeight.Bold)
|
2017-09-13 10:41:10 +08:00
|
|
|
|
},
|
2021-08-07 04:50:57 +08:00
|
|
|
|
starRatingContainer = new FillFlowContainer
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
Alpha = 0,
|
2021-08-07 04:50:57 +08:00
|
|
|
|
Direction = FillDirection.Horizontal,
|
|
|
|
|
Spacing = new Vector2(2f, 0),
|
2017-09-13 10:41:10 +08:00
|
|
|
|
Margin = new MarginPadding { Bottom = 1 },
|
2021-08-07 04:50:57 +08:00
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
starRatingText = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
Font = OsuFont.GetFont(size: 11, weight: FontWeight.Bold),
|
|
|
|
|
Text = BeatmapsetsStrings.ShowStatsStars,
|
|
|
|
|
},
|
|
|
|
|
starRating = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
Font = OsuFont.GetFont(size: 11, weight: FontWeight.Bold),
|
|
|
|
|
Text = string.Empty,
|
|
|
|
|
},
|
|
|
|
|
}
|
2017-09-13 10:41:10 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Spacing = new Vector2(10f),
|
|
|
|
|
Margin = new MarginPadding { Top = 5 },
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
2019-04-02 18:55:24 +08:00
|
|
|
|
plays = new Statistic(FontAwesome.Solid.PlayCircle),
|
|
|
|
|
favourites = new Statistic(FontAwesome.Solid.Heart),
|
2017-09-13 10:41:10 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-13 11:13:45 +08:00
|
|
|
|
Beatmap.ValueChanged += b =>
|
|
|
|
|
{
|
2019-02-22 16:51:39 +08:00
|
|
|
|
showBeatmap(b.NewValue);
|
2017-09-13 11:13:45 +08:00
|
|
|
|
updateDifficultyButtons();
|
|
|
|
|
};
|
2017-09-13 10:41:10 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-10-04 22:56:42 +08:00
|
|
|
|
[Resolved]
|
|
|
|
|
private IBindable<RulesetInfo> ruleset { get; set; }
|
|
|
|
|
|
2017-09-13 10:41:10 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
starRating.Colour = colours.Yellow;
|
2021-08-07 04:50:57 +08:00
|
|
|
|
starRatingText.Colour = colours.Yellow;
|
2018-04-18 15:04:02 +08:00
|
|
|
|
updateDisplay();
|
2017-09-13 10:41:10 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-13 10:41:10 +08:00
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
ruleset.ValueChanged += _ => updateDisplay();
|
2019-10-04 22:56:42 +08:00
|
|
|
|
|
2017-09-13 10:41:10 +08:00
|
|
|
|
// done here so everything can bind in intialization and get the first trigger
|
|
|
|
|
Beatmap.TriggerChange();
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-10-31 16:13:00 +08:00
|
|
|
|
private void updateDisplay()
|
|
|
|
|
{
|
|
|
|
|
Difficulties.Clear();
|
|
|
|
|
|
|
|
|
|
if (BeatmapSet != null)
|
|
|
|
|
{
|
2021-10-29 16:58:46 +08:00
|
|
|
|
Difficulties.ChildrenEnumerable = BeatmapSet.Beatmaps
|
2021-11-15 13:38:14 +08:00
|
|
|
|
.Where(b => b.Ruleset.MatchesOnlineID(ruleset.Value))
|
2021-10-29 16:58:46 +08:00
|
|
|
|
.OrderBy(b => b.StarRating)
|
|
|
|
|
.Select(b => new DifficultySelectorButton(b)
|
|
|
|
|
{
|
|
|
|
|
State = DifficultySelectorState.NotSelected,
|
|
|
|
|
OnHovered = beatmap =>
|
|
|
|
|
{
|
|
|
|
|
showBeatmap(beatmap);
|
|
|
|
|
starRating.Text = beatmap.StarRating.ToLocalisableString(@"0.##");
|
|
|
|
|
starRatingContainer.FadeIn(100);
|
|
|
|
|
},
|
|
|
|
|
OnClicked = beatmap => { Beatmap.Value = beatmap; },
|
|
|
|
|
});
|
2019-10-31 16:13:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
2021-08-07 04:50:57 +08:00
|
|
|
|
starRatingContainer.FadeOut(100);
|
2022-02-22 16:14:00 +08:00
|
|
|
|
|
|
|
|
|
// If a selection is already made, try and maintain it.
|
|
|
|
|
if (Beatmap.Value != null)
|
|
|
|
|
Beatmap.Value = Difficulties.FirstOrDefault(b => b.Beatmap.OnlineID == Beatmap.Value.OnlineID)?.Beatmap;
|
|
|
|
|
|
|
|
|
|
// Else just choose the first available difficulty for now.
|
|
|
|
|
Beatmap.Value ??= Difficulties.FirstOrDefault()?.Beatmap;
|
|
|
|
|
|
2021-10-29 16:58:46 +08:00
|
|
|
|
plays.Value = BeatmapSet?.PlayCount ?? 0;
|
|
|
|
|
favourites.Value = BeatmapSet?.FavouriteCount ?? 0;
|
2019-10-31 16:13:00 +08:00
|
|
|
|
|
|
|
|
|
updateDifficultyButtons();
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-29 16:58:46 +08:00
|
|
|
|
private void showBeatmap(IBeatmapInfo beatmapInfo)
|
2018-04-18 15:04:02 +08:00
|
|
|
|
{
|
2021-10-29 16:58:46 +08:00
|
|
|
|
version.Text = beatmapInfo?.DifficultyName;
|
2018-04-18 15:04:02 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-13 11:13:45 +08:00
|
|
|
|
private void updateDifficultyButtons()
|
|
|
|
|
{
|
2021-10-29 16:58:46 +08:00
|
|
|
|
Difficulties.Children.ToList().ForEach(diff => diff.State = diff.Beatmap == Beatmap.Value ? DifficultySelectorState.Selected : DifficultySelectorState.NotSelected);
|
2017-09-13 11:13:45 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-10-04 22:56:42 +08:00
|
|
|
|
public class DifficultiesContainer : FillFlowContainer<DifficultySelectorButton>
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
|
|
|
|
public Action OnLostHover;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-10-02 11:02:47 +08:00
|
|
|
|
protected override void OnHoverLost(HoverLostEvent e)
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
2018-10-02 11:02:47 +08:00
|
|
|
|
base.OnHoverLost(e);
|
2017-09-13 10:41:10 +08:00
|
|
|
|
OnLostHover?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-10-04 22:56:42 +08:00
|
|
|
|
public class DifficultySelectorButton : OsuClickableContainer, IStateful<DifficultySelectorState>
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
|
|
|
|
private const float transition_duration = 100;
|
2020-02-17 04:43:33 +08:00
|
|
|
|
private const float size = 54;
|
|
|
|
|
private const float background_size = size - 2;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2020-02-17 04:43:33 +08:00
|
|
|
|
private readonly Container background;
|
|
|
|
|
private readonly Box backgroundBox;
|
2017-09-13 10:41:10 +08:00
|
|
|
|
private readonly DifficultyIcon icon;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2021-10-29 16:58:46 +08:00
|
|
|
|
public readonly APIBeatmap Beatmap;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2021-10-29 16:58:46 +08:00
|
|
|
|
public Action<APIBeatmap> OnHovered;
|
|
|
|
|
public Action<APIBeatmap> OnClicked;
|
2017-09-13 11:13:45 +08:00
|
|
|
|
public event Action<DifficultySelectorState> StateChanged;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-13 11:13:45 +08:00
|
|
|
|
private DifficultySelectorState state;
|
2019-02-28 12:31:40 +08:00
|
|
|
|
|
2017-09-13 11:13:45 +08:00
|
|
|
|
public DifficultySelectorState State
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
2019-02-28 12:58:19 +08:00
|
|
|
|
get => state;
|
2017-09-13 11:13:45 +08:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value == state) return;
|
2019-02-28 12:31:40 +08:00
|
|
|
|
|
2017-09-13 11:13:45 +08:00
|
|
|
|
state = value;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-13 11:13:45 +08:00
|
|
|
|
StateChanged?.Invoke(State);
|
|
|
|
|
if (value == DifficultySelectorState.Selected)
|
|
|
|
|
fadeIn();
|
|
|
|
|
else
|
|
|
|
|
fadeOut();
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2021-10-29 16:58:46 +08:00
|
|
|
|
public DifficultySelectorButton(APIBeatmap beatmapInfo)
|
2017-09-13 11:13:45 +08:00
|
|
|
|
{
|
2021-10-29 16:58:46 +08:00
|
|
|
|
Beatmap = beatmapInfo;
|
2017-09-13 10:41:10 +08:00
|
|
|
|
Size = new Vector2(size);
|
|
|
|
|
Margin = new MarginPadding { Horizontal = tile_spacing / 2 };
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-13 10:41:10 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2020-02-17 04:43:33 +08:00
|
|
|
|
background = new Container
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
2020-02-17 04:43:33 +08:00
|
|
|
|
Size = new Vector2(background_size),
|
2017-09-13 10:41:10 +08:00
|
|
|
|
Masking = true,
|
|
|
|
|
CornerRadius = 4,
|
2020-02-17 04:43:33 +08:00
|
|
|
|
Child = backgroundBox = new Box
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2020-02-17 04:43:33 +08:00
|
|
|
|
Alpha = 0.5f
|
|
|
|
|
}
|
2017-09-13 10:41:10 +08:00
|
|
|
|
},
|
2022-06-24 12:59:17 +08:00
|
|
|
|
icon = new DifficultyIcon(beatmapInfo)
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
2022-06-24 12:59:17 +08:00
|
|
|
|
ShowTooltip = false,
|
2022-06-23 17:37:53 +08:00
|
|
|
|
Current = { Value = new StarDifficulty(beatmapInfo.StarRating, 0) },
|
2017-09-13 10:41:10 +08:00
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(size - tile_icon_padding * 2),
|
|
|
|
|
Margin = new MarginPadding { Bottom = 1 },
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-10-02 11:02:47 +08:00
|
|
|
|
protected override bool OnHover(HoverEvent e)
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
|
|
|
|
fadeIn();
|
2021-10-29 16:58:46 +08:00
|
|
|
|
OnHovered?.Invoke(Beatmap);
|
2018-10-02 11:02:47 +08:00
|
|
|
|
return base.OnHover(e);
|
2017-09-13 10:41:10 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-10-02 11:02:47 +08:00
|
|
|
|
protected override void OnHoverLost(HoverLostEvent e)
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
2017-09-13 11:13:45 +08:00
|
|
|
|
if (State == DifficultySelectorState.NotSelected)
|
2017-09-13 10:41:10 +08:00
|
|
|
|
fadeOut();
|
2018-10-02 11:02:47 +08:00
|
|
|
|
base.OnHoverLost(e);
|
2017-09-13 10:41:10 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-10-02 11:02:47 +08:00
|
|
|
|
protected override bool OnClick(ClickEvent e)
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
2021-10-29 16:58:46 +08:00
|
|
|
|
OnClicked?.Invoke(Beatmap);
|
2018-10-02 11:02:47 +08:00
|
|
|
|
return base.OnClick(e);
|
2017-09-13 10:41:10 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-13 10:41:10 +08:00
|
|
|
|
private void fadeIn()
|
|
|
|
|
{
|
2020-02-17 04:43:33 +08:00
|
|
|
|
background.FadeIn(transition_duration);
|
2017-09-13 10:41:10 +08:00
|
|
|
|
icon.FadeIn(transition_duration);
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-13 10:41:10 +08:00
|
|
|
|
private void fadeOut()
|
|
|
|
|
{
|
2020-02-17 04:43:33 +08:00
|
|
|
|
background.FadeOut();
|
2017-09-13 10:41:10 +08:00
|
|
|
|
icon.FadeTo(0.7f, transition_duration);
|
|
|
|
|
}
|
2020-02-17 04:43:33 +08:00
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OverlayColourProvider colourProvider)
|
|
|
|
|
{
|
|
|
|
|
backgroundBox.Colour = colourProvider.Background6;
|
|
|
|
|
}
|
2017-09-13 10:41:10 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-13 10:41:10 +08:00
|
|
|
|
private class Statistic : FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
private readonly OsuSpriteText text;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-13 10:41:10 +08:00
|
|
|
|
private int value;
|
2019-02-28 12:31:40 +08:00
|
|
|
|
|
2017-09-13 10:41:10 +08:00
|
|
|
|
public int Value
|
|
|
|
|
{
|
2019-02-28 12:58:19 +08:00
|
|
|
|
get => value;
|
2017-09-13 10:41:10 +08:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
this.value = value;
|
2021-08-07 04:50:57 +08:00
|
|
|
|
text.Text = Value.ToLocalisableString(@"N0");
|
2017-09-13 10:41:10 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-03-27 18:29:27 +08:00
|
|
|
|
public Statistic(IconUsage icon)
|
2017-09-13 10:41:10 +08:00
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
Direction = FillDirection.Horizontal;
|
|
|
|
|
Spacing = new Vector2(2f);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-13 10:41:10 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new SpriteIcon
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
|
Origin = Anchor.CentreLeft,
|
|
|
|
|
Icon = icon,
|
|
|
|
|
Shadow = true,
|
2020-02-17 04:43:33 +08:00
|
|
|
|
Size = new Vector2(12),
|
2017-09-13 10:41:10 +08:00
|
|
|
|
},
|
|
|
|
|
text = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
|
Origin = Anchor.CentreLeft,
|
2020-02-17 04:43:33 +08:00
|
|
|
|
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold, italics: true),
|
2017-09-13 10:41:10 +08:00
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-10-04 22:56:42 +08:00
|
|
|
|
public enum DifficultySelectorState
|
2017-09-13 11:13:45 +08:00
|
|
|
|
{
|
|
|
|
|
Selected,
|
|
|
|
|
NotSelected,
|
|
|
|
|
}
|
2017-09-13 10:41:10 +08:00
|
|
|
|
}
|
|
|
|
|
}
|