From 9ea70b849b3ab88ffb8afade1d271487799ac934 Mon Sep 17 00:00:00 2001 From: MrTheMake Date: Thu, 25 May 2017 14:16:51 +0200 Subject: [PATCH 1/4] Fix initialize beatmap change animation of the music controller --- osu.Game/Overlays/MusicController.cs | 46 +++++++++++++++------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 4faa339bed..ff6b581480 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -264,32 +264,36 @@ namespace osu.Game.Overlays private void beatmapChanged(WorkingBeatmap beatmap) { - progressBar.IsEnabled = beatmap != null; - - bool audioEquals = beatmapBacking.Value?.BeatmapInfo?.AudioEquals(current?.BeatmapInfo) ?? false; - - TransformDirection direction; - - if (audioEquals) - direction = TransformDirection.None; - else if (queuedDirection.HasValue) + if (current != null) { - direction = queuedDirection.Value; + progressBar.IsEnabled = beatmap != null; + + bool audioEquals = beatmapBacking.Value?.BeatmapInfo?.AudioEquals(current.BeatmapInfo) ?? false; + + TransformDirection direction; + + if (audioEquals) + direction = TransformDirection.None; + else if (queuedDirection.HasValue) + { + direction = queuedDirection.Value; + queuedDirection = null; + } + else + { + //figure out the best direction based on order in playlist. + var last = playlist.BeatmapSets.TakeWhile(b => b.ID != current.BeatmapSetInfo.ID).Count(); + var next = beatmapBacking.Value == null ? -1 : playlist.BeatmapSets.TakeWhile(b => b.ID != beatmapBacking.Value.BeatmapSetInfo.ID).Count(); + + direction = last > next ? TransformDirection.Prev : TransformDirection.Next; + } + + + updateDisplay(beatmapBacking, direction); queuedDirection = null; } - else - { - //figure out the best direction based on order in playlist. - var last = current == null ? -1 : playlist.BeatmapSets.TakeWhile(b => b.ID != current.BeatmapSetInfo.ID).Count(); - var next = beatmapBacking.Value == null ? -1 : playlist.BeatmapSets.TakeWhile(b => b.ID != beatmapBacking.Value.BeatmapSetInfo.ID).Count(); - - direction = last > next ? TransformDirection.Prev : TransformDirection.Next; - } current = beatmapBacking.Value; - - updateDisplay(beatmapBacking, direction); - queuedDirection = null; } private ScheduledDelegate pendingBeatmapSwitch; From c32d816f9cb26c531cdd4b81dca360acdf464a6f Mon Sep 17 00:00:00 2001 From: MrTheMake Date: Thu, 25 May 2017 14:19:04 +0200 Subject: [PATCH 2/4] Removed new line --- osu-framework | 2 +- osu.Game/Overlays/MusicController.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 777996fb97..4de8400d5b 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 777996fb9731ba1895a5ab1323cbbc97259ff741 +Subproject commit 4de8400d5b3169bddb9fea7b25ed2498a166c14d diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index ff6b581480..1ac189d8e2 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -288,7 +288,6 @@ namespace osu.Game.Overlays direction = last > next ? TransformDirection.Prev : TransformDirection.Next; } - updateDisplay(beatmapBacking, direction); queuedDirection = null; } From 9de7e7bc40617f7538e1b738e2e8c20f97a84129 Mon Sep 17 00:00:00 2001 From: MrTheMake Date: Thu, 25 May 2017 17:49:47 +0200 Subject: [PATCH 3/4] Fixes --- osu.Game/Overlays/MusicController.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 1ac189d8e2..f1be55801f 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -264,14 +264,14 @@ namespace osu.Game.Overlays private void beatmapChanged(WorkingBeatmap beatmap) { + progressBar.IsEnabled = beatmap != null; + + TransformDirection direction = TransformDirection.None; + if (current != null) { - progressBar.IsEnabled = beatmap != null; - bool audioEquals = beatmapBacking.Value?.BeatmapInfo?.AudioEquals(current.BeatmapInfo) ?? false; - TransformDirection direction; - if (audioEquals) direction = TransformDirection.None; else if (queuedDirection.HasValue) @@ -287,12 +287,12 @@ namespace osu.Game.Overlays direction = last > next ? TransformDirection.Prev : TransformDirection.Next; } - - updateDisplay(beatmapBacking, direction); - queuedDirection = null; } current = beatmapBacking.Value; + + updateDisplay(beatmapBacking, direction); + queuedDirection = null; } private ScheduledDelegate pendingBeatmapSwitch; From 79e731ec2a182cc5cb3032ad9c90aec0b9c2c6db Mon Sep 17 00:00:00 2001 From: MrTheMake Date: Thu, 25 May 2017 20:20:30 +0200 Subject: [PATCH 4/4] Updated framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 4de8400d5b..8baad1b948 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 4de8400d5b3169bddb9fea7b25ed2498a166c14d +Subproject commit 8baad1b9484b9f35724e2f965c18cfe710907d80