Show playing progress.

This commit is contained in:
Huo Yaoyuan
2016-10-24 17:23:30 +08:00
parent 1a3a5c544d
commit 8e766a1f47

View File

@ -163,7 +163,7 @@ namespace osu.Game.Overlays
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = 10, Height = 10,
Width = 0.5f,//placeholder Width = 0,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Colour = Color4.Orange Colour = Color4.Orange
@ -176,6 +176,14 @@ namespace osu.Game.Overlays
} }
} }
protected override void Update()
{
base.Update();
if (currentTrack == null) return;
progress.Width = (float)(currentTrack.CurrentTime / currentTrack.Length);
if (currentTrack.HasCompleted) next();
}
private void prev() private void prev()
{ {
int i = playList.IndexOf(currentPlay); int i = playList.IndexOf(currentPlay);