From a618ed140e0bd631f3d0aeba8a625b37c991673d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 2 Aug 2023 15:07:06 +0900 Subject: [PATCH] Move `StoryboardReplacesBackground` bindable more local to usage --- osu.Game/Graphics/Containers/UserDimContainer.cs | 6 ------ osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs | 9 +++++++-- osu.Game/Screens/Play/Player.cs | 2 -- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/osu.Game/Graphics/Containers/UserDimContainer.cs b/osu.Game/Graphics/Containers/UserDimContainer.cs index 6f6292c3b2..4821e6b370 100644 --- a/osu.Game/Graphics/Containers/UserDimContainer.cs +++ b/osu.Game/Graphics/Containers/UserDimContainer.cs @@ -28,11 +28,6 @@ namespace osu.Game.Graphics.Containers /// public readonly Bindable IgnoreUserSettings = new Bindable(); - /// - /// Whether or not the storyboard loaded should completely hide the background behind it. - /// - public readonly Bindable StoryboardReplacesBackground = new Bindable(); - /// /// Whether player is in break time. /// Must be bound to to allow for dim adjustments in gameplay. @@ -83,7 +78,6 @@ namespace osu.Game.Graphics.Containers LightenDuringBreaks.ValueChanged += _ => UpdateVisuals(); IsBreakTime.ValueChanged += _ => UpdateVisuals(); ShowStoryboard.ValueChanged += _ => UpdateVisuals(); - StoryboardReplacesBackground.ValueChanged += _ => UpdateVisuals(); IgnoreUserSettings.ValueChanged += _ => UpdateVisuals(); } diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs index 312fd496a1..8a3755f980 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs @@ -36,6 +36,9 @@ namespace osu.Game.Screens.Backgrounds /// public readonly Bindable IgnoreUserSettings = new Bindable(true); + /// + /// Whether or not the storyboard loaded should completely hide the background behind it. + /// public readonly Bindable StoryboardReplacesBackground = new Bindable(); /// @@ -60,12 +63,11 @@ namespace osu.Game.Screens.Backgrounds InternalChild = dimmable = CreateFadeContainer(); + dimmable.StoryboardReplacesBackground.BindTo(StoryboardReplacesBackground); dimmable.IgnoreUserSettings.BindTo(IgnoreUserSettings); dimmable.IsBreakTime.BindTo(IsBreakTime); dimmable.BlurAmount.BindTo(BlurAmount); dimmable.DimWhenUserSettingsIgnored.BindTo(DimWhenUserSettingsIgnored); - - StoryboardReplacesBackground.BindTo(dimmable.StoryboardReplacesBackground); } [BackgroundDependencyLoader] @@ -144,6 +146,8 @@ namespace osu.Game.Screens.Backgrounds /// public readonly Bindable BlurAmount = new BindableFloat(); + public readonly Bindable StoryboardReplacesBackground = new Bindable(); + public Background Background { get => background; @@ -187,6 +191,7 @@ namespace osu.Game.Screens.Backgrounds userBlurLevel.ValueChanged += _ => UpdateVisuals(); BlurAmount.ValueChanged += _ => UpdateVisuals(); + StoryboardReplacesBackground.ValueChanged += _ => UpdateVisuals(); } protected override bool ShowDimContent diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 7d67e2657d..5f8e061d89 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -1049,8 +1049,6 @@ namespace osu.Game.Screens.Play DimmableStoryboard.IsBreakTime.BindTo(breakTracker.IsBreakTime); - DimmableStoryboard.StoryboardReplacesBackground.BindTo(storyboardReplacesBackground); - storyboardReplacesBackground.Value = Beatmap.Value.Storyboard.ReplacesBackground && Beatmap.Value.Storyboard.HasDrawable; foreach (var mod in GameplayState.Mods.OfType())