1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 15:05:34 +08:00

Fix visualtests.

This commit is contained in:
Dean Herbert 2017-01-30 15:15:56 +09:00
parent 2ed5cf7c91
commit 1f2f2fa144

View File

@ -29,7 +29,7 @@ namespace osu.Game.Screens.Select
private Container beatmapInfoContainer; private Container beatmapInfoContainer;
private OsuGame game; private OsuGameBase game;
public BeatmapInfoWedge() public BeatmapInfoWedge()
{ {
@ -47,7 +47,7 @@ namespace osu.Game.Screens.Select
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuGame game) private void load(OsuGameBase game)
{ {
this.game = game; this.game = game;
} }
@ -64,17 +64,27 @@ namespace osu.Game.Screens.Select
BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo; BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo;
BeatmapInfo beatmapInfo = beatmap.BeatmapInfo; BeatmapInfo beatmapInfo = beatmap.BeatmapInfo;
string bpm = getBPMRange(beatmap.Beatmap); List<InfoLabel> labels = new List<InfoLabel>();
string length = TimeSpan.FromMilliseconds(beatmap.Beatmap.HitObjects.Last().EndTime - beatmap.Beatmap.HitObjects.First().StartTime).ToString(@"m\:ss");
List<InfoLabel> labels = new List<InfoLabel> if (beatmap.Beatmap != null)
{ {
new InfoLabel(new BeatmapStatistic { Name = "Length", Content = length, Icon = FontAwesome.fa_clock_o }), labels.Add(new InfoLabel(new BeatmapStatistic
new InfoLabel(new BeatmapStatistic { Name = "BPM", Content = bpm, Icon = FontAwesome.fa_circle }), {
}; Name = "Length",
Icon = FontAwesome.fa_clock_o,
Content = TimeSpan.FromMilliseconds(beatmap.Beatmap.HitObjects.Last().EndTime - beatmap.Beatmap.HitObjects.First().StartTime).ToString(@"m\:ss"),
}));
labels.Add(new InfoLabel(new BeatmapStatistic
{
Name = "BPM",
Icon = FontAwesome.fa_circle,
Content = getBPMRange(beatmap.Beatmap),
}));
//get statistics fromt he current ruleset. //get statistics fromt he current ruleset.
Ruleset.GetRuleset(beatmap.BeatmapInfo.Mode).GetBeatmapStatistics(beatmap).ForEach(s => labels.Add(new InfoLabel(s))); Ruleset.GetRuleset(beatmap.BeatmapInfo.Mode).GetBeatmapStatistics(beatmap).ForEach(s => labels.Add(new InfoLabel(s)));
}
(beatmapInfoContainer = new BufferedContainer (beatmapInfoContainer = new BufferedContainer
{ {