1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 08:22:56 +08:00

style fixes

This commit is contained in:
n4b3l 2016-12-18 16:53:52 +01:00
parent 492581fa50
commit 5f893d46c7

View File

@ -61,10 +61,10 @@ namespace osu.Game.Screens.Select
BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo;
BeatmapInfo beatmapInfo = beatmap.BeatmapInfo;
string bpm = GetBPMRange(beatmap);
string length = "" + TimeSpan.FromMilliseconds((beatmap.Beatmap.HitObjects.Last().EndTime - beatmap.Beatmap.HitObjects.First().StartTime)).ToString(@"m\:ss");
string hitCircles = "" + beatmap.Beatmap.HitObjects.Count(b => b.GetType().ToString().Equals("osu.Game.Modes.Osu.Objects.HitCircle"));
string sliders = "" + beatmap.Beatmap.HitObjects.Count(b => b.GetType().ToString().Equals("osu.Game.Modes.Osu.Objects.Slider"));
string bpm = getBPMRange(beatmap);
string length = TimeSpan.FromMilliseconds((beatmap.Beatmap.HitObjects.Last().EndTime - beatmap.Beatmap.HitObjects.First().StartTime)).ToString(@"m\:ss");
string hitCircles = "" + beatmap.Beatmap.HitObjects.Count(h => h.GetType().ToString().Equals("osu.Game.Modes.Osu.Objects.HitCircle"));
string sliders = "" + beatmap.Beatmap.HitObjects.Count(h => h.GetType().ToString().Equals("osu.Game.Modes.Osu.Objects.Slider"));
(beatmapInfoContainer = new BufferedContainer
{
@ -153,10 +153,10 @@ namespace osu.Game.Screens.Select
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
InfoLabel(FontAwesome.fa_clock_o, length),
InfoLabel(FontAwesome.fa_circle, bpm),
InfoLabel(FontAwesome.fa_dot_circle_o, hitCircles),
InfoLabel(FontAwesome.fa_circle_o, sliders),
infoLabel(FontAwesome.fa_clock_o, length),
infoLabel(FontAwesome.fa_circle, bpm),
infoLabel(FontAwesome.fa_dot_circle_o, hitCircles),
infoLabel(FontAwesome.fa_circle_o, sliders),
}
},
}
@ -173,11 +173,11 @@ namespace osu.Game.Screens.Select
});
}
private string GetBPMRange(WorkingBeatmap beatmap)
private string getBPMRange(WorkingBeatmap beatmap)
{
double bpmMax = double.MinValue;
double bpmMin = double.MaxValue;
double bpmMost = beatmap.Beatmap.BPMAt(beatmap.Beatmap.ControlPoints.GroupBy(b => b.BeatLength).OrderByDescending(grp => grp.Count()).First().First().Time);
double bpmMost = beatmap.Beatmap.BPMAt(beatmap.Beatmap.ControlPoints.Where(c => c.BeatLength != 0).GroupBy(c => c.BeatLength).OrderByDescending(grp => grp.Count()).First().First().Time);
foreach (ControlPoint a in beatmap.Beatmap.ControlPoints)
{
if (a.BeatLength == 0) continue;
@ -189,9 +189,9 @@ namespace osu.Game.Screens.Select
return Math.Round(bpmMin) + "-" + Math.Round(bpmMax) + "(" + Math.Round(bpmMost) + ")bpm";
}
private Container InfoLabel(FontAwesome icon, string text)
private Container infoLabel(FontAwesome icon, string text)
{
Container cont = new Container
return new Container
{
AutoSizeAxes = Axes.Both,
Children = new[] {
@ -218,7 +218,6 @@ namespace osu.Game.Screens.Select
},
}
};
return cont;
}
}
}