1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 21:17:46 +08:00
This commit is contained in:
DrabWeb 2017-03-23 07:38:08 -03:00
parent ca2816f9c8
commit 938f5eaf58
4 changed files with 17 additions and 5 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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[]