mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 19:35:15 +08:00
add Spinner Count to BeatmapInfoWedge
- added Tooltips to the respective InfoLabels - made the TestCase internal like all others
This commit is contained in:
parent
7b4bbc6dc5
commit
f329b1ed72
@ -37,8 +37,9 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
public override IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap)
|
public override IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap)
|
||||||
{
|
{
|
||||||
IEnumerable<HitObject> hitObjects = beatmap.Beatmap.HitObjects;
|
IEnumerable<HitObject> hitObjects = beatmap.Beatmap.HitObjects;
|
||||||
IEnumerable<HitObject> circles = hitObjects.Where(d => !(d is IHasEndTime));
|
IEnumerable<HitObject> circles = hitObjects.Where(c => !(c is IHasEndTime));
|
||||||
IEnumerable<HitObject> sliders = hitObjects.Where(s => s is IHasCurve);
|
IEnumerable<HitObject> sliders = hitObjects.Where(s => s is IHasCurve);
|
||||||
|
IEnumerable<HitObject> spinners = hitObjects.Where(s => s is IHasEndTime && !(s is IHasCurve));
|
||||||
|
|
||||||
return new[]
|
return new[]
|
||||||
{
|
{
|
||||||
@ -53,6 +54,12 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
Name = @"Slider Count",
|
Name = @"Slider Count",
|
||||||
Content = sliders.Count().ToString(),
|
Content = sliders.Count().ToString(),
|
||||||
Icon = FontAwesome.fa_circle
|
Icon = FontAwesome.fa_circle
|
||||||
|
},
|
||||||
|
new BeatmapStatistic
|
||||||
|
{
|
||||||
|
Name = @"Spinner Count",
|
||||||
|
Content = spinners.Count().ToString(),
|
||||||
|
Icon = FontAwesome.fa_circle
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ using osu.Game.Screens.Select;
|
|||||||
|
|
||||||
namespace osu.Game.Tests.Visual
|
namespace osu.Game.Tests.Visual
|
||||||
{
|
{
|
||||||
public class TestCaseBeatmapInfoWedge : OsuTestCase
|
internal class TestCaseBeatmapInfoWedge : OsuTestCase
|
||||||
{
|
{
|
||||||
private BeatmapManager beatmaps;
|
private BeatmapManager beatmaps;
|
||||||
private readonly Random random;
|
private readonly Random random;
|
||||||
|
@ -19,6 +19,7 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Graphics.Cursor;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
@ -217,8 +218,8 @@ namespace osu.Game.Screens.Select
|
|||||||
},
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = 20, Left = 10 },
|
Margin = new MarginPadding { Top = 20 },
|
||||||
Spacing = new Vector2(40, 0),
|
Spacing = new Vector2(20, 0),
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = labels
|
Children = labels
|
||||||
},
|
},
|
||||||
@ -232,43 +233,51 @@ namespace osu.Game.Screens.Select
|
|||||||
double bpmMax = beatmap.ControlPointInfo.BPMMaximum;
|
double bpmMax = beatmap.ControlPointInfo.BPMMaximum;
|
||||||
double bpmMin = beatmap.ControlPointInfo.BPMMinimum;
|
double bpmMin = beatmap.ControlPointInfo.BPMMinimum;
|
||||||
|
|
||||||
if (Precision.AlmostEquals(bpmMin, bpmMax)) return $"{bpmMin:0}bpm";
|
if (Precision.AlmostEquals(bpmMin, bpmMax)) return $"{bpmMin:0}";
|
||||||
|
|
||||||
return $"{bpmMin:0}-{bpmMax:0}bpm (mostly {beatmap.ControlPointInfo.BPMMode:0}bpm)";
|
return $"{bpmMin:0}-{bpmMax:0} (mostly {beatmap.ControlPointInfo.BPMMode:0})";
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InfoLabel : Container
|
public class InfoLabel : Container, IHasTooltip
|
||||||
{
|
{
|
||||||
|
public string TooltipText { get; private set; }
|
||||||
|
|
||||||
public InfoLabel(BeatmapStatistic statistic)
|
public InfoLabel(BeatmapStatistic statistic)
|
||||||
{
|
{
|
||||||
|
TooltipText = statistic.Name;
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
Padding = new MarginPadding { Left = 16 };
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new SpriteIcon
|
new SpriteIcon
|
||||||
{
|
{
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Colour = OsuColour.FromHex(@"441288"),
|
||||||
Icon = FontAwesome.fa_square,
|
Icon = FontAwesome.fa_square,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Colour = new Color4(68, 17, 136, 255),
|
|
||||||
Rotation = 45,
|
Rotation = 45,
|
||||||
Size = new Vector2(20),
|
Size = new Vector2(20),
|
||||||
},
|
},
|
||||||
new SpriteIcon
|
new SpriteIcon
|
||||||
{
|
{
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Colour = OsuColour.FromHex(@"f7dd55"),
|
||||||
Icon = statistic.Icon,
|
Icon = statistic.Icon,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Colour = new Color4(255, 221, 85, 255),
|
|
||||||
Scale = new Vector2(0.8f),
|
Scale = new Vector2(0.8f),
|
||||||
Size = new Vector2(20),
|
Size = new Vector2(20),
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Left = 13 },
|
Anchor = Anchor.CentreLeft,
|
||||||
Font = @"Exo2.0-Bold",
|
|
||||||
Colour = new Color4(255, 221, 85, 255),
|
Colour = new Color4(255, 221, 85, 255),
|
||||||
|
Font = @"Exo2.0-Bold",
|
||||||
|
Margin = new MarginPadding { Left = 13 },
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
Text = statistic.Content,
|
Text = statistic.Content,
|
||||||
TextSize = 17,
|
TextSize = 17,
|
||||||
Origin = Anchor.CentreLeft
|
}
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user