mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Update all beatmap overlay views to use APIBeatmap
/APIBeatmapSet
This commit is contained in:
@ -14,6 +14,7 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Extensions;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Resources.Localisation.Web;
|
||||
using osuTK;
|
||||
|
||||
@ -23,9 +24,9 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
{
|
||||
private readonly Statistic length, bpm, circleCount, sliderCount;
|
||||
|
||||
private BeatmapSetInfo beatmapSet;
|
||||
private APIBeatmapSet beatmapSet;
|
||||
|
||||
public BeatmapSetInfo BeatmapSet
|
||||
public APIBeatmapSet BeatmapSet
|
||||
{
|
||||
get => beatmapSet;
|
||||
set
|
||||
@ -38,9 +39,9 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
}
|
||||
}
|
||||
|
||||
private BeatmapInfo beatmapInfo;
|
||||
private IBeatmapInfo beatmapInfo;
|
||||
|
||||
public BeatmapInfo BeatmapInfo
|
||||
public IBeatmapInfo BeatmapInfo
|
||||
{
|
||||
get => beatmapInfo;
|
||||
set
|
||||
@ -55,7 +56,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
|
||||
private void updateDisplay()
|
||||
{
|
||||
bpm.Value = BeatmapSet?.OnlineInfo?.BPM.ToLocalisableString(@"0.##") ?? (LocalisableString)"-";
|
||||
bpm.Value = BeatmapSet?.BPM.ToLocalisableString(@"0.##") ?? (LocalisableString)"-";
|
||||
|
||||
if (beatmapInfo == null)
|
||||
{
|
||||
@ -68,8 +69,10 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
length.TooltipText = BeatmapsetsStrings.ShowStatsTotalLength(TimeSpan.FromMilliseconds(beatmapInfo.Length).ToFormattedDuration());
|
||||
length.Value = TimeSpan.FromMilliseconds(beatmapInfo.Length).ToFormattedDuration();
|
||||
|
||||
circleCount.Value = beatmapInfo.OnlineInfo.CircleCount.ToLocalisableString(@"N0");
|
||||
sliderCount.Value = beatmapInfo.OnlineInfo.SliderCount.ToLocalisableString(@"N0");
|
||||
var onlineInfo = beatmapInfo as IBeatmapOnlineInfo;
|
||||
|
||||
circleCount.Value = (onlineInfo?.CircleCount ?? 0).ToLocalisableString(@"N0");
|
||||
sliderCount.Value = (onlineInfo?.SliderCount ?? 0).ToLocalisableString(@"N0");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user