From b05a12372a2ef916ad81a0103563f84bad3c1681 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 18:44:07 +0900 Subject: [PATCH 001/305] Add base barline. --- osu.Game.Modes.Taiko/Objects/BarLine.cs | 28 +++++++++++++++++++ .../osu.Game.Modes.Taiko.csproj | 1 + 2 files changed, 29 insertions(+) create mode 100644 osu.Game.Modes.Taiko/Objects/BarLine.cs diff --git a/osu.Game.Modes.Taiko/Objects/BarLine.cs b/osu.Game.Modes.Taiko/Objects/BarLine.cs new file mode 100644 index 0000000000..6c79d2172c --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/BarLine.cs @@ -0,0 +1,28 @@ +using osu.Game.Beatmaps.Timing; +using osu.Game.Database; + +namespace osu.Game.Modes.Taiko.Objects +{ + public class BarLine + { + /// + /// The start time of the control point this bar line represents. + /// + public double StartTime; + + /// + /// The time to scroll in the bar line. + /// + public double PreEmpt; + + /// + /// Whether this is a major bar line (affects display). + /// + public bool IsMajor; + + public void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty) + { + PreEmpt = 600 / (timing.SliderVelocityAt(StartTime) * difficulty.SliderMultiplier) * 1000; + } + } +} diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 7ea6dfeadb..39b18e23dc 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -50,6 +50,7 @@ + From b602b7a3eaf47b6e898fb5080ea40eea3e0a7fb9 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 20:39:18 +0900 Subject: [PATCH 002/305] Add barline drawables. --- .../Tests/TestCaseTaikoPlayfield.cs | 1 + .../Objects/Drawable/DrawableBarLine.cs | 73 +++++++++++++++++++ .../Objects/Drawable/DrawableMajorBarLine.cs | 55 ++++++++++++++ osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs | 11 +-- .../osu.Game.Modes.Taiko.csproj | 2 + 5 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 787bca5832..289e105f71 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -6,6 +6,7 @@ using osu.Framework.Screens.Testing; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects; +using osu.Game.Modes.Taiko.Objects.Drawable; using osu.Game.Modes.Taiko.UI; namespace osu.Desktop.VisualTests.Tests diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs new file mode 100644 index 0000000000..17c869d739 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs @@ -0,0 +1,73 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Modes.Taiko.UI; +using OpenTK; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + /// + /// A line that scrolls alongside hit objects in the playfield and visualises control points. + /// + public class DrawableBarLine : Container + { + /// + /// The line. + /// + protected Box Tracker; + + /// + /// The + /// + protected readonly BarLine BarLine; + + public DrawableBarLine(BarLine barLine) + { + BarLine = barLine; + + Anchor = Anchor.CentreLeft; + Origin = Anchor.Centre; + + RelativePositionAxes = Axes.X; + RelativeSizeAxes = Axes.Y; + + Width = 2f; + + Children = new[] + { + Tracker = new Box + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + + RelativeSizeAxes = Axes.Both, + + EdgeSmoothness = new Vector2(0.5f, 0), + Alpha = 0.75f + } + }; + + LifetimeStart = BarLine.StartTime - BarLine.PreEmpt * 2; + LifetimeEnd = BarLine.StartTime + BarLine.PreEmpt; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + Delay(BarLine.StartTime); + FadeOut(100 * BarLine.PreEmpt / 1000); + } + + private void moveToTimeOffset(double time) => MoveToX((float)((BarLine.StartTime - time) / BarLine.PreEmpt)); + + protected override void Update() + { + base.Update(); + moveToTimeOffset(Time.Current); + } + } +} \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs new file mode 100644 index 0000000000..ca5a6f9299 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs @@ -0,0 +1,55 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using OpenTK; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public class DrawableMajorBarLine : DrawableBarLine + { + public DrawableMajorBarLine(BarLine barLine) + : base(barLine) + { + Add(new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + + RelativeSizeAxes = Axes.Both, + + Children = new[] + { + new EquilateralTriangle + { + Name = "Top", + + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + + Position = new Vector2(0, -10), + Size = new Vector2(-20), + + EdgeSmoothness = new Vector2(1), + }, + new EquilateralTriangle + { + Name = "Bottom", + + Anchor = Anchor.BottomCentre, + Origin = Anchor.TopCentre, + + Position = new Vector2(0, 10), + Size = new Vector2(20), + + EdgeSmoothness = new Vector2(1), + } + } + }); + + Tracker.Alpha = 1f; + } + } +} \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs index b2248e2c3e..7ba3561cd4 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -14,6 +14,7 @@ using osu.Game.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics.Primitives; +using osu.Game.Modes.Taiko.Objects.Drawable; namespace osu.Game.Modes.Taiko.UI { @@ -47,7 +48,7 @@ namespace osu.Game.Modes.Taiko.UI protected override Container Content => hitObjectContainer; private Container ringExplosionContainer; - //private Container barLineContainer; + private Container barLineContainer; private Container judgementContainer; private Container hitObjectContainer; @@ -105,10 +106,10 @@ namespace osu.Game.Modes.Taiko.UI Scale = new Vector2(PLAYFIELD_SCALE), BlendingMode = BlendingMode.Additive }, - //barLineContainer = new Container - //{ - // RelativeSizeAxes = Axes.Both, - //}, + barLineContainer = new Container + { + RelativeSizeAxes = Axes.Both, + }, new HitTarget { Anchor = Anchor.CentreLeft, diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index a9b0babfe5..84c7d83d6a 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -52,6 +52,8 @@ + + From 507e4534094be93b50bf5423e6d4bda08c4846cf Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 21:26:01 +0900 Subject: [PATCH 003/305] Implement barline conversion from control points. --- osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs | 79 +++++++++++++++++++++ osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs | 5 ++ 2 files changed, 84 insertions(+) diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs index 80e42cb976..d88ffa7ae2 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs @@ -1,11 +1,16 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Allocation; +using osu.Framework.MathUtils; using osu.Game.Beatmaps; +using osu.Game.Beatmaps.Timing; using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Objects.Types; using osu.Game.Modes.Taiko.Beatmaps; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects; +using osu.Game.Modes.Taiko.Objects.Drawable; using osu.Game.Modes.UI; namespace osu.Game.Modes.Taiko.UI @@ -17,6 +22,80 @@ namespace osu.Game.Modes.Taiko.UI { } + [BackgroundDependencyLoader] + private void load() + { + loadBarLines(); + } + + private void loadBarLines() + { + var taikoPlayfield = Playfield as TaikoPlayfield; + + if (taikoPlayfield == null) + return; + + TaikoHitObject lastObject = Beatmap.HitObjects[Beatmap.HitObjects.Count - 1]; + // ReSharper disable once SuspiciousTypeConversion.Global (will be fixed with hitobjects) + double lastHitTime = 1 + (lastObject as IHasEndTime)?.EndTime ?? lastObject.StartTime; + + var timingPoints = Beatmap.TimingInfo.ControlPoints.FindAll(cp => cp.TimingChange); + + if (timingPoints == null || timingPoints.Count == 0) + return; + + int currentIndex = 0; + + while (currentIndex < timingPoints.Count && Precision.AlmostEquals(timingPoints[currentIndex].BeatLength, 0)) + currentIndex++; + + double time = timingPoints[currentIndex].Time; + double measureLength = timingPoints[currentIndex].BeatLength * (int)timingPoints[currentIndex].TimeSignature; + + // Find the bar line time closest to 0 + time -= measureLength * (int)(time / measureLength); + + // Always start barlines from a positive time + while (time < 0) + time += measureLength; + + int currentBeat = 0; + while (time <= lastHitTime) + { + ControlPoint current = timingPoints[currentIndex]; + + if (time > current.Time || current.OmitFirstBarLine) + { + bool isMajor = currentBeat % (int)current.TimeSignature == 0; + + BarLine barLine = new BarLine + { + StartTime = time, + }; + + barLine.ApplyDefaults(Beatmap.TimingInfo, Beatmap.BeatmapInfo.Difficulty); + + taikoPlayfield.AddBarLine(isMajor ? new DrawableMajorBarLine(barLine) : new DrawableBarLine(barLine)); + + currentBeat++; + } + + double bl = current.BeatLength; + + if (bl < 800) + bl *= (int)current.TimeSignature; + + time += bl; + + if (currentIndex + 1 >= timingPoints.Count || time < timingPoints[currentIndex + 1].Time) + continue; + + currentBeat = 0; + currentIndex++; + time = timingPoints[currentIndex].Time; + } + } + public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor(this); protected override IBeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(); diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs index 7ba3561cd4..993eaaabe7 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -181,6 +181,11 @@ namespace osu.Game.Modes.Taiko.UI base.Add(h); } + public void AddBarLine(DrawableBarLine barLine) + { + barLineContainer.Add(barLine); + } + public override void OnJudgement(DrawableHitObject judgedObject) { if (judgedObject.Judgement.Result == HitResult.Hit) From e1f8f44b32688d53716b3ad53ad7605590695c6b Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 21:26:55 +0900 Subject: [PATCH 004/305] Woops forgot to commit framework. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index e6394035d4..fd31d7451a 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit e6394035d443d4498b71e845e5763dd3faf98c7c +Subproject commit fd31d7451aa2f892bdb832f5f6dbc73b2959e57c From 9f3def05ef77440f782e16e305ab14e5670cc8ca Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 21:27:20 +0900 Subject: [PATCH 005/305] Add test case for bar lines. --- .../Tests/TestCaseTaikoPlayfield.cs | 22 +++++++++++++++++++ osu.Game.Modes.Taiko/Objects/BarLine.cs | 10 ++++----- .../Objects/Drawable/DrawableBarLine.cs | 9 ++++---- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 289e105f71..741520a798 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -3,6 +3,7 @@ using osu.Framework.MathUtils; using osu.Framework.Screens.Testing; +using osu.Framework.Timing; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects; @@ -17,12 +18,20 @@ namespace osu.Desktop.VisualTests.Tests private TaikoPlayfield playfield; + public TestCaseTaikoPlayfield() + { + Clock = new FramedClock(); + } + public override void Reset() { base.Reset(); + Clock.ProcessFrame(); + AddButton("Hit!", addHitJudgement); AddButton("Miss :(", addMissJudgement); + AddButton("Add bar line", addBarLine); Add(playfield = new TaikoPlayfield { @@ -61,6 +70,19 @@ namespace osu.Desktop.VisualTests.Tests }); } + private void addBarLine() + { + bool isMajor = RNG.Next(8) == 0; + + BarLine bl = new BarLine + { + StartTime = Time.Current + 1000, + PreEmpt = 1000 + }; + + playfield.AddBarLine(isMajor ? new DrawableMajorBarLine(bl) : new DrawableBarLine(bl)); + } + private class DrawableTestHit : DrawableHitObject { public DrawableTestHit(TaikoHitObject hitObject) diff --git a/osu.Game.Modes.Taiko/Objects/BarLine.cs b/osu.Game.Modes.Taiko/Objects/BarLine.cs index 6c79d2172c..0af36d0603 100644 --- a/osu.Game.Modes.Taiko/Objects/BarLine.cs +++ b/osu.Game.Modes.Taiko/Objects/BarLine.cs @@ -1,4 +1,7 @@ -using osu.Game.Beatmaps.Timing; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Beatmaps.Timing; using osu.Game.Database; namespace osu.Game.Modes.Taiko.Objects @@ -15,11 +18,6 @@ namespace osu.Game.Modes.Taiko.Objects /// public double PreEmpt; - /// - /// Whether this is a major bar line (affects display). - /// - public bool IsMajor; - public void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty) { PreEmpt = 600 / (timing.SliderVelocityAt(StartTime) * difficulty.SliderMultiplier) * 1000; diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs index 17c869d739..958197ef03 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs @@ -4,7 +4,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Game.Modes.Taiko.UI; using OpenTK; namespace osu.Game.Modes.Taiko.Objects.Drawable @@ -49,16 +48,16 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable Alpha = 0.75f } }; - - LifetimeStart = BarLine.StartTime - BarLine.PreEmpt * 2; - LifetimeEnd = BarLine.StartTime + BarLine.PreEmpt; } protected override void LoadComplete() { base.LoadComplete(); - Delay(BarLine.StartTime); + LifetimeStart = BarLine.StartTime - BarLine.PreEmpt * 2; + LifetimeEnd = BarLine.StartTime + BarLine.PreEmpt; + + Delay(BarLine.StartTime - Time.Current); FadeOut(100 * BarLine.PreEmpt / 1000); } From d8724e5e3e3fe5a7ac303ca14846462be4a20824 Mon Sep 17 00:00:00 2001 From: Jorolf Date: Fri, 24 Mar 2017 23:02:24 +0100 Subject: [PATCH 006/305] Add metadata details --- .../Tests/TestCaseDetails.cs | 31 +++++++ .../osu.Desktop.VisualTests.csproj | 5 +- osu.Game/Screens/Select/BeatmapDetailArea.cs | 29 +++++-- osu.Game/Screens/Select/Details.cs | 87 +++++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 5 files changed, 145 insertions(+), 8 deletions(-) create mode 100644 osu.Desktop.VisualTests/Tests/TestCaseDetails.cs create mode 100644 osu.Game/Screens/Select/Details.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseDetails.cs b/osu.Desktop.VisualTests/Tests/TestCaseDetails.cs new file mode 100644 index 0000000000..b97c61218f --- /dev/null +++ b/osu.Desktop.VisualTests/Tests/TestCaseDetails.cs @@ -0,0 +1,31 @@ +using osu.Framework.Graphics; +using osu.Framework.Screens.Testing; +using osu.Game.Database; +using osu.Game.Screens.Select; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace osu.Desktop.VisualTests.Tests +{ + class TestCaseDetails : TestCase + { + + public override void Reset() + { + base.Reset(); + + Add(new Details + { + RelativeSizeAxes = Axes.Both, + Metadata = new BeatmapMetadata + { + Source = "Some guy", + Tags = "beatmap metadata example with a very very long list of tags and not much creativity", + }, + }); + } + } +} diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index f1b4a99510..d94358a6a1 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -1,4 +1,4 @@ - + {69051C69-12AE-4E7D-A3E6-460D2E282312} @@ -183,6 +183,7 @@ + @@ -211,7 +212,7 @@ - + diff --git a/osu.Game/Screens/Select/BeatmapDetailArea.cs b/osu.Game/Screens/Select/BeatmapDetailArea.cs index 21e4d643f2..c7ee57e36c 100644 --- a/osu.Game/Screens/Select/BeatmapDetailArea.cs +++ b/osu.Game/Screens/Select/BeatmapDetailArea.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -17,8 +18,9 @@ namespace osu.Game.Screens.Select private readonly Container content; protected override Container Content => content; - public readonly Container Details; //todo: replace with a real details view when added + public readonly Details Details; public readonly Leaderboard Leaderboard; + private BeatmapDetailTab currentTab; private APIAccess api; @@ -32,7 +34,11 @@ namespace osu.Game.Screens.Select set { beatmap = value; - if (IsLoaded) Schedule(updateScores); + if (IsLoaded) + if(currentTab == BeatmapDetailTab.Details) + Schedule(updateDetails); + else + Schedule(updateScores); } } @@ -50,15 +56,15 @@ namespace osu.Game.Screens.Select case BeatmapDetailTab.Details: Details.Show(); Leaderboard.Hide(); + updateDetails(); break; default: Details.Hide(); Leaderboard.Show(); + updateScores(); break; } - - //for now let's always update scores. - updateScores(); + currentTab = tab; }, }, content = new Container @@ -70,7 +76,7 @@ namespace osu.Game.Screens.Select Add(new Drawable[] { - Details = new Container + Details = new Details { RelativeSizeAxes = Axes.Both, }, @@ -107,5 +113,16 @@ namespace osu.Game.Screens.Select getScoresRequest.Success += r => Leaderboard.Scores = r.Scores; api.Queue(getScoresRequest); } + + + + private void updateDetails() + { + if (!IsLoaded) return; + + if (api == null || beatmap?.BeatmapInfo == null) return; + + Details.Metadata = beatmap.Beatmap.Metadata; + } } } diff --git a/osu.Game/Screens/Select/Details.cs b/osu.Game/Screens/Select/Details.cs new file mode 100644 index 0000000000..7748bcd1b5 --- /dev/null +++ b/osu.Game/Screens/Select/Details.cs @@ -0,0 +1,87 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Linq; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics; +using osu.Game.Database; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Primitives; +using osu.Game.Graphics; +using OpenTK; +using osu.Framework.Allocation; + +namespace osu.Game.Screens.Select +{ + public class Details : Container + { + private FillFlowContainer metadataContainer; + private SpriteText description; + private SpriteText source; + private FillFlowContainer tags; + private BeatmapMetadata metadata; + public BeatmapMetadata Metadata + { + get + { + return metadata; + } + + set + { + if (metadata == value) return; + metadata = value; + source.Text = metadata.Source; + tags.Children = metadata.Tags.Split(' ').ToList().Select(text => new SpriteText { Text = text }); + } + } + + public Details() + { + Children = new[] + { + metadataContainer = new FillFlowContainer() + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Width = 0.4f, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new SpriteText + { + Text = "Description", + }, + description = new SpriteText(), + new SpriteText + { + Text = "Source", + Margin = new MarginPadding { Top = 20 }, + }, + source = new SpriteText(), + new SpriteText + { + Text = "Tags", + Margin = new MarginPadding { Top = 20 }, + }, + tags = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + Spacing = new Vector2(3,0), + }, + }, + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colour) + { + description.Colour = colour.GrayB; + source.Colour = colour.GrayB; + tags.Colour = colour.Yellow; + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 989e605c16..9d7627b5f2 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -201,6 +201,7 @@ + From 775fd63d0fa6a03184d77e556f1c17416359908e Mon Sep 17 00:00:00 2001 From: Jorolf Date: Sat, 25 Mar 2017 23:33:03 +0100 Subject: [PATCH 007/305] Added difficulty container --- .../Tests/TestCaseDetails.cs | 23 +- osu.Game/Screens/Select/BeatmapDetailArea.cs | 5 +- osu.Game/Screens/Select/Details.cs | 239 ++++++++++++++++-- osu.Game/Screens/Select/DetailsBar.cs | 68 +++++ osu.Game/osu.Game.csproj | 1 + 5 files changed, 309 insertions(+), 27 deletions(-) create mode 100644 osu.Game/Screens/Select/DetailsBar.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseDetails.cs b/osu.Desktop.VisualTests/Tests/TestCaseDetails.cs index b97c61218f..36e52717e4 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseDetails.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseDetails.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Framework.Screens.Testing; using osu.Game.Database; using osu.Game.Screens.Select; @@ -20,10 +23,22 @@ namespace osu.Desktop.VisualTests.Tests Add(new Details { RelativeSizeAxes = Axes.Both, - Metadata = new BeatmapMetadata + Beatmap = new BeatmapInfo { - Source = "Some guy", - Tags = "beatmap metadata example with a very very long list of tags and not much creativity", + Version = "VisualTest", + Metadata = new BeatmapMetadata + { + Source = "Some guy", + Tags = "beatmap metadata example with a very very long list of tags and not much creativity", + }, + Difficulty = new BeatmapDifficulty + { + CircleSize = 7, + ApproachRate = 3.5f, + OverallDifficulty = 5.7f, + DrainRate = 1, + }, + StarDifficulty = 5.3f, }, }); } diff --git a/osu.Game/Screens/Select/BeatmapDetailArea.cs b/osu.Game/Screens/Select/BeatmapDetailArea.cs index c7ee57e36c..f2e5388d0c 100644 --- a/osu.Game/Screens/Select/BeatmapDetailArea.cs +++ b/osu.Game/Screens/Select/BeatmapDetailArea.cs @@ -79,6 +79,7 @@ namespace osu.Game.Screens.Select Details = new Details { RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding(5), }, Leaderboard = new Leaderboard { @@ -121,8 +122,8 @@ namespace osu.Game.Screens.Select if (!IsLoaded) return; if (api == null || beatmap?.BeatmapInfo == null) return; - - Details.Metadata = beatmap.Beatmap.Metadata; + + Details.Beatmap = beatmap.Beatmap.BeatmapInfo; } } } diff --git a/osu.Game/Screens/Select/Details.cs b/osu.Game/Screens/Select/Details.cs index 7748bcd1b5..2374d0a674 100644 --- a/osu.Game/Screens/Select/Details.cs +++ b/osu.Game/Screens/Select/Details.cs @@ -1,46 +1,72 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Linq; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics; -using osu.Game.Database; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Primitives; -using osu.Game.Graphics; using OpenTK; +using OpenTK.Graphics; using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; +using osu.Game.Database; +using osu.Game.Graphics; +using System.Linq; namespace osu.Game.Screens.Select { public class Details : Container { - private FillFlowContainer metadataContainer; private SpriteText description; private SpriteText source; private FillFlowContainer tags; - private BeatmapMetadata metadata; - public BeatmapMetadata Metadata + + private DifficultyRow circleSize; + private DifficultyRow drainRate; + private DifficultyRow approachRate; + private DifficultyRow overallDifficulty; + private DifficultyRow stars; + + private BeatmapInfo beatmap; + public BeatmapInfo Beatmap { get { - return metadata; + return beatmap; } set { - if (metadata == value) return; - metadata = value; - source.Text = metadata.Source; - tags.Children = metadata.Tags.Split(' ').ToList().Select(text => new SpriteText { Text = text }); + if (beatmap == value) return; + beatmap = value; + description.Text = beatmap.Version; + source.Text = beatmap.Metadata.Source; + tags.Children = beatmap.Metadata.Tags.Split(' ').Select(text => new SpriteText + { + Text = text, + TextSize = 14, + Font = "Exo2.0-Medium", + }); + + circleSize.Value = beatmap.Difficulty.CircleSize; + drainRate.Value = beatmap.Difficulty.DrainRate; + approachRate.Value = beatmap.Difficulty.ApproachRate; + overallDifficulty.Value = beatmap.Difficulty.OverallDifficulty; + stars.Value = (float) beatmap.StarDifficulty; } } public Details() { - Children = new[] + Children = new Drawable[] { - metadataContainer = new FillFlowContainer() + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.5f, + }, + new FillFlowContainer() { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, @@ -48,22 +74,39 @@ namespace osu.Game.Screens.Select AutoSizeAxes = Axes.Y, Width = 0.4f, Direction = FillDirection.Vertical, + Padding = new MarginPadding(5), Children = new Drawable[] { new SpriteText { Text = "Description", + TextSize = 14, + Font = @"Exo2.0-Bold", + }, + description = new SpriteText + { + TextSize = 14, + Font = @"Exo2.0-Medium", + Direction = FillDirection.Full, }, - description = new SpriteText(), new SpriteText { Text = "Source", + TextSize = 14, + Font = @"Exo2.0-Bold", Margin = new MarginPadding { Top = 20 }, }, - source = new SpriteText(), + source = new SpriteText + { + TextSize = 14, + Font = @"Exo2.0-Medium", + Direction = FillDirection.Full, + }, new SpriteText { Text = "Tags", + TextSize = 14, + Font = @"Exo2.0-Bold", Margin = new MarginPadding { Top = 20 }, }, tags = new FillFlowContainer @@ -72,7 +115,65 @@ namespace osu.Game.Screens.Select Spacing = new Vector2(3,0), }, }, - } + }, + new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Width = 0.6f, + Padding = new MarginPadding(5) { Top = 0 }, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.5f, + }, + new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0,10), + Padding = new MarginPadding(7), + Children = new [] + { + circleSize = new DifficultyRow + { + DifficultyName = "Circle Size", + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + MaxValue = 7, + }, + drainRate = new DifficultyRow + { + DifficultyName = "HP Drain", + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + }, + approachRate = new DifficultyRow + { + DifficultyName = "Accuracy", + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + }, + overallDifficulty = new DifficultyRow + { + DifficultyName = "Limit Break", + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + }, + stars = new DifficultyRow + { + DifficultyName = "Star Difficulty", + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + }, + }, + }, + }, + }, }; } @@ -81,7 +182,103 @@ namespace osu.Game.Screens.Select { description.Colour = colour.GrayB; source.Colour = colour.GrayB; - tags.Colour = colour.Yellow; + tags.Colour = colour.YellowLight; + stars.BarColour = colour.YellowLight; + } + + private class DifficultyRow : Container + { + private SpriteText name; + private DetailsBar bar; + private SpriteText valueText; + + private float difficultyValue; + public float Value + { + get + { + return difficultyValue; + } + set + { + difficultyValue = value; + bar.Value = value/maxValue; + valueText.Text = value.ToString(); + } + } + + private float maxValue = 10; + public float MaxValue + { + get + { + return maxValue; + } + set + { + maxValue = value; + bar.Value = Value/value; + } + } + + public string DifficultyName + { + get + { + return name.Text; + } + set + { + name.Text = value; + } + } + + public SRGBColour BarColour + { + get + { + return bar.BarColour; + } + set + { + bar.BarColour = value; + } + } + + public DifficultyRow() + { + Children = new Drawable[] + { + name = new SpriteText + { + TextSize = 14, + Font = @"Exo2.0-Medium", + }, + bar = new DetailsBar + { + Origin = Anchor.CentreLeft, + Anchor = Anchor.CentreLeft, + RelativeSizeAxes = Axes.Both, + Size = new Vector2(1, 0.35f), + Padding = new MarginPadding { Left = 100, Right = 25 }, + }, + valueText = new SpriteText + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + TextSize = 14, + Font = @"Exo2.0-Medium", + }, + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colour) + { + name.Colour = colour.GrayB; + bar.BackgroundColour = colour.Gray7; + valueText.Colour = colour.GrayB; + } } } } diff --git a/osu.Game/Screens/Select/DetailsBar.cs b/osu.Game/Screens/Select/DetailsBar.cs new file mode 100644 index 0000000000..aabdf6809f --- /dev/null +++ b/osu.Game/Screens/Select/DetailsBar.cs @@ -0,0 +1,68 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; + +namespace osu.Game.Screens.Select +{ + class DetailsBar : Container + { + private Box background; + private Box bar; + + public float Value + { + get + { + return bar.Width; + } + set + { + bar.ResizeTo(new Vector2(value, 1), 200); + } + } + + public SRGBColour BackgroundColour + { + get + { + return background.Colour; + } + set + { + background.Colour = value; + } + } + + public SRGBColour BarColour + { + get + { + return bar.Colour; + } + set + { + bar.Colour = value; + } + } + + public DetailsBar() + { + Children = new [] + { + background = new Box + { + RelativeSizeAxes = Axes.Both, + }, + bar = new Box + { + RelativeSizeAxes = Axes.Both, + } + }; + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 9d7627b5f2..2198167c7d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -202,6 +202,7 @@ + From 2f9a15092b460d72caa223a3ae892f6a9e84fb88 Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 04:52:11 +0300 Subject: [PATCH 008/305] Refactor pause buttons --- .../Pause/{ResumeButton.cs => PauseButton.cs} | 9 ++----- osu.Game/Screens/Play/Pause/QuitButton.cs | 26 ------------------- osu.Game/Screens/Play/Pause/RetryButton.cs | 26 ------------------- 3 files changed, 2 insertions(+), 59 deletions(-) rename osu.Game/Screens/Play/Pause/{ResumeButton.cs => PauseButton.cs} (74%) delete mode 100644 osu.Game/Screens/Play/Pause/QuitButton.cs delete mode 100644 osu.Game/Screens/Play/Pause/RetryButton.cs diff --git a/osu.Game/Screens/Play/Pause/ResumeButton.cs b/osu.Game/Screens/Play/Pause/PauseButton.cs similarity index 74% rename from osu.Game/Screens/Play/Pause/ResumeButton.cs rename to osu.Game/Screens/Play/Pause/PauseButton.cs index d4f7555d3c..06e1308c43 100644 --- a/osu.Game/Screens/Play/Pause/ResumeButton.cs +++ b/osu.Game/Screens/Play/Pause/PauseButton.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Game.Graphics; @@ -8,19 +9,13 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Play.Pause { - public class ResumeButton : DialogButton + public class PauseButton : DialogButton { [BackgroundDependencyLoader] private void load(AudioManager audio, OsuColour colours) { - ButtonColour = colours.Green; SampleHover = audio.Sample.Get(@"Menu/menuclick"); SampleClick = audio.Sample.Get(@"Menu/menuback"); } - - public ResumeButton() - { - Text = @"Continue"; - } } } diff --git a/osu.Game/Screens/Play/Pause/QuitButton.cs b/osu.Game/Screens/Play/Pause/QuitButton.cs deleted file mode 100644 index 7b71b4b2fc..0000000000 --- a/osu.Game/Screens/Play/Pause/QuitButton.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Allocation; -using osu.Framework.Audio; -using osu.Game.Graphics.UserInterface; -using OpenTK.Graphics; - -namespace osu.Game.Screens.Play.Pause -{ - public class QuitButton : DialogButton - { - [BackgroundDependencyLoader] - private void load(AudioManager audio) - { - ButtonColour = new Color4(170, 27, 39, 255); // The red from the design isn't in the palette so it's used directly - SampleHover = audio.Sample.Get(@"Menu/menuclick"); - SampleClick = audio.Sample.Get(@"Menu/menuback"); - } - - public QuitButton() - { - Text = @"Quit to Main Menu"; - } - } -} diff --git a/osu.Game/Screens/Play/Pause/RetryButton.cs b/osu.Game/Screens/Play/Pause/RetryButton.cs deleted file mode 100644 index 8f660525c3..0000000000 --- a/osu.Game/Screens/Play/Pause/RetryButton.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Allocation; -using osu.Framework.Audio; -using osu.Game.Graphics; -using osu.Game.Graphics.UserInterface; - -namespace osu.Game.Screens.Play.Pause -{ - public class RetryButton : DialogButton - { - [BackgroundDependencyLoader] - private void load(AudioManager audio, OsuColour colours) - { - ButtonColour = colours.YellowDark; - SampleHover = audio.Sample.Get(@"Menu/menuclick"); - SampleClick = audio.Sample.Get(@"Menu/menu-play-click"); - } - - public RetryButton() - { - Text = @"Retry"; - } - } -} From 5461c6516ad72b103b0e91fb17c0c7f2d6874784 Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 04:53:57 +0300 Subject: [PATCH 009/305] Refactor PauseOverlay, FailDialog -> FailOverlay --- .../Tests/TestCasePauseOverlay.cs | 9 +- osu.Game/Screens/Play/FailDialog.cs | 42 --------- osu.Game/Screens/Play/FailOverlay.cs | 49 +++++++++++ osu.Game/Screens/Play/PauseOverlay.cs | 88 ++++++++----------- osu.Game/Screens/Play/Player.cs | 37 +++++--- osu.Game/osu.Game.csproj | 10 +-- 6 files changed, 121 insertions(+), 114 deletions(-) delete mode 100644 osu.Game/Screens/Play/FailDialog.cs create mode 100644 osu.Game/Screens/Play/FailOverlay.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs index ad8039bc66..32f3380086 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs @@ -1,8 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using OpenTK.Graphics; using osu.Framework.Logging; using osu.Framework.Screens.Testing; +using osu.Game.Graphics; using osu.Game.Screens.Play; namespace osu.Desktop.VisualTests.Tests @@ -22,9 +24,12 @@ namespace osu.Desktop.VisualTests.Tests { Depth = -1, OnResume = () => Logger.Log(@"Resume"), - OnRetry = () => Logger.Log(@"Retry"), - OnQuit = () => Logger.Log(@"Quit") }); + + pauseOverlay.AddButton(@"Continue", Color4.Green, delegate { Logger.Log(@"Resume"); }); + pauseOverlay.AddButton(@"Retry", Color4.Yellow, delegate { Logger.Log(@"Retry"); }); + pauseOverlay.AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), delegate { Logger.Log(@"Quit"); }); + AddButton("Pause", pauseOverlay.Show); AddButton("Add Retry", delegate { diff --git a/osu.Game/Screens/Play/FailDialog.cs b/osu.Game/Screens/Play/FailDialog.cs deleted file mode 100644 index 4bdd9d94d3..0000000000 --- a/osu.Game/Screens/Play/FailDialog.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Screens; -using osu.Framework.Graphics; -using osu.Game.Graphics.Sprites; -using osu.Game.Screens.Backgrounds; -using OpenTK; -using OpenTK.Graphics; - -namespace osu.Game.Screens.Play -{ - internal class FailDialog : OsuScreen - { - protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); - - private static readonly Vector2 background_blur = new Vector2(20); - - public FailDialog() - { - Add(new OsuSpriteText - { - Text = "You failed!", - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - TextSize = 50 - }); - } - - protected override void OnEntering(Screen last) - { - base.OnEntering(last); - Background.Schedule(() => (Background as BackgroundScreenBeatmap)?.BlurTo(background_blur, 1000)); - } - - protected override bool OnExiting(Screen next) - { - Background.Schedule(() => Background.FadeColour(Color4.White, 500)); - return base.OnExiting(next); - } - } -} diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs new file mode 100644 index 0000000000..cf0deb21c7 --- /dev/null +++ b/osu.Game/Screens/Play/FailOverlay.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transforms; +using osu.Framework.Input; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Screens.Play.Pause; +using OpenTK; +using OpenTK.Graphics; +using OpenTK.Input; + +namespace osu.Game.Screens.Play +{ + public class FailOverlay : PauseOverlay + { + public Action OnQuit; + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + if (args.Key == Key.Escape) + { + if (State == Visibility.Hidden) return false; + quit(); + return true; + } + + return base.OnKeyDown(state, args); + } + + private void quit() + { + OnQuit?.Invoke(); + Hide(); + } + + public FailOverlay() + { + title.Text = @"failed"; + description.Text = @"you're dead, try again?"; + } + } +} diff --git a/osu.Game/Screens/Play/PauseOverlay.cs b/osu.Game/Screens/Play/PauseOverlay.cs index 1cc6f9cf02..e79f9362b2 100644 --- a/osu.Game/Screens/Play/PauseOverlay.cs +++ b/osu.Game/Screens/Play/PauseOverlay.cs @@ -27,8 +27,11 @@ namespace osu.Game.Screens.Play protected override bool HideOnEscape => false; public Action OnResume; - public Action OnRetry; - public Action OnQuit; + + protected OsuSpriteText title; + protected OsuSpriteText description; + + private FillFlowContainer buttons; public int Retries { @@ -92,9 +95,33 @@ namespace osu.Game.Screens.Play return base.OnKeyDown(state, args); } - [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void resume() { + OnResume?.Invoke(); + Hide(); + } + + public void AddButton(string text, Color4 colour, Action action) + { + buttons.Add(new PauseButton + { + Text = text, + ButtonColour = colour, + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + Height = button_height, + Action = delegate { + action?.Invoke(); + Hide(); + } + }); + } + + public PauseOverlay() + { + AlwaysReceiveInput = true; + + RelativeSizeAxes = Axes.Both; Children = new Drawable[] { new Box @@ -123,7 +150,7 @@ namespace osu.Game.Screens.Play Spacing = new Vector2(0, 20), Children = new Drawable[] { - new OsuSpriteText + title = new OsuSpriteText { Text = @"paused", Font = @"Exo2.0-Medium", @@ -131,11 +158,11 @@ namespace osu.Game.Screens.Play Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, TextSize = 30, - Colour = colours.Yellow, + Colour = Color4.Yellow, Shadow = true, ShadowColour = new Color4(0, 0, 0, 0.25f) }, - new OsuSpriteText + description = new OsuSpriteText { Text = @"you're not going to do what i think you're going to do, are ya?", Origin = Anchor.TopCentre, @@ -145,12 +172,13 @@ namespace osu.Game.Screens.Play } } }, - new FillFlowContainer + buttons = new FillFlowContainer { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, Masking = true, EdgeEffect = new EdgeEffect { @@ -158,38 +186,6 @@ namespace osu.Game.Screens.Play Colour = Color4.Black.Opacity(0.6f), Radius = 50 }, - Children = new Drawable[] - { - new ResumeButton - { - Origin = Anchor.TopCentre, - Anchor = Anchor.TopCentre, - Height = button_height, - Action = resume - }, - new RetryButton - { - Origin = Anchor.TopCentre, - Anchor = Anchor.TopCentre, - Height = button_height, - Action = delegate - { - OnRetry?.Invoke(); - Hide(); - } - }, - new QuitButton - { - Origin = Anchor.TopCentre, - Anchor = Anchor.TopCentre, - Height = button_height, - Action = delegate - { - OnQuit?.Invoke(); - Hide(); - } - } - } }, retryCounterContainer = new FillFlowContainer { @@ -209,17 +205,5 @@ namespace osu.Game.Screens.Play Retries = 0; } - - private void resume() - { - OnResume?.Invoke(); - Hide(); - } - - public PauseOverlay() - { - AlwaysReceiveInput = true; - RelativeSizeAxes = Axes.Both; - } } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 702f907428..c4b37647cb 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -24,6 +24,7 @@ using osu.Game.Screens.Ranking; using System; using System.Linq; using osu.Game.Modes.Scoring; +using osu.Game.Graphics; namespace osu.Game.Screens.Play { @@ -33,7 +34,7 @@ namespace osu.Game.Screens.Play internal override bool ShowOverlays => false; - internal override bool HasLocalCursorDisplayed => !hasReplayLoaded && !IsPaused; + internal override bool HasLocalCursorDisplayed => !hasReplayLoaded && !IsPaused && !IsFailed; private bool hasReplayLoaded => hitRenderer.InputManager.ReplayInputHandler != null; @@ -41,6 +42,8 @@ namespace osu.Game.Screens.Play public bool IsPaused { get; private set; } + public bool IsFailed { get; private set; } + public int RestartCount; private const double pause_cooldown = 1000; @@ -60,9 +63,10 @@ namespace osu.Game.Screens.Play private HudOverlay hudOverlay; private PauseOverlay pauseOverlay; + private FailOverlay failOverlay; [BackgroundDependencyLoader] - private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config) + private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config, OsuColour colours) { var beatmap = Beatmap.Beatmap; @@ -129,9 +133,19 @@ namespace osu.Game.Screens.Play Delay(400); Schedule(Resume); }, - OnRetry = Restart, - OnQuit = Exit }; + pauseOverlay.AddButton(@"Continue", colours.Green, delegate { Delay(400); Schedule(Resume); }); + pauseOverlay.AddButton(@"Retry", colours.YellowDark, Restart); + pauseOverlay.AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), Exit); + + + failOverlay = new FailOverlay + { + Depth = -1, + OnQuit = Exit, + }; + failOverlay.AddButton(@"Retry", colours.YellowDark, Restart); + failOverlay.AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), Exit); if (ReplayInputHandler != null) @@ -161,7 +175,8 @@ namespace osu.Game.Screens.Play } }, hudOverlay, - pauseOverlay + pauseOverlay, + failOverlay }; } @@ -261,15 +276,13 @@ namespace osu.Game.Screens.Play private void onFail() { - Content.FadeColour(Color4.Red, 500); sourceClock.Stop(); Delay(500); - Schedule(delegate - { - ValidForResume = false; - Push(new FailDialog()); - }); + + IsFailed = true; + failOverlay.Retries = RestartCount; + failOverlay.Show(); } protected override void OnEntering(Screen last) @@ -339,6 +352,6 @@ namespace osu.Game.Screens.Play public ReplayInputHandler ReplayInputHandler; - protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused; + protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused && !IsFailed; } } \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 32dd814fdc..da69e85cab 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -194,8 +194,10 @@ - + + + @@ -331,12 +333,8 @@ - - - - @@ -396,4 +394,4 @@ --> - + \ No newline at end of file From 457f5c6a890a037dfb3b8b05da6e99146689953e Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 04:58:30 +0300 Subject: [PATCH 010/305] Removed unised using statement --- osu.Game/Screens/Play/Pause/PauseButton.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Play/Pause/PauseButton.cs b/osu.Game/Screens/Play/Pause/PauseButton.cs index 06e1308c43..a6ae5ebe39 100644 --- a/osu.Game/Screens/Play/Pause/PauseButton.cs +++ b/osu.Game/Screens/Play/Pause/PauseButton.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Game.Graphics; From 110d43bc25f6c4f451b3c749d025ef8cd69511c0 Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 05:12:04 +0300 Subject: [PATCH 011/305] fixes --- osu.Game/Screens/Play/FailOverlay.cs | 10 ---------- osu.Game/Screens/Play/Pause/PauseButton.cs | 2 +- osu.Game/Screens/Play/PauseOverlay.cs | 2 -- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs index cf0deb21c7..2799954a8b 100644 --- a/osu.Game/Screens/Play/FailOverlay.cs +++ b/osu.Game/Screens/Play/FailOverlay.cs @@ -2,18 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Framework.Allocation; -using osu.Framework.Extensions.Color4Extensions; -using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Transforms; using osu.Framework.Input; -using osu.Game.Graphics; -using osu.Game.Graphics.Sprites; -using osu.Game.Screens.Play.Pause; -using OpenTK; -using OpenTK.Graphics; using OpenTK.Input; namespace osu.Game.Screens.Play diff --git a/osu.Game/Screens/Play/Pause/PauseButton.cs b/osu.Game/Screens/Play/Pause/PauseButton.cs index a6ae5ebe39..afe06edb2e 100644 --- a/osu.Game/Screens/Play/Pause/PauseButton.cs +++ b/osu.Game/Screens/Play/Pause/PauseButton.cs @@ -11,7 +11,7 @@ namespace osu.Game.Screens.Play.Pause public class PauseButton : DialogButton { [BackgroundDependencyLoader] - private void load(AudioManager audio, OsuColour colours) + private void load(AudioManager audio) { SampleHover = audio.Sample.Get(@"Menu/menuclick"); SampleClick = audio.Sample.Get(@"Menu/menuback"); diff --git a/osu.Game/Screens/Play/PauseOverlay.cs b/osu.Game/Screens/Play/PauseOverlay.cs index e79f9362b2..f11a0ef957 100644 --- a/osu.Game/Screens/Play/PauseOverlay.cs +++ b/osu.Game/Screens/Play/PauseOverlay.cs @@ -2,14 +2,12 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transforms; using osu.Framework.Input; -using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Play.Pause; using OpenTK; From c4500fa270ca3f5cf99c49d89a9a190aaa9c43f5 Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 05:19:32 +0300 Subject: [PATCH 012/305] fixes --- .../Tests/TestCasePauseOverlay.cs | 1 - osu.Game/Screens/Play/FailOverlay.cs | 4 ++-- osu.Game/Screens/Play/Pause/PauseButton.cs | 1 - osu.Game/Screens/Play/PauseOverlay.cs | 12 ++++++------ 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs index 32f3380086..ebb651adb5 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs @@ -4,7 +4,6 @@ using OpenTK.Graphics; using osu.Framework.Logging; using osu.Framework.Screens.Testing; -using osu.Game.Graphics; using osu.Game.Screens.Play; namespace osu.Desktop.VisualTests.Tests diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs index 2799954a8b..b722d9d338 100644 --- a/osu.Game/Screens/Play/FailOverlay.cs +++ b/osu.Game/Screens/Play/FailOverlay.cs @@ -32,8 +32,8 @@ namespace osu.Game.Screens.Play public FailOverlay() { - title.Text = @"failed"; - description.Text = @"you're dead, try again?"; + Title.Text = @"failed"; + Description.Text = @"you're dead, try again?"; } } } diff --git a/osu.Game/Screens/Play/Pause/PauseButton.cs b/osu.Game/Screens/Play/Pause/PauseButton.cs index afe06edb2e..7698913ea5 100644 --- a/osu.Game/Screens/Play/Pause/PauseButton.cs +++ b/osu.Game/Screens/Play/Pause/PauseButton.cs @@ -3,7 +3,6 @@ using osu.Framework.Allocation; using osu.Framework.Audio; -using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Play.Pause diff --git a/osu.Game/Screens/Play/PauseOverlay.cs b/osu.Game/Screens/Play/PauseOverlay.cs index f11a0ef957..dec59fb63b 100644 --- a/osu.Game/Screens/Play/PauseOverlay.cs +++ b/osu.Game/Screens/Play/PauseOverlay.cs @@ -26,10 +26,10 @@ namespace osu.Game.Screens.Play public Action OnResume; - protected OsuSpriteText title; - protected OsuSpriteText description; + protected OsuSpriteText Title; + protected OsuSpriteText Description; - private FillFlowContainer buttons; + private readonly FillFlowContainer buttons; public int Retries { @@ -69,7 +69,7 @@ namespace osu.Game.Screens.Play } } - private FillFlowContainer retryCounterContainer; + private readonly FillFlowContainer retryCounterContainer; public override bool HandleInput => State == Visibility.Visible; @@ -148,7 +148,7 @@ namespace osu.Game.Screens.Play Spacing = new Vector2(0, 20), Children = new Drawable[] { - title = new OsuSpriteText + Title = new OsuSpriteText { Text = @"paused", Font = @"Exo2.0-Medium", @@ -160,7 +160,7 @@ namespace osu.Game.Screens.Play Shadow = true, ShadowColour = new Color4(0, 0, 0, 0.25f) }, - description = new OsuSpriteText + Description = new OsuSpriteText { Text = @"you're not going to do what i think you're going to do, are ya?", Origin = Anchor.TopCentre, From 9774f826abae909f30598d8115179c1693658db2 Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 06:08:31 +0300 Subject: [PATCH 013/305] Pause and fail overlays -> StopOverlay --- .../Tests/TestCasePauseOverlay.cs | 8 ++-- osu.Game/Screens/Play/FailOverlay.cs | 39 ------------------- osu.Game/Screens/Play/Player.cs | 16 +++++--- .../Play/{PauseOverlay.cs => StopOverlay.cs} | 36 +++++++++++------ osu.Game/osu.Game.csproj | 3 +- 5 files changed, 40 insertions(+), 62 deletions(-) delete mode 100644 osu.Game/Screens/Play/FailOverlay.cs rename osu.Game/Screens/Play/{PauseOverlay.cs => StopOverlay.cs} (88%) diff --git a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs index ebb651adb5..34c0d875b4 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs @@ -12,17 +12,19 @@ namespace osu.Desktop.VisualTests.Tests { public override string Description => @"Tests the pause overlay"; - private PauseOverlay pauseOverlay; + private StopOverlay pauseOverlay; private int retryCount; public override void Reset() { base.Reset(); - Add(pauseOverlay = new PauseOverlay + Add(pauseOverlay = new StopOverlay { Depth = -1, - OnResume = () => Logger.Log(@"Resume"), + OnEscPressed = () => Logger.Log(@"Resume"), + Title = @"paused", + Description = @"you're not going to do what i think you're going to do, are ya?", }); pauseOverlay.AddButton(@"Continue", Color4.Green, delegate { Logger.Log(@"Resume"); }); diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs deleted file mode 100644 index b722d9d338..0000000000 --- a/osu.Game/Screens/Play/FailOverlay.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System; -using osu.Framework.Graphics.Containers; -using osu.Framework.Input; -using OpenTK.Input; - -namespace osu.Game.Screens.Play -{ - public class FailOverlay : PauseOverlay - { - public Action OnQuit; - - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) - { - if (args.Key == Key.Escape) - { - if (State == Visibility.Hidden) return false; - quit(); - return true; - } - - return base.OnKeyDown(state, args); - } - - private void quit() - { - OnQuit?.Invoke(); - Hide(); - } - - public FailOverlay() - { - Title.Text = @"failed"; - Description.Text = @"you're dead, try again?"; - } - } -} diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index c4b37647cb..b6c185853a 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -62,8 +62,8 @@ namespace osu.Game.Screens.Play private SkipButton skipButton; private HudOverlay hudOverlay; - private PauseOverlay pauseOverlay; - private FailOverlay failOverlay; + private StopOverlay pauseOverlay; + private StopOverlay failOverlay; [BackgroundDependencyLoader] private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config, OsuColour colours) @@ -125,24 +125,28 @@ namespace osu.Game.Screens.Play hudOverlay.KeyCounter.Add(ruleset.CreateGameplayKeys()); hudOverlay.BindProcessor(scoreProcessor); - pauseOverlay = new PauseOverlay + pauseOverlay = new StopOverlay { Depth = -1, - OnResume = delegate + OnEscPressed = delegate { Delay(400); Schedule(Resume); }, + Title = @"paused", + Description = @"you're not going to do what i think you're going to do, are ya?", }; pauseOverlay.AddButton(@"Continue", colours.Green, delegate { Delay(400); Schedule(Resume); }); pauseOverlay.AddButton(@"Retry", colours.YellowDark, Restart); pauseOverlay.AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), Exit); - failOverlay = new FailOverlay + failOverlay = new StopOverlay { Depth = -1, - OnQuit = Exit, + OnEscPressed = Exit, + Title = @"failed", + Description = @"you're dead, try again?", }; failOverlay.AddButton(@"Retry", colours.YellowDark, Restart); failOverlay.AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), Exit); diff --git a/osu.Game/Screens/Play/PauseOverlay.cs b/osu.Game/Screens/Play/StopOverlay.cs similarity index 88% rename from osu.Game/Screens/Play/PauseOverlay.cs rename to osu.Game/Screens/Play/StopOverlay.cs index dec59fb63b..dd5986b9c8 100644 --- a/osu.Game/Screens/Play/PauseOverlay.cs +++ b/osu.Game/Screens/Play/StopOverlay.cs @@ -16,7 +16,7 @@ using OpenTK.Input; namespace osu.Game.Screens.Play { - public class PauseOverlay : OverlayContainer + public class StopOverlay : OverlayContainer { private const int transition_duration = 200; private const int button_height = 70; @@ -24,10 +24,22 @@ namespace osu.Game.Screens.Play protected override bool HideOnEscape => false; - public Action OnResume; + public Action OnEscPressed; - protected OsuSpriteText Title; - protected OsuSpriteText Description; + private string title; + private string description; + + public string Title + { + get { return title; } + set { title = value; } + } + + public string Description + { + get { return description; } + set { description = value; } + } private readonly FillFlowContainer buttons; @@ -86,16 +98,16 @@ namespace osu.Game.Screens.Play if (args.Key == Key.Escape) { if (State == Visibility.Hidden) return false; - resume(); + onEscPressed(); return true; } return base.OnKeyDown(state, args); } - private void resume() + private void onEscPressed() { - OnResume?.Invoke(); + OnEscPressed?.Invoke(); Hide(); } @@ -115,7 +127,7 @@ namespace osu.Game.Screens.Play }); } - public PauseOverlay() + public StopOverlay() { AlwaysReceiveInput = true; @@ -148,9 +160,9 @@ namespace osu.Game.Screens.Play Spacing = new Vector2(0, 20), Children = new Drawable[] { - Title = new OsuSpriteText + new OsuSpriteText { - Text = @"paused", + Text = Title, Font = @"Exo2.0-Medium", Spacing = new Vector2(5, 0), Origin = Anchor.TopCentre, @@ -160,9 +172,9 @@ namespace osu.Game.Screens.Play Shadow = true, ShadowColour = new Color4(0, 0, 0, 0.25f) }, - Description = new OsuSpriteText + new OsuSpriteText { - Text = @"you're not going to do what i think you're going to do, are ya?", + Text = Description, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Shadow = true, diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index da69e85cab..c81ea4b5d1 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -194,14 +194,13 @@ - - + From d1f686b1a8ee3565ff9f6f6b9962ba5344acd262 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 16:38:58 +0900 Subject: [PATCH 014/305] Fix DrawableTaikoHitObject origins. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs index c14dc6d7b0..609fac70ea 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs @@ -22,7 +22,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable : base(hitObject) { Anchor = Anchor.CentreLeft; - Origin = Anchor.Centre; + Origin = Anchor.CentreLeft; RelativePositionAxes = Axes.X; } From 1615db386a8eff9204b217f4cbe4bf81f834ec1d Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 16:47:13 +0900 Subject: [PATCH 015/305] Give DrumRoll some sane velocity/tickdistance defaults. --- osu.Game.Modes.Taiko/Objects/DrumRoll.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/DrumRoll.cs b/osu.Game.Modes.Taiko/Objects/DrumRoll.cs index 1f9241268b..7dba605213 100644 --- a/osu.Game.Modes.Taiko/Objects/DrumRoll.cs +++ b/osu.Game.Modes.Taiko/Objects/DrumRoll.cs @@ -25,13 +25,13 @@ namespace osu.Game.Modes.Taiko.Objects /// /// Velocity of the drum roll in positional length units per millisecond. /// - public double Velocity { get; protected set; } + public double Velocity { get; protected set; } = 5; /// /// The distance between ticks of this drumroll. /// Half of this value is the hit window of the ticks. /// - public double TickTimeDistance { get; protected set; } + public double TickTimeDistance { get; protected set; } = 200; /// /// Number of drum roll ticks required for a "Good" hit. From 1220972170a98eeaec35213b11f4dd2f8dffff4b Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 16:47:25 +0900 Subject: [PATCH 016/305] Fix ticks not being passed IsStrong. --- osu.Game.Modes.Taiko/Objects/DrumRoll.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Modes.Taiko/Objects/DrumRoll.cs b/osu.Game.Modes.Taiko/Objects/DrumRoll.cs index 7dba605213..ff73c40d2f 100644 --- a/osu.Game.Modes.Taiko/Objects/DrumRoll.cs +++ b/osu.Game.Modes.Taiko/Objects/DrumRoll.cs @@ -88,6 +88,7 @@ namespace osu.Game.Modes.Taiko.Objects PreEmpt = PreEmpt, TickTimeDistance = TickTimeDistance, StartTime = t, + IsStrong = IsStrong, Sample = new HitSampleInfo { Type = SampleType.None, From 2e8607687c1dccb4cb23c6675193769fff947401 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 16:49:39 +0900 Subject: [PATCH 017/305] Implement DrumRollTick drawing. --- .../Objects/Drawable/DrawableDrumRollTick.cs | 57 ++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index 1e270c6751..da460e5cfc 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -5,20 +5,67 @@ using OpenTK.Input; using osu.Game.Modes.Taiko.Judgements; using System; using osu.Game.Modes.Objects.Drawables; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transforms; namespace osu.Game.Modes.Taiko.Objects.Drawable { public class DrawableDrumRollTick : DrawableTaikoHitObject { + /// + /// The size of a tick. + /// + private const float tick_size = 24; + + /// + /// Any tick that is not the first is not filled, but is displayed + /// as a circle instead. This is what controls the stroke width of that circle. + /// + private const float tick_border_width = 6; + private readonly DrumRollTick tick; + private readonly CircularContainer bodyContainer; + public DrawableDrumRollTick(DrumRollTick tick) : base(tick) { this.tick = tick; + + Anchor = Anchor.CentreLeft; + Origin = Anchor.Centre; + + RelativePositionAxes = Axes.X; + Size = new Vector2(tick_size); + + Children = new[] + { + bodyContainer = new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Masking = true, + BorderThickness = tick_border_width, + BorderColour = Color4.White, + Children = new[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = tick.FirstTick ? 1 : 0, + AlwaysPresent = true + } + } + } + }; } - protected override TaikoJudgement CreateJudgement() => new TaikoDrumRollTickJudgement(); + protected override TaikoJudgement CreateJudgement() => new TaikoDrumRollTickJudgement { SecondHit = tick.IsStrong }; protected override void CheckJudgement(bool userTriggered) { @@ -38,11 +85,17 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable protected override void UpdateState(ArmedState state) { + switch (state) + { + case ArmedState.Hit: + bodyContainer.ScaleTo(0, 100, EasingTypes.OutQuint); + break; + } } protected override void UpdateScrollPosition(double time) { - // Drum roll ticks shouldn't move + // Ticks don't move } protected override bool HandleKeyPress(Key key) From 62693a6a59de583006fd2f9f8cd462b158fef14e Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 10:49:58 +0300 Subject: [PATCH 018/305] Again separate classes --- .../Tests/TestCasePauseOverlay.cs | 12 +++---- .../Play/{StopOverlay.cs => FailOverlay.cs} | 19 +++++----- osu.Game/Screens/Play/PauseOverlay.cs | 35 +++++++++++++++++++ osu.Game/Screens/Play/Player.cs | 21 +++++------ osu.Game/osu.Game.csproj | 3 +- 5 files changed, 60 insertions(+), 30 deletions(-) rename osu.Game/Screens/Play/{StopOverlay.cs => FailOverlay.cs} (93%) create mode 100644 osu.Game/Screens/Play/PauseOverlay.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs index 34c0d875b4..5b8bcf3d1b 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs @@ -12,25 +12,23 @@ namespace osu.Desktop.VisualTests.Tests { public override string Description => @"Tests the pause overlay"; - private StopOverlay pauseOverlay; + private PauseOverlay pauseOverlay; private int retryCount; public override void Reset() { base.Reset(); - Add(pauseOverlay = new StopOverlay + Add(pauseOverlay = new PauseOverlay { Depth = -1, - OnEscPressed = () => Logger.Log(@"Resume"), + OnResume = () => Logger.Log(@"Resume"), + OnRetry = () => Logger.Log(@"Retry"), + OnQuit = () => Logger.Log(@"Quit"), Title = @"paused", Description = @"you're not going to do what i think you're going to do, are ya?", }); - pauseOverlay.AddButton(@"Continue", Color4.Green, delegate { Logger.Log(@"Resume"); }); - pauseOverlay.AddButton(@"Retry", Color4.Yellow, delegate { Logger.Log(@"Retry"); }); - pauseOverlay.AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), delegate { Logger.Log(@"Quit"); }); - AddButton("Pause", pauseOverlay.Show); AddButton("Add Retry", delegate { diff --git a/osu.Game/Screens/Play/StopOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs similarity index 93% rename from osu.Game/Screens/Play/StopOverlay.cs rename to osu.Game/Screens/Play/FailOverlay.cs index dd5986b9c8..35a25c5207 100644 --- a/osu.Game/Screens/Play/StopOverlay.cs +++ b/osu.Game/Screens/Play/FailOverlay.cs @@ -13,10 +13,11 @@ using osu.Game.Screens.Play.Pause; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; +using osu.Game.Graphics; namespace osu.Game.Screens.Play { - public class StopOverlay : OverlayContainer + public class FailOverlay : OverlayContainer { private const int transition_duration = 200; private const int button_height = 70; @@ -24,7 +25,8 @@ namespace osu.Game.Screens.Play protected override bool HideOnEscape => false; - public Action OnEscPressed; + public Action OnRetry; + public Action OnQuit; private string title; private string description; @@ -98,19 +100,13 @@ namespace osu.Game.Screens.Play if (args.Key == Key.Escape) { if (State == Visibility.Hidden) return false; - onEscPressed(); + OnQuit(); return true; } return base.OnKeyDown(state, args); } - private void onEscPressed() - { - OnEscPressed?.Invoke(); - Hide(); - } - public void AddButton(string text, Color4 colour, Action action) { buttons.Add(new PauseButton @@ -127,7 +123,7 @@ namespace osu.Game.Screens.Play }); } - public StopOverlay() + public FailOverlay() { AlwaysReceiveInput = true; @@ -214,6 +210,9 @@ namespace osu.Game.Screens.Play }; Retries = 0; + + AddButton(@"Retry", Color4.Yellow, OnRetry); + AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit); } } } diff --git a/osu.Game/Screens/Play/PauseOverlay.cs b/osu.Game/Screens/Play/PauseOverlay.cs new file mode 100644 index 0000000000..a1564c6aac --- /dev/null +++ b/osu.Game/Screens/Play/PauseOverlay.cs @@ -0,0 +1,35 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Framework.Input; +using osu.Game.Graphics; +using OpenTK.Input; +using osu.Framework.Graphics.Containers; +using OpenTK.Graphics; + +namespace osu.Game.Screens.Play +{ + public class PauseOverlay : FailOverlay + { + public Action OnResume; + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + if (args.Key == Key.Escape) + { + if (State == Visibility.Hidden) return false; + OnResume(); + return true; + } + + return base.OnKeyDown(state, args); + } + + public PauseOverlay() + { + AddButton(@"Continue", Color4.Green, OnResume); + } + } +} + \ No newline at end of file diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index b6c185853a..51faa135f7 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -62,8 +62,8 @@ namespace osu.Game.Screens.Play private SkipButton skipButton; private HudOverlay hudOverlay; - private StopOverlay pauseOverlay; - private StopOverlay failOverlay; + private PauseOverlay pauseOverlay; + private FailOverlay failOverlay; [BackgroundDependencyLoader] private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config, OsuColour colours) @@ -125,31 +125,28 @@ namespace osu.Game.Screens.Play hudOverlay.KeyCounter.Add(ruleset.CreateGameplayKeys()); hudOverlay.BindProcessor(scoreProcessor); - pauseOverlay = new StopOverlay + pauseOverlay = new PauseOverlay { Depth = -1, - OnEscPressed = delegate + OnResume = delegate { Delay(400); Schedule(Resume); }, + OnRetry = Restart, + OnQuit = Exit, Title = @"paused", Description = @"you're not going to do what i think you're going to do, are ya?", }; - pauseOverlay.AddButton(@"Continue", colours.Green, delegate { Delay(400); Schedule(Resume); }); - pauseOverlay.AddButton(@"Retry", colours.YellowDark, Restart); - pauseOverlay.AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), Exit); - - failOverlay = new StopOverlay + failOverlay = new FailOverlay { Depth = -1, - OnEscPressed = Exit, + OnRetry = Restart, + OnQuit = Exit, Title = @"failed", Description = @"you're dead, try again?", }; - failOverlay.AddButton(@"Retry", colours.YellowDark, Restart); - failOverlay.AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), Exit); if (ReplayInputHandler != null) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index c81ea4b5d1..e3faa6544f 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -194,13 +194,14 @@ + + - From 6b1dab5b834dad53f8c71d7f67c9efbf4e966789 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 16:50:06 +0900 Subject: [PATCH 019/305] Implement drawable drumroll. --- .../Tests/TestCaseTaikoPlayfield.cs | 18 ++++++++++++ .../Objects/Drawable/DrawableDrumRoll.cs | 22 +++++++++------ .../Drawable/DrawableStrongDrumRoll.cs | 20 +++++++++++++ .../Drawable/Pieces/DrumRollCirclePiece.cs | 28 +++++++++++++++++++ .../osu.Game.Modes.Taiko.csproj | 4 ++- 5 files changed, 83 insertions(+), 9 deletions(-) create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongDrumRoll.cs create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/Pieces/DrumRollCirclePiece.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 395a0cab13..ef9c3006f1 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -6,6 +6,7 @@ using osu.Framework.Screens.Testing; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects; +using osu.Game.Modes.Taiko.Objects.Drawable; using osu.Game.Modes.Taiko.UI; namespace osu.Desktop.VisualTests.Tests @@ -22,6 +23,8 @@ namespace osu.Desktop.VisualTests.Tests AddButton("Hit!", addHitJudgement); AddButton("Miss :(", addMissJudgement); + AddButton("DrumRoll", () => addDrumRoll(false)); + AddButton("Strong DrumRoll", () => addDrumRoll(true)); Add(playfield = new TaikoPlayfield { @@ -60,6 +63,21 @@ namespace osu.Desktop.VisualTests.Tests }); } + private void addDrumRoll(bool strong) + { + var d = new DrumRoll + { + StartTime = Time.Current + 1000, + Distance = 2000, + PreEmpt = 1000, + }; + + if (strong) + playfield.Add(new DrawableStrongDrumRoll(d)); + else + playfield.Add(new DrawableDrumRoll(d)); + } + private class DrawableTestHit : DrawableHitObject { public DrawableTestHit(TaikoHitObject hitObject) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs index 3551538fe7..7915599c3e 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs @@ -1,8 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Graphics; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; +using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; using System.Linq; namespace osu.Game.Modes.Taiko.Objects.Drawable @@ -16,25 +18,23 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { this.drumRoll = drumRoll; - int tickIndex = 0; + RelativeSizeAxes = Axes.X; + Width = (float)(drumRoll.Duration / drumRoll.PreEmpt); + + Add(new DrumRollCirclePiece(CreateCirclePiece())); + foreach (var tick in drumRoll.Ticks) { var newTick = new DrawableDrumRollTick(tick) { - Depth = tickIndex, X = (float)((tick.StartTime - HitObject.StartTime) / drumRoll.Duration) }; AddNested(newTick); - - tickIndex++; + Add(newTick); } } - protected override void UpdateState(ArmedState state) - { - } - protected override void CheckJudgement(bool userTriggered) { if (userTriggered) @@ -53,5 +53,11 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable else Judgement.Result = HitResult.Miss; } + + protected override void UpdateState(ArmedState state) + { + } + + protected virtual CirclePiece CreateCirclePiece() => new CirclePiece(); } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongDrumRoll.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongDrumRoll.cs new file mode 100644 index 0000000000..e9723a0162 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongDrumRoll.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Taiko.Judgements; +using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public class DrawableStrongDrumRoll : DrawableDrumRoll + { + public DrawableStrongDrumRoll(DrumRoll drumRoll) + : base(drumRoll) + { + } + + protected override TaikoJudgement CreateJudgement() => new TaikoJudgement { SecondHit = true }; + + protected override CirclePiece CreateCirclePiece() => new StrongCirclePiece(); + } +} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/DrumRollCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/DrumRollCirclePiece.cs new file mode 100644 index 0000000000..d462f4eeb8 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/DrumRollCirclePiece.cs @@ -0,0 +1,28 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics; + +namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces +{ + public class DrumRollCirclePiece : Container + { + private readonly CirclePiece circle; + + public DrumRollCirclePiece(CirclePiece piece) + { + RelativeSizeAxes = Axes.X; + + Add(circle = piece); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + circle.AccentColour = colours.YellowDark; + } + } +} diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index d2aecc8d2e..3e26bf7ef2 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -53,11 +53,13 @@ + + @@ -102,4 +104,4 @@ --> - + \ No newline at end of file From 6f66558e299e14091321ee2b167289caef8d7276 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 17:10:01 +0900 Subject: [PATCH 020/305] Use relative size for ticks. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index da460e5cfc..74ffc59548 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -19,13 +19,13 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// /// The size of a tick. /// - private const float tick_size = 24; + private const float tick_size = TaikoHitObject.CIRCLE_RADIUS / 2; /// /// Any tick that is not the first is not filled, but is displayed /// as a circle instead. This is what controls the stroke width of that circle. /// - private const float tick_border_width = 6; + private const float tick_border_width = tick_size / 4; private readonly DrumRollTick tick; From 79764603d7b2102a414ada8e160c871f4b105856 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 17:18:58 +0900 Subject: [PATCH 021/305] Adjust comment. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index 74ffc59548..b6a20bab8d 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -22,8 +22,8 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable private const float tick_size = TaikoHitObject.CIRCLE_RADIUS / 2; /// - /// Any tick that is not the first is not filled, but is displayed - /// as a circle instead. This is what controls the stroke width of that circle. + /// Any tick that is not the first for a drumroll is not filled, but is instead displayed + /// as a hollow circle. This is what controls the border width of that circle. /// private const float tick_border_width = tick_size / 4; From 2ff213d2c8f47b37b0420704cdef00aad2a1cf06 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 17:19:27 +0900 Subject: [PATCH 022/305] Fix resharper warning. --- osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index ef9c3006f1..a318ec570f 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -72,10 +72,7 @@ namespace osu.Desktop.VisualTests.Tests PreEmpt = 1000, }; - if (strong) - playfield.Add(new DrawableStrongDrumRoll(d)); - else - playfield.Add(new DrawableDrumRoll(d)); + playfield.Add(strong ? new DrawableStrongDrumRoll(d) : new DrawableDrumRoll(d)); } private class DrawableTestHit : DrawableHitObject From c14759ebadd04d933f013b3c246ba593d993444b Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 17:24:14 +0900 Subject: [PATCH 023/305] Use new circle piece in test case. --- .../Tests/TestCaseTaikoHitObjects.cs | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs index 0204058b8a..5e8d28e192 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs @@ -78,21 +78,21 @@ namespace osu.Desktop.VisualTests.Tests Position = new Vector2(350, 500) }); - Add(new DrumRollCircle(new CirclePiece() + Add(new DrumRollCirclePiece(new CirclePiece { KiaiMode = kiai }) { - Width = 250, + Width = 0.25f, Position = new Vector2(575, 100) }); - Add(new DrumRollCircle(new StrongCirclePiece() + Add(new DrumRollCirclePiece(new StrongCirclePiece { KiaiMode = kiai }) { - Width = 250, + Width = 0.25f, Position = new Vector2(575, 300) }); } @@ -119,20 +119,6 @@ namespace osu.Desktop.VisualTests.Tests } } - private class DrumRollCircle : BaseCircle - { - public DrumRollCircle(CirclePiece piece) - : base(piece) - { - } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - Piece.AccentColour = colours.YellowDark; - } - } - private class CentreHitCircle : BaseCircle { public CentreHitCircle(CirclePiece piece) From 714c280531bad47c8b93c220c609db155a746f49 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 17:26:30 +0900 Subject: [PATCH 024/305] One more xmldoc. --- .../Objects/Drawable/Pieces/DrumRollCirclePiece.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/DrumRollCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/DrumRollCirclePiece.cs index d462f4eeb8..076ac5d03a 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/DrumRollCirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/DrumRollCirclePiece.cs @@ -8,6 +8,9 @@ using osu.Game.Graphics; namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces { + /// + /// A circle piece used for drumrolls. + /// public class DrumRollCirclePiece : Container { private readonly CirclePiece circle; From 85c2184170da10efc9d97cddc9e99fa6afb1b1ae Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 11:33:56 +0300 Subject: [PATCH 025/305] Fixes --- osu.Game/Screens/Play/FailOverlay.cs | 24 +++++++++++++++++------- osu.Game/Screens/Play/PauseOverlay.cs | 6 ++++-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs index 35a25c5207..4ff6c4c18d 100644 --- a/osu.Game/Screens/Play/FailOverlay.cs +++ b/osu.Game/Screens/Play/FailOverlay.cs @@ -14,6 +14,7 @@ using OpenTK; using OpenTK.Graphics; using OpenTK.Input; using osu.Game.Graphics; +using osu.Framework.Allocation; namespace osu.Game.Screens.Play { @@ -43,7 +44,7 @@ namespace osu.Game.Screens.Play set { description = value; } } - private readonly FillFlowContainer buttons; + private FillFlowContainer buttons; public int Retries { @@ -83,7 +84,7 @@ namespace osu.Game.Screens.Play } } - private readonly FillFlowContainer retryCounterContainer; + private FillFlowContainer retryCounterContainer; public override bool HandleInput => State == Visibility.Visible; @@ -123,11 +124,9 @@ namespace osu.Game.Screens.Play }); } - public FailOverlay() + [BackgroundDependencyLoader] + private void load(OsuColour colours) { - AlwaysReceiveInput = true; - - RelativeSizeAxes = Axes.Both; Children = new Drawable[] { new Box @@ -211,8 +210,19 @@ namespace osu.Game.Screens.Play Retries = 0; - AddButton(@"Retry", Color4.Yellow, OnRetry); + AddButtons(colours); + } + + protected virtual void AddButtons(OsuColour colours) + { + AddButton(@"Retry", colours.YellowDark, OnRetry); AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit); } + + public FailOverlay() + { + AlwaysReceiveInput = true; + RelativeSizeAxes = Axes.Both; + } } } diff --git a/osu.Game/Screens/Play/PauseOverlay.cs b/osu.Game/Screens/Play/PauseOverlay.cs index a1564c6aac..bad7050d7a 100644 --- a/osu.Game/Screens/Play/PauseOverlay.cs +++ b/osu.Game/Screens/Play/PauseOverlay.cs @@ -26,9 +26,11 @@ namespace osu.Game.Screens.Play return base.OnKeyDown(state, args); } - public PauseOverlay() + protected override void AddButtons(OsuColour colours) { - AddButton(@"Continue", Color4.Green, OnResume); + AddButton(@"Continue", colours.Green, OnResume); + AddButton(@"Retry", colours.YellowDark, OnRetry); + AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit); } } } From 60be69d3b08c700c5a1f8a14ebbfb756bb237a1b Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 11:41:08 +0300 Subject: [PATCH 026/305] Fixes --- osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs | 1 - osu.Game/Screens/Play/Player.cs | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs index 5b8bcf3d1b..f6af0acaf8 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK.Graphics; using osu.Framework.Logging; using osu.Framework.Screens.Testing; using osu.Game.Screens.Play; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 51faa135f7..46e5902459 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; -using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Track; @@ -66,7 +65,7 @@ namespace osu.Game.Screens.Play private FailOverlay failOverlay; [BackgroundDependencyLoader] - private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config, OsuColour colours) + private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config) { var beatmap = Beatmap.Beatmap; From 687f71e41040a8bf61f7d6b72d8e90195a3a1afa Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 11:45:48 +0300 Subject: [PATCH 027/305] Fixes --- osu.Game/Screens/Play/FailOverlay.cs | 2 +- osu.Game/Screens/Play/Player.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs index 4ff6c4c18d..86af45be76 100644 --- a/osu.Game/Screens/Play/FailOverlay.cs +++ b/osu.Game/Screens/Play/FailOverlay.cs @@ -163,7 +163,7 @@ namespace osu.Game.Screens.Play Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, TextSize = 30, - Colour = Color4.Yellow, + Colour = colours.Yellow, Shadow = true, ShadowColour = new Color4(0, 0, 0, 0.25f) }, diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 46e5902459..6ae041710d 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -23,7 +23,6 @@ using osu.Game.Screens.Ranking; using System; using System.Linq; using osu.Game.Modes.Scoring; -using osu.Game.Graphics; namespace osu.Game.Screens.Play { From cf3db49631cc2bece295676ac7b25175c8fb67aa Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 12:09:26 +0300 Subject: [PATCH 028/305] Inherit Pause/Fail overlay from InGameOverlay --- osu.Game/Screens/Play/FailOverlay.cs | 195 +--------------------- osu.Game/Screens/Play/InGameOverlay.cs | 216 +++++++++++++++++++++++++ osu.Game/Screens/Play/PauseOverlay.cs | 2 +- osu.Game/osu.Game.csproj | 1 + 4 files changed, 219 insertions(+), 195 deletions(-) create mode 100644 osu.Game/Screens/Play/InGameOverlay.cs diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs index 86af45be76..9fa95b008e 100644 --- a/osu.Game/Screens/Play/FailOverlay.cs +++ b/osu.Game/Screens/Play/FailOverlay.cs @@ -18,84 +18,8 @@ using osu.Framework.Allocation; namespace osu.Game.Screens.Play { - public class FailOverlay : OverlayContainer + public class FailOverlay : InGameOverlay { - private const int transition_duration = 200; - private const int button_height = 70; - private const float background_alpha = 0.75f; - - protected override bool HideOnEscape => false; - - public Action OnRetry; - public Action OnQuit; - - private string title; - private string description; - - public string Title - { - get { return title; } - set { title = value; } - } - - public string Description - { - get { return description; } - set { description = value; } - } - - private FillFlowContainer buttons; - - public int Retries - { - set - { - if (retryCounterContainer != null) - { - // "You've retried 1,065 times in this session" - // "You've retried 1 time in this session" - - retryCounterContainer.Children = new Drawable[] - { - new OsuSpriteText - { - Text = "You've retried ", - Shadow = true, - ShadowColour = new Color4(0, 0, 0, 0.25f), - TextSize = 18 - }, - new OsuSpriteText - { - Text = $"{value:n0}", - Font = @"Exo2.0-Bold", - Shadow = true, - ShadowColour = new Color4(0, 0, 0, 0.25f), - TextSize = 18 - }, - new OsuSpriteText - { - Text = $" time{(value == 1 ? "" : "s")} in this session", - Shadow = true, - ShadowColour = new Color4(0, 0, 0, 0.25f), - TextSize = 18 - } - }; - } - } - } - - private FillFlowContainer retryCounterContainer; - - public override bool HandleInput => State == Visibility.Visible; - - protected override void PopIn() => FadeIn(transition_duration, EasingTypes.In); - protected override void PopOut() => FadeOut(transition_duration, EasingTypes.In); - - // Don't let mouse down events through the overlay or people can click circles while paused. - protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; - - protected override bool OnMouseMove(InputState state) => true; - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { if (args.Key == Key.Escape) @@ -107,122 +31,5 @@ namespace osu.Game.Screens.Play return base.OnKeyDown(state, args); } - - public void AddButton(string text, Color4 colour, Action action) - { - buttons.Add(new PauseButton - { - Text = text, - ButtonColour = colour, - Origin = Anchor.TopCentre, - Anchor = Anchor.TopCentre, - Height = button_height, - Action = delegate { - action?.Invoke(); - Hide(); - } - }); - } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - Alpha = background_alpha, - }, - new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 50), - Origin = Anchor.Centre, - Anchor = Anchor.Centre, - Children = new Drawable[] - { - new FillFlowContainer - { - Origin = Anchor.TopCentre, - Anchor = Anchor.TopCentre, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 20), - Children = new Drawable[] - { - new OsuSpriteText - { - Text = Title, - Font = @"Exo2.0-Medium", - Spacing = new Vector2(5, 0), - Origin = Anchor.TopCentre, - Anchor = Anchor.TopCentre, - TextSize = 30, - Colour = colours.Yellow, - Shadow = true, - ShadowColour = new Color4(0, 0, 0, 0.25f) - }, - new OsuSpriteText - { - Text = Description, - Origin = Anchor.TopCentre, - Anchor = Anchor.TopCentre, - Shadow = true, - ShadowColour = new Color4(0, 0, 0, 0.25f) - } - } - }, - buttons = new FillFlowContainer - { - Origin = Anchor.TopCentre, - Anchor = Anchor.TopCentre, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Direction = FillDirection.Vertical, - Masking = true, - EdgeEffect = new EdgeEffect - { - Type = EdgeEffectType.Shadow, - Colour = Color4.Black.Opacity(0.6f), - Radius = 50 - }, - }, - retryCounterContainer = new FillFlowContainer - { - Origin = Anchor.TopCentre, - Anchor = Anchor.TopCentre, - AutoSizeAxes = Axes.Both, - } - } - }, - new PauseProgressBar - { - Origin = Anchor.BottomCentre, - Anchor = Anchor.BottomCentre, - Width = 1f - } - }; - - Retries = 0; - - AddButtons(colours); - } - - protected virtual void AddButtons(OsuColour colours) - { - AddButton(@"Retry", colours.YellowDark, OnRetry); - AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit); - } - - public FailOverlay() - { - AlwaysReceiveInput = true; - RelativeSizeAxes = Axes.Both; - } } } diff --git a/osu.Game/Screens/Play/InGameOverlay.cs b/osu.Game/Screens/Play/InGameOverlay.cs new file mode 100644 index 0000000000..b4efe47399 --- /dev/null +++ b/osu.Game/Screens/Play/InGameOverlay.cs @@ -0,0 +1,216 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transforms; +using osu.Framework.Input; +using osu.Game.Graphics.Sprites; +using osu.Game.Screens.Play.Pause; +using OpenTK; +using OpenTK.Graphics; +using OpenTK.Input; +using osu.Game.Graphics; +using osu.Framework.Allocation; + +namespace osu.Game.Screens.Play +{ + public class InGameOverlay : OverlayContainer + { + private const int transition_duration = 200; + private const int button_height = 70; + private const float background_alpha = 0.75f; + + protected override bool HideOnEscape => false; + + public Action OnRetry; + public Action OnQuit; + + private string title; + private string description; + + public string Title + { + get { return title; } + set { title = value; } + } + + public string Description + { + get { return description; } + set { description = value; } + } + + private FillFlowContainer buttons; + + public int Retries + { + set + { + if (retryCounterContainer != null) + { + // "You've retried 1,065 times in this session" + // "You've retried 1 time in this session" + + retryCounterContainer.Children = new Drawable[] + { + new OsuSpriteText + { + Text = "You've retried ", + Shadow = true, + ShadowColour = new Color4(0, 0, 0, 0.25f), + TextSize = 18 + }, + new OsuSpriteText + { + Text = $"{value:n0}", + Font = @"Exo2.0-Bold", + Shadow = true, + ShadowColour = new Color4(0, 0, 0, 0.25f), + TextSize = 18 + }, + new OsuSpriteText + { + Text = $" time{(value == 1 ? "" : "s")} in this session", + Shadow = true, + ShadowColour = new Color4(0, 0, 0, 0.25f), + TextSize = 18 + } + }; + } + } + } + + private FillFlowContainer retryCounterContainer; + + public override bool HandleInput => State == Visibility.Visible; + + protected override void PopIn() => FadeIn(transition_duration, EasingTypes.In); + protected override void PopOut() => FadeOut(transition_duration, EasingTypes.In); + + // Don't let mouse down events through the overlay or people can click circles while paused. + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; + + protected override bool OnMouseMove(InputState state) => true; + + public void AddButton(string text, Color4 colour, Action action) + { + buttons.Add(new PauseButton + { + Text = text, + ButtonColour = colour, + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + Height = button_height, + Action = delegate { + action?.Invoke(); + Hide(); + } + }); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = background_alpha, + }, + new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 50), + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + Children = new Drawable[] + { + new FillFlowContainer + { + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 20), + Children = new Drawable[] + { + new OsuSpriteText + { + Text = Title, + Font = @"Exo2.0-Medium", + Spacing = new Vector2(5, 0), + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + TextSize = 30, + Colour = colours.Yellow, + Shadow = true, + ShadowColour = new Color4(0, 0, 0, 0.25f) + }, + new OsuSpriteText + { + Text = Description, + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + Shadow = true, + ShadowColour = new Color4(0, 0, 0, 0.25f) + } + } + }, + buttons = new FillFlowContainer + { + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + Masking = true, + EdgeEffect = new EdgeEffect + { + Type = EdgeEffectType.Shadow, + Colour = Color4.Black.Opacity(0.6f), + Radius = 50 + }, + }, + retryCounterContainer = new FillFlowContainer + { + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + AutoSizeAxes = Axes.Both, + } + } + }, + new PauseProgressBar + { + Origin = Anchor.BottomCentre, + Anchor = Anchor.BottomCentre, + Width = 1f + } + }; + + Retries = 0; + + AddButtons(colours); + } + + protected virtual void AddButtons(OsuColour colours) + { + AddButton(@"Retry", colours.YellowDark, OnRetry); + AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit); + } + + public InGameOverlay() + { + AlwaysReceiveInput = true; + RelativeSizeAxes = Axes.Both; + } + } +} diff --git a/osu.Game/Screens/Play/PauseOverlay.cs b/osu.Game/Screens/Play/PauseOverlay.cs index bad7050d7a..f359fc3a78 100644 --- a/osu.Game/Screens/Play/PauseOverlay.cs +++ b/osu.Game/Screens/Play/PauseOverlay.cs @@ -10,7 +10,7 @@ using OpenTK.Graphics; namespace osu.Game.Screens.Play { - public class PauseOverlay : FailOverlay + public class PauseOverlay : InGameOverlay { public Action OnResume; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index e3faa6544f..c049b810f0 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -195,6 +195,7 @@ + From 91e18cc63e673e8bd865c811b892dc66cf9a2053 Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 12:12:35 +0300 Subject: [PATCH 029/305] Fix usings --- osu.Game/Screens/Play/FailOverlay.cs | 11 ----------- osu.Game/Screens/Play/InGameOverlay.cs | 1 - 2 files changed, 12 deletions(-) diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs index 9fa95b008e..906e25d14f 100644 --- a/osu.Game/Screens/Play/FailOverlay.cs +++ b/osu.Game/Screens/Play/FailOverlay.cs @@ -1,20 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using osu.Framework.Extensions.Color4Extensions; -using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Transforms; using osu.Framework.Input; -using osu.Game.Graphics.Sprites; -using osu.Game.Screens.Play.Pause; -using OpenTK; -using OpenTK.Graphics; using OpenTK.Input; -using osu.Game.Graphics; -using osu.Framework.Allocation; namespace osu.Game.Screens.Play { diff --git a/osu.Game/Screens/Play/InGameOverlay.cs b/osu.Game/Screens/Play/InGameOverlay.cs index b4efe47399..ba2027b4d5 100644 --- a/osu.Game/Screens/Play/InGameOverlay.cs +++ b/osu.Game/Screens/Play/InGameOverlay.cs @@ -12,7 +12,6 @@ using osu.Game.Graphics.Sprites; using osu.Game.Screens.Play.Pause; using OpenTK; using OpenTK.Graphics; -using OpenTK.Input; using osu.Game.Graphics; using osu.Framework.Allocation; From 1c166bdf32da0d0741b367ac335788ccea5aaed5 Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 28 Mar 2017 15:03:12 +0300 Subject: [PATCH 030/305] Edited pause visual test --- ...seOverlay.cs => TestCaseInGameOverlays.cs} | 30 +++++++++++++++++-- .../osu.Desktop.VisualTests.csproj | 6 ++-- 2 files changed, 29 insertions(+), 7 deletions(-) rename osu.Desktop.VisualTests/Tests/{TestCasePauseOverlay.cs => TestCaseInGameOverlays.cs} (51%) diff --git a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCaseInGameOverlays.cs similarity index 51% rename from osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs rename to osu.Desktop.VisualTests/Tests/TestCaseInGameOverlays.cs index f6af0acaf8..e0512f4747 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseInGameOverlays.cs @@ -1,17 +1,19 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Graphics.Containers; using osu.Framework.Logging; using osu.Framework.Screens.Testing; using osu.Game.Screens.Play; namespace osu.Desktop.VisualTests.Tests { - internal class TestCasePauseOverlay : TestCase + internal class TestCaseInGameOverlays : TestCase { - public override string Description => @"Tests the pause overlay"; + public override string Description => @"Tests the pause and fail overlays"; private PauseOverlay pauseOverlay; + private FailOverlay failOverlay; private int retryCount; public override void Reset() @@ -27,12 +29,34 @@ namespace osu.Desktop.VisualTests.Tests Title = @"paused", Description = @"you're not going to do what i think you're going to do, are ya?", }); + Add(failOverlay = new FailOverlay + { + Depth = -1, + OnRetry = () => Logger.Log(@"Retry"), + OnQuit = () => Logger.Log(@"Quit"), + Title = @"failed", + Description = @"you're dead, try again?", + }); - AddButton("Pause", pauseOverlay.Show); + AddButton("Pause", delegate { + if(failOverlay.State == Visibility.Visible) + { + failOverlay.Hide(); + } + pauseOverlay.Show(); + }); + AddButton("Fail", delegate { + if (pauseOverlay.State == Visibility.Visible) + { + pauseOverlay.Hide(); + } + failOverlay.Show(); + }); AddButton("Add Retry", delegate { retryCount++; pauseOverlay.Retries = retryCount; + failOverlay.Retries = retryCount; }); retryCount = 0; diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index f1b4a99510..f52fea22c9 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -185,6 +185,7 @@ + @@ -202,7 +203,6 @@ - @@ -212,9 +212,7 @@ - - - + - - + + diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index da068c5557..f0c137578a 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -83,22 +83,20 @@ - - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll - True + + $(SolutionDir)\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll - - ..\packages\SharpCompress.0.15.1\lib\net45\SharpCompress.dll - True + + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll + + + $(SolutionDir)\packages\SharpCompress.0.15.2\lib\net45\SharpCompress.dll False $(SolutionDir)\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll - - $(SolutionDir)\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - $(SolutionDir)\packages\SQLiteNetExtensions.1.3.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\SQLiteNetExtensions.dll diff --git a/osu.Desktop.VisualTests/packages.config b/osu.Desktop.VisualTests/packages.config index 5a30c50600..cad2ffff0d 100644 --- a/osu.Desktop.VisualTests/packages.config +++ b/osu.Desktop.VisualTests/packages.config @@ -4,9 +4,9 @@ Copyright (c) 2007-2017 ppy Pty Ltd . Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE --> - - - + + + diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index fbc342d695..dbd26b4640 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -124,8 +124,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll - True + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll $(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll diff --git a/osu.Desktop/packages.config b/osu.Desktop/packages.config index be9b65f0c6..60e8182c82 100644 --- a/osu.Desktop/packages.config +++ b/osu.Desktop/packages.config @@ -7,7 +7,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste - + \ No newline at end of file diff --git a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj index 593d8db4f6..50b1a095af 100644 --- a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj +++ b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj @@ -33,8 +33,7 @@ - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll - True + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll @@ -84,7 +83,7 @@ - - + \ No newline at end of file diff --git a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj b/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj index cc925d417a..896e9c68c6 100644 --- a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj +++ b/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj @@ -33,8 +33,7 @@ - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll - True + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll @@ -89,7 +88,7 @@ - - + \ No newline at end of file diff --git a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj index 55322e855e..21f0f03d8c 100644 --- a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj +++ b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj @@ -34,8 +34,7 @@ - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll - True + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll @@ -104,7 +103,7 @@ - - + \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index d0981c2500..19ba5c77e4 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -33,8 +33,7 @@ - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll - True + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll @@ -112,7 +111,7 @@ - - + \ No newline at end of file diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index d01aa77e02..2844528d0c 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -29,13 +29,11 @@ false - - $(SolutionDir)\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll - True + + $(SolutionDir)\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll - True + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll diff --git a/osu.Game.Tests/packages.config b/osu.Game.Tests/packages.config index ca53ef08b0..9972fb41a1 100644 --- a/osu.Game.Tests/packages.config +++ b/osu.Game.Tests/packages.config @@ -1,12 +1,11 @@  - - - + + \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index d90fdda41a..12410563cd 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -35,17 +35,14 @@ false - - $(SolutionDir)\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - True + + $(SolutionDir)\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll - True + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll - - ..\packages\SharpCompress.0.15.1\lib\net45\SharpCompress.dll - True + + $(SolutionDir)\packages\SharpCompress.0.15.2\lib\net45\SharpCompress.dll $(SolutionDir)\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll @@ -389,7 +386,7 @@ - - - - + + + From ec6267c5b2a97873cfc3f47d5343bb1ed66b66d7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 12 Apr 2017 19:41:11 +0900 Subject: [PATCH 298/305] switch -> if. --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 9781a507cc..7895ae0aa4 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -88,15 +88,10 @@ namespace osu.Game.Graphics.UserInterface lastSampleTime = Clock.CurrentTime; sample.Frequency.Value = 1 + NormalizedValue * 0.2f; - switch (NormalizedValue) - { - case 0: - sample.Frequency.Value -= 0.4f; - break; - case 1: - sample.Frequency.Value += 0.4f; - break; - } + if (NormalizedValue == 0) + sample.Frequency.Value -= 0.4f; + else if (NormalizedValue == 1) + sample.Frequency.Value += 0.4f; sample.Play(); } From 5bf71aae9c96fef30a8615eecbb3143129c9803d Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 12 Apr 2017 20:14:12 +0900 Subject: [PATCH 299/305] Remove unused using. --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 7895ae0aa4..180cb88707 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; -using OpenTK.Input; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; From 00cd2c8372a0a50058a2f01f00a9cdc978915950 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 12 Apr 2017 21:08:28 +0900 Subject: [PATCH 300/305] Better comments. --- osu.Game/Database/BeatmapMetric.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Database/BeatmapMetric.cs b/osu.Game/Database/BeatmapMetric.cs index e40da27d1d..ae21bc4170 100644 --- a/osu.Game/Database/BeatmapMetric.cs +++ b/osu.Game/Database/BeatmapMetric.cs @@ -8,17 +8,17 @@ namespace osu.Game.Database public class BeatmapMetric { /// - /// Ratings for a beatmap, length should be 10 + /// Total vote counts of user ratings on a scale of 0..length. /// public IEnumerable Ratings { get; set; } /// - /// Fails for a beatmap, length should be 100 + /// Points of failure on a relative time scale (usually 0..100). /// public IEnumerable Fails { get; set; } /// - /// Retries for a beatmap, length should be 100 + /// Points of retry on a relative time scale (usually 0..100). /// public IEnumerable Retries { get; set; } } From 2c3fa303862e93c539fc6789d0b8d18fda6ff134 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 12 Apr 2017 21:09:39 +0900 Subject: [PATCH 301/305] Metric -> Metrics. --- .../Tests/TestCaseBeatmapDetails.cs | 6 +++--- osu.Game/Database/BeatmapInfo.cs | 2 +- .../Database/{BeatmapMetric.cs => BeatmapMetrics.cs} | 5 ++++- osu.Game/Screens/Select/BeatmapDetails.cs | 10 +++++----- osu.Game/osu.Game.csproj | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) rename osu.Game/Database/{BeatmapMetric.cs => BeatmapMetrics.cs} (80%) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs index 7cf42b966a..4a59ad9534 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs @@ -40,7 +40,7 @@ namespace osu.Desktop.VisualTests.Tests DrainRate = 1, }, StarDifficulty = 5.3f, - Metric = new BeatmapMetric + Metrics = new BeatmapMetrics { Ratings = Enumerable.Range(0,10), Fails = Enumerable.Range(lastRange, 100).Select(i => i % 12 - 6), @@ -56,8 +56,8 @@ namespace osu.Desktop.VisualTests.Tests private void newRetryAndFailValues() { - details.Beatmap.Metric.Fails = Enumerable.Range(lastRange, 100).Select(i => i % 12 - 6); - details.Beatmap.Metric.Retries = Enumerable.Range(lastRange - 3, 100).Select(i => i % 12 - 6); + details.Beatmap.Metrics.Fails = Enumerable.Range(lastRange, 100).Select(i => i % 12 - 6); + details.Beatmap.Metrics.Retries = Enumerable.Range(lastRange - 3, 100).Select(i => i % 12 - 6); details.Beatmap = details.Beatmap; lastRange += 100; } diff --git a/osu.Game/Database/BeatmapInfo.cs b/osu.Game/Database/BeatmapInfo.cs index 7dc62d64e8..3e84825919 100644 --- a/osu.Game/Database/BeatmapInfo.cs +++ b/osu.Game/Database/BeatmapInfo.cs @@ -42,7 +42,7 @@ namespace osu.Game.Database public BeatmapDifficulty Difficulty { get; set; } [Ignore] - public BeatmapMetric Metric { get; set; } + public BeatmapMetrics Metrics { get; set; } public string Path { get; set; } diff --git a/osu.Game/Database/BeatmapMetric.cs b/osu.Game/Database/BeatmapMetrics.cs similarity index 80% rename from osu.Game/Database/BeatmapMetric.cs rename to osu.Game/Database/BeatmapMetrics.cs index ae21bc4170..91320110d0 100644 --- a/osu.Game/Database/BeatmapMetric.cs +++ b/osu.Game/Database/BeatmapMetrics.cs @@ -5,7 +5,10 @@ using System.Collections.Generic; namespace osu.Game.Database { - public class BeatmapMetric + /// + /// Beatmap metrics based on acculumated online data from community plays. + /// + public class BeatmapMetrics { /// /// Total vote counts of user ratings on a scale of 0..length. diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 0d3a9ba9ee..a0d15101e0 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -61,9 +61,9 @@ namespace osu.Game.Screens.Select approachRate.Value = beatmap.Difficulty.ApproachRate; stars.Value = (float)beatmap.StarDifficulty; - if (beatmap.Metric?.Ratings.Any() ?? false) + if (beatmap.Metrics?.Ratings.Any() ?? false) { - var ratings = beatmap.Metric.Ratings.ToList(); + var ratings = beatmap.Metrics.Ratings.ToList(); ratingsContainer.Show(); negativeRatings.Text = ratings.GetRange(0, ratings.Count / 2).Sum().ToString(); @@ -75,10 +75,10 @@ namespace osu.Game.Screens.Select else ratingsContainer.Hide(); - if ((beatmap.Metric?.Retries.Any() ?? false) && beatmap.Metric.Fails.Any()) + if ((beatmap.Metrics?.Retries.Any() ?? false) && beatmap.Metrics.Fails.Any()) { - var retries = beatmap.Metric.Retries; - var fails = beatmap.Metric.Fails; + var retries = beatmap.Metrics.Retries; + var fails = beatmap.Metrics.Fails; retryFailContainer.Show(); float maxValue = fails.Zip(retries, (fail, retry) => fail + retry).Max(); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 76ec4d3387..578704f4f8 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -76,7 +76,7 @@ - + From 359fea7e25f40013fdff1797e70710e01ec80e89 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Apr 2017 11:35:36 +0900 Subject: [PATCH 302/305] Improve "escape" pressing logic in pause/fail menus. --- osu.Game/Screens/Play/FailOverlay.cs | 25 ++++++++++++------------- osu.Game/Screens/Play/MenuOverlay.cs | 7 ++++--- osu.Game/Screens/Play/PauseOverlay.cs | 8 +++----- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs index 7a32e19338..faff687ddb 100644 --- a/osu.Game/Screens/Play/FailOverlay.cs +++ b/osu.Game/Screens/Play/FailOverlay.cs @@ -1,31 +1,19 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics.Containers; using osu.Framework.Input; using OpenTK.Input; using osu.Game.Graphics; using OpenTK.Graphics; using osu.Framework.Allocation; +using System.Linq; namespace osu.Game.Screens.Play { public class FailOverlay : MenuOverlay { - public override string Header => "failed"; public override string Description => "you're dead, try again?"; - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) - { - if (args.Key == Key.Escape) - { - if (State == Visibility.Hidden) return false; - OnQuit(); - return true; - } - - return base.OnKeyDown(state, args); - } [BackgroundDependencyLoader] private void load(OsuColour colours) @@ -33,5 +21,16 @@ namespace osu.Game.Screens.Play AddButton("Retry", colours.YellowDark, OnRetry); AddButton("Quit", new Color4(170, 27, 39, 255), OnQuit); } + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + if (!args.Repeat && args.Key == Key.Escape) + { + Buttons.Children.Last().TriggerClick(); + return true; + } + + return base.OnKeyDown(state, args); + } } } diff --git a/osu.Game/Screens/Play/MenuOverlay.cs b/osu.Game/Screens/Play/MenuOverlay.cs index ede49065a7..379df0a2a2 100644 --- a/osu.Game/Screens/Play/MenuOverlay.cs +++ b/osu.Game/Screens/Play/MenuOverlay.cs @@ -13,6 +13,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Game.Graphics; using osu.Framework.Allocation; +using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Play { @@ -30,7 +31,7 @@ namespace osu.Game.Screens.Play public abstract string Header { get; } public abstract string Description { get; } - private FillFlowContainer buttons; + protected FillFlowContainer Buttons; public int Retries { @@ -84,7 +85,7 @@ namespace osu.Game.Screens.Play protected void AddButton(string text, Color4 colour, Action action) { - buttons.Add(new PauseButton + Buttons.Add(new PauseButton { Text = text, ButtonColour = colour, @@ -151,7 +152,7 @@ namespace osu.Game.Screens.Play } } }, - buttons = new FillFlowContainer + Buttons = new FillFlowContainer { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, diff --git a/osu.Game/Screens/Play/PauseOverlay.cs b/osu.Game/Screens/Play/PauseOverlay.cs index f9706d263e..9561979751 100644 --- a/osu.Game/Screens/Play/PauseOverlay.cs +++ b/osu.Game/Screens/Play/PauseOverlay.cs @@ -2,10 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Linq; using osu.Framework.Input; using osu.Game.Graphics; using OpenTK.Input; -using osu.Framework.Graphics.Containers; using OpenTK.Graphics; using osu.Framework.Allocation; @@ -20,10 +20,9 @@ namespace osu.Game.Screens.Play protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { - if (args.Key == Key.Escape) + if (!args.Repeat && args.Key == Key.Escape) { - if (State == Visibility.Hidden) return false; - OnResume(); + Buttons.Children.First().TriggerClick(); return true; } @@ -39,4 +38,3 @@ namespace osu.Game.Screens.Play } } } - \ No newline at end of file From 1f4e0b0251c09a6f38c70f229b6b651792706de6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Apr 2017 12:41:08 +0900 Subject: [PATCH 303/305] Fix MosueUp and HighResolution events not being handled by MenuOverlays. --- osu.Game/Screens/Play/MenuOverlay.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/MenuOverlay.cs b/osu.Game/Screens/Play/MenuOverlay.cs index 379df0a2a2..738e5cc35d 100644 --- a/osu.Game/Screens/Play/MenuOverlay.cs +++ b/osu.Game/Screens/Play/MenuOverlay.cs @@ -17,7 +17,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Play { - public abstract class MenuOverlay : OverlayContainer + public abstract class MenuOverlay : OverlayContainer, IRequireHighFrequencyMousePosition { private const int transition_duration = 200; private const int button_height = 70; @@ -81,6 +81,8 @@ namespace osu.Game.Screens.Play // Don't let mouse down events through the overlay or people can click circles while paused. protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; + protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) => true; + protected override bool OnMouseMove(InputState state) => true; protected void AddButton(string text, Color4 colour, Action action) From 13f057f900b36bf78b15cd3d9385e9777da40b83 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Apr 2017 14:13:53 +0900 Subject: [PATCH 304/305] Give CursorTrail its own clock for the time being. --- osu.Game/Graphics/Cursor/CursorTrail.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Cursor/CursorTrail.cs b/osu.Game/Graphics/Cursor/CursorTrail.cs index 4b5610e840..09d1b99d13 100644 --- a/osu.Game/Graphics/Cursor/CursorTrail.cs +++ b/osu.Game/Graphics/Cursor/CursorTrail.cs @@ -13,6 +13,7 @@ using osu.Framework.Graphics.OpenGL.Buffers; using OpenTK.Graphics.ES30; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Colour; +using osu.Framework.Timing; namespace osu.Game.Graphics.Cursor { @@ -58,6 +59,9 @@ namespace osu.Game.Graphics.Cursor public CursorTrail() { + // as we are currently very dependent on having a running clock, let's make our own clock for the time being. + Clock = new FramedClock(); + AlwaysReceiveInput = true; RelativeSizeAxes = Axes.Both; @@ -231,4 +235,4 @@ namespace osu.Game.Graphics.Cursor } } } -} \ No newline at end of file +} From e62922ba6454eadc85988b25b93a2a4dc43c5704 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Apr 2017 00:57:57 +0900 Subject: [PATCH 305/305] Update framework. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 34ac837eeb..2234013e59 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 34ac837eebeecd0b6f35829780f2123f6b8cc698 +Subproject commit 2234013e59a99116ee9f9e56a95ff8a6667db2a7