diff --git a/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs b/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs index 80ca040ef8..b66a6a4ec1 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs @@ -25,6 +25,7 @@ namespace osu.Desktop.VisualTests.Tests Origin = Anchor.BottomLeft, RelativeSizeAxes = Axes.X, Length = 100, + OnSeek = (time) => progress.CurrentTime = time, }); AddButton("Toggle Bar", progress.ToggleVisibility); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 2dde50f492..22eb157cc9 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -140,6 +140,12 @@ namespace osu.Game.Screens.Play hudOverlay.BindHitRenderer(hitRenderer); hudOverlay.Progress.Length = Beatmap.Track.Length; + hudOverlay.Progress.OnSeek = (time) => + { + //todo: temporary + Beatmap.Track.Seek(time); + Beatmap.Track.Start(); + }; //bind HitRenderer to ScoreProcessor and ourselves (for a pass situation) hitRenderer.OnAllJudged += onCompletion; diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index b99fb429dd..6f50381a4f 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -70,11 +70,10 @@ namespace osu.Game.Screens.Play Bottom = bar_height } }, - bar = new SongProgressBar(bar_height + graph_height, handleSize, fillColour) + bar = new SongProgressBar(bar_height, graph_height, handleSize, fillColour) { Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, - Height = bar_height, SeekRequested = delegate (float position) { OnSeek?.Invoke(Length * position); diff --git a/osu.Game/Screens/Play/SongProgressBar.cs b/osu.Game/Screens/Play/SongProgressBar.cs index 31acb1354f..f720e2bf96 100644 --- a/osu.Game/Screens/Play/SongProgressBar.cs +++ b/osu.Game/Screens/Play/SongProgressBar.cs @@ -12,13 +12,19 @@ namespace osu.Game.Screens.Play { public class SongProgressBar : DragBar { - public SongProgressBar(float barHeight, Vector2 handleSize, Color4 fillColour) + public SongProgressBar(float barHeight, float handleBarHeight, Vector2 handleSize, Color4 fillColour) { Fill.Colour = fillColour; + Height = barHeight + handleBarHeight + handleSize.Y; + FillContainer.RelativeSizeAxes = Axes.X; + FillContainer.Height = barHeight; Add(new Box { - RelativeSizeAxes = Axes.Both, + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + RelativeSizeAxes = Axes.X, + Height = barHeight, Colour = Color4.Black, Alpha = 0.5f, Depth = 1 @@ -28,7 +34,7 @@ namespace osu.Game.Screens.Play Origin = Anchor.BottomRight, Anchor = Anchor.BottomRight, Width = 2, - Height = barHeight, + Height = barHeight + handleBarHeight, Colour = Color4.White, Position = new Vector2(2, 0), Children = new Drawable[]