From 8e766a1f472793b23161b73d6f51e161222bb0fa Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Mon, 24 Oct 2016 17:23:30 +0800 Subject: [PATCH] Show playing progress. --- osu.Game/Overlays/MusicController.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 90e9f2bc9e..70e07d2d74 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -163,7 +163,7 @@ namespace osu.Game.Overlays { RelativeSizeAxes = Axes.X, Height = 10, - Width = 0.5f,//placeholder + Width = 0, Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, 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() { int i = playList.IndexOf(currentPlay);