From ccc86b66faa5c913447b16c5e1830deb11c038d7 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Mon, 25 Feb 2019 13:15:37 +0900 Subject: [PATCH] Use local private bindable in Player.cs --- osu.Game/Screens/Play/Player.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index be4c3fd3f6..43a2fe3f40 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -54,6 +54,7 @@ namespace osu.Game.Screens.Play private Bindable mouseWheelDisabled; private Bindable userAudioOffset; + private Bindable storyboardReplacesBackground; public int RestartCount; @@ -344,15 +345,17 @@ namespace osu.Game.Screens.Play .Delay(250) .FadeIn(250); - ShowStoryboard.ValueChanged += _ => + ShowStoryboard.ValueChanged += s => { - if (ShowStoryboard.Value && storyboard == null) + if (s.NewValue && storyboard == null) initializeStoryboard(true); }; Background.EnableUserDim.Value = true; - storyboardContainer.StoryboardReplacesBackground.Value = Beatmap.Value.Storyboard.ReplacesBackground && Beatmap.Value.Storyboard.HasDrawable; - storyboardContainer.StoryboardReplacesBackground.BindTo(Background?.StoryboardReplacesBackground); + + storyboardReplacesBackground.BindTo(Background?.StoryboardReplacesBackground); + storyboardReplacesBackground.BindTo(storyboardContainer.StoryboardReplacesBackground); + storyboardReplacesBackground.Value = Beatmap.Value.Storyboard.ReplacesBackground && Beatmap.Value.Storyboard.HasDrawable; Task.Run(() => { @@ -411,7 +414,7 @@ namespace osu.Game.Screens.Play float fadeOutDuration = instant ? 0 : 250; this.FadeOut(fadeOutDuration); Background.EnableUserDim.Value = false; - storyboardContainer.StoryboardReplacesBackground.Value = false; + storyboardReplacesBackground.Value = false; } protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !pauseContainer.IsPaused.Value;