From f329b1ed722cc1f0e2d14ce88b573d3ab3a506da Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Thu, 14 Dec 2017 19:55:15 +0100 Subject: [PATCH 1/3] add Spinner Count to BeatmapInfoWedge - added Tooltips to the respective InfoLabels - made the TestCase internal like all others --- osu.Game.Rulesets.Osu/OsuRuleset.cs | 9 +++++- .../Visual/TestCaseBeatmapInfoWedge.cs | 2 +- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 31 ++++++++++++------- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 85a46f3aaa..19d60c9046 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -37,8 +37,9 @@ namespace osu.Game.Rulesets.Osu public override IEnumerable GetBeatmapStatistics(WorkingBeatmap beatmap) { IEnumerable hitObjects = beatmap.Beatmap.HitObjects; - IEnumerable circles = hitObjects.Where(d => !(d is IHasEndTime)); + IEnumerable circles = hitObjects.Where(c => !(c is IHasEndTime)); IEnumerable sliders = hitObjects.Where(s => s is IHasCurve); + IEnumerable spinners = hitObjects.Where(s => s is IHasEndTime && !(s is IHasCurve)); return new[] { @@ -53,6 +54,12 @@ namespace osu.Game.Rulesets.Osu Name = @"Slider Count", Content = sliders.Count().ToString(), Icon = FontAwesome.fa_circle + }, + new BeatmapStatistic + { + Name = @"Spinner Count", + Content = spinners.Count().ToString(), + Icon = FontAwesome.fa_circle } }; } diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs index 0168cedc86..4ac7469a5a 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs @@ -12,7 +12,7 @@ using osu.Game.Screens.Select; namespace osu.Game.Tests.Visual { - public class TestCaseBeatmapInfoWedge : OsuTestCase + internal class TestCaseBeatmapInfoWedge : OsuTestCase { private BeatmapManager beatmaps; private readonly Random random; diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 5ced60a9da..12e93d9ff7 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -19,6 +19,7 @@ using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Cursor; namespace osu.Game.Screens.Select { @@ -217,8 +218,8 @@ namespace osu.Game.Screens.Select }, new FillFlowContainer { - Margin = new MarginPadding { Top = 20, Left = 10 }, - Spacing = new Vector2(40, 0), + Margin = new MarginPadding { Top = 20 }, + Spacing = new Vector2(20, 0), AutoSizeAxes = Axes.Both, Children = labels }, @@ -232,43 +233,51 @@ namespace osu.Game.Screens.Select double bpmMax = beatmap.ControlPointInfo.BPMMaximum; 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) { + TooltipText = statistic.Name; AutoSizeAxes = Axes.Both; + Padding = new MarginPadding { Left = 16 }; + Children = new Drawable[] { new SpriteIcon { + Anchor = Anchor.CentreLeft, + Colour = OsuColour.FromHex(@"441288"), Icon = FontAwesome.fa_square, Origin = Anchor.Centre, - Colour = new Color4(68, 17, 136, 255), Rotation = 45, Size = new Vector2(20), }, new SpriteIcon { + Anchor = Anchor.CentreLeft, + Colour = OsuColour.FromHex(@"f7dd55"), Icon = statistic.Icon, Origin = Anchor.Centre, - Colour = new Color4(255, 221, 85, 255), Scale = new Vector2(0.8f), Size = new Vector2(20), }, new OsuSpriteText { - Margin = new MarginPadding { Left = 13 }, - Font = @"Exo2.0-Bold", + Anchor = Anchor.CentreLeft, Colour = new Color4(255, 221, 85, 255), + Font = @"Exo2.0-Bold", + Margin = new MarginPadding { Left = 13 }, + Origin = Anchor.CentreLeft, Text = statistic.Content, TextSize = 17, - Origin = Anchor.CentreLeft - }, + } }; } } From 33654ee5b449dab1e9d9554a8e27253f9c203e68 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 15 Dec 2017 13:01:06 +0900 Subject: [PATCH 2/3] Remove explicit padding on icon --- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 42 ++++++++++++--------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 12e93d9ff7..3ef6ceeaeb 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -246,35 +246,43 @@ namespace osu.Game.Screens.Select { TooltipText = statistic.Name; AutoSizeAxes = Axes.Both; - Padding = new MarginPadding { Left = 16 }; Children = new Drawable[] { - new SpriteIcon + new Container { Anchor = Anchor.CentreLeft, - Colour = OsuColour.FromHex(@"441288"), - Icon = FontAwesome.fa_square, - Origin = Anchor.Centre, - Rotation = 45, - Size = new Vector2(20), - }, - new SpriteIcon - { - Anchor = Anchor.CentreLeft, - Colour = OsuColour.FromHex(@"f7dd55"), - Icon = statistic.Icon, - Origin = Anchor.Centre, - Scale = new Vector2(0.8f), + Origin = Anchor.CentreLeft, Size = new Vector2(20), + Children = new[] + { + new SpriteIcon + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.FromHex(@"441288"), + Icon = FontAwesome.fa_square, + Rotation = 45, + }, + new SpriteIcon + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Scale = new Vector2(0.8f), + Colour = OsuColour.FromHex(@"f7dd55"), + Icon = statistic.Icon, + }, + } }, new OsuSpriteText { Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, Colour = new Color4(255, 221, 85, 255), Font = @"Exo2.0-Bold", - Margin = new MarginPadding { Left = 13 }, - Origin = Anchor.CentreLeft, + Margin = new MarginPadding { Left = 30 }, Text = statistic.Content, TextSize = 17, } From 5caafd215f24ea66b32d6fcccb39e622fe5d5275 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 15 Dec 2017 13:02:49 +0900 Subject: [PATCH 3/3] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index dd7dba7212..fc6de01ad6 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit dd7dba7212845b780fa50e0aa12b1aaa7155cddb +Subproject commit fc6de01ad6045544991bf278316c9eed8ea01ef1