mirror of
https://github.com/ppy/osu
synced 2024-12-27 17:32:56 +00:00
Show drain length in length tooltip at song select
This commit is contained in:
parent
9cfe9164fa
commit
480163ec2e
@ -352,29 +352,6 @@ namespace osu.Game.Screens.Select
|
|||||||
if (working.Beatmap?.HitObjects.Any() != true)
|
if (working.Beatmap?.HitObjects.Any() != true)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
infoLabelContainer.Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new InfoLabel(new BeatmapStatistic
|
|
||||||
{
|
|
||||||
Name = "Length",
|
|
||||||
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Length),
|
|
||||||
Content = working.BeatmapInfo.Length.ToFormattedDuration().ToString(),
|
|
||||||
}),
|
|
||||||
bpmLabelContainer = new Container
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
},
|
|
||||||
new FillFlowContainer
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Spacing = new Vector2(20, 0),
|
|
||||||
Children = getRulesetInfoLabels()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private InfoLabel[] getRulesetInfoLabels()
|
|
||||||
{
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IBeatmap playableBeatmap;
|
IBeatmap playableBeatmap;
|
||||||
@ -390,14 +367,30 @@ namespace osu.Game.Screens.Select
|
|||||||
playableBeatmap = working.GetPlayableBeatmap(working.BeatmapInfo.Ruleset, Array.Empty<Mod>());
|
playableBeatmap = working.GetPlayableBeatmap(working.BeatmapInfo.Ruleset, Array.Empty<Mod>());
|
||||||
}
|
}
|
||||||
|
|
||||||
return playableBeatmap.GetStatistics().Select(s => new InfoLabel(s)).ToArray();
|
infoLabelContainer.Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new InfoLabel(new BeatmapStatistic
|
||||||
|
{
|
||||||
|
Name = $"Length (Drain: {playableBeatmap.CalculateDrainLength().ToFormattedDuration().ToString()})",
|
||||||
|
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Length),
|
||||||
|
Content = working.BeatmapInfo.Length.ToFormattedDuration().ToString(),
|
||||||
|
}),
|
||||||
|
bpmLabelContainer = new Container
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Spacing = new Vector2(20, 0),
|
||||||
|
Children = playableBeatmap.GetStatistics().Select(s => new InfoLabel(s)).ToArray()
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.Error(e, "Could not load beatmap successfully!");
|
Logger.Error(e, "Could not load beatmap successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Array.Empty<InfoLabel>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshBPMLabel()
|
private void refreshBPMLabel()
|
||||||
|
Loading…
Reference in New Issue
Block a user