mirror of
https://github.com/ppy/osu
synced 2025-01-13 17:41:09 +00:00
bpm range added + changed spacing
This commit is contained in:
parent
a04a0a7d2c
commit
2f708a704d
@ -16,6 +16,7 @@ using osu.Framework.Graphics.Colour;
|
|||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Beatmaps.Timing;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
@ -60,8 +61,20 @@ namespace osu.Game.Screens.Select
|
|||||||
BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo;
|
BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo;
|
||||||
BeatmapInfo beatmapInfo = beatmap.BeatmapInfo;
|
BeatmapInfo beatmapInfo = beatmap.BeatmapInfo;
|
||||||
|
|
||||||
|
double bpmPreview = 60000 / beatmap.Beatmap.BeatLengthAt(beatmap.Beatmap.Metadata.PreviewTime);
|
||||||
|
double bpmMax = bpmPreview;
|
||||||
|
double bpmMin = bpmPreview;
|
||||||
|
foreach( ControlPoint a in beatmap.Beatmap.ControlPoints)
|
||||||
|
{
|
||||||
|
if (a.BeatLength == 0) continue;
|
||||||
|
double tmp = 60000 / a.BeatLength;
|
||||||
|
if (bpmMax < tmp) bpmMax = tmp;
|
||||||
|
if (bpmMin > tmp) bpmMin = tmp;
|
||||||
|
}
|
||||||
|
string bpm;
|
||||||
|
if (bpmMax == bpmMin) bpm = bpmMin + "bpm";
|
||||||
|
else bpm = bpmMin + "-" + bpmMax + "(" + 60000 / beatmap.Beatmap.BeatLengthAt(beatmap.Beatmap.Metadata.PreviewTime) + ")bpm";
|
||||||
string length = "" + TimeSpan.FromMilliseconds((beatmap.Beatmap.HitObjects.Last().EndTime - beatmap.Beatmap.HitObjects.First().StartTime)).ToString(@"m\:s");
|
string length = "" + TimeSpan.FromMilliseconds((beatmap.Beatmap.HitObjects.Last().EndTime - beatmap.Beatmap.HitObjects.First().StartTime)).ToString(@"m\:s");
|
||||||
string bpm = 60000 / beatmap.Beatmap.BeatLengthAt(beatmap.Beatmap.Metadata.PreviewTime) + "bpm";
|
|
||||||
string hitCircles = "" + beatmap.Beatmap.HitObjects.Count(b => b.GetType().ToString().Equals("osu.Game.Modes.Osu.Objects.HitCircle"));
|
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 sliders = "" + beatmap.Beatmap.HitObjects.Count(b => b.GetType().ToString().Equals("osu.Game.Modes.Osu.Objects.Slider"));
|
||||||
|
|
||||||
@ -145,16 +158,17 @@ namespace osu.Game.Screens.Select
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Container
|
new FlowContainer
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = 20 },
|
Margin = new MarginPadding { Top = 20 },
|
||||||
|
Spacing = new Vector2(40,0),
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
InfoLabel(FontAwesome.fa_clock_o, length, 0),
|
InfoLabel(FontAwesome.fa_clock_o, length),
|
||||||
InfoLabel(FontAwesome.fa_circle, bpm, 1),
|
InfoLabel(FontAwesome.fa_circle, bpm),
|
||||||
InfoLabel(FontAwesome.fa_dot_circle_o, hitCircles, 2),
|
InfoLabel(FontAwesome.fa_dot_circle_o, hitCircles),
|
||||||
InfoLabel(FontAwesome.fa_circle_o, sliders, 3),
|
InfoLabel(FontAwesome.fa_circle_o, sliders),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -171,11 +185,10 @@ namespace osu.Game.Screens.Select
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private Container InfoLabel(FontAwesome icon, string text, int pos)
|
private Container InfoLabel(FontAwesome icon, string text)
|
||||||
{
|
{
|
||||||
Container cont = new Container
|
Container cont = new Container
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding {Left = pos*100, Top = 10 },
|
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new[] {
|
Children = new[] {
|
||||||
new TextAwesome
|
new TextAwesome
|
||||||
|
Loading…
Reference in New Issue
Block a user