From 30e820d107c9ddff861bdbae0d3bea47b6c60d04 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Feb 2019 20:36:00 +0900 Subject: [PATCH] Fix storyboard potentially being loaded many times --- osu.Game/Screens/Play/Player.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 27a888f58a..bb2211a533 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -349,10 +349,9 @@ namespace osu.Game.Screens.Play .Delay(250) .FadeIn(250); - ShowStoryboard.ValueChanged += s => + ShowStoryboard.ValueChanged += enabled => { - if (s.NewValue && storyboard == null) - initializeStoryboard(true); + if (enabled.NewValue) initializeStoryboard(true); }; Background.EnableUserDim.Value = true; @@ -427,7 +426,7 @@ namespace osu.Game.Screens.Play private void initializeStoryboard(bool asyncLoad) { - if (StoryboardContainer == null) + if (StoryboardContainer == null || storyboard != null) return; var beatmap = Beatmap.Value;