From 53eb0e7e4e3adc354bae27005ea69b10ea895b74 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Feb 2019 20:30:23 +0900 Subject: [PATCH] More formatting fixes --- .../Graphics/Containers/UserDimContainer.cs | 25 ++++++++++--------- osu.Game/Screens/Play/Player.cs | 2 ++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/osu.Game/Graphics/Containers/UserDimContainer.cs b/osu.Game/Graphics/Containers/UserDimContainer.cs index 4d4b9da76f..4c8928e122 100644 --- a/osu.Game/Graphics/Containers/UserDimContainer.cs +++ b/osu.Game/Graphics/Containers/UserDimContainer.cs @@ -18,9 +18,9 @@ namespace osu.Game.Graphics.Containers { private const float background_fade_duration = 800; - protected Bindable DimLevel { get; private set; } + private Bindable dimLevel { get; set; } - protected Bindable ShowStoryboard { get; private set; } + private Bindable showStoryboard { get; set; } /// /// Whether or not user-configured dim levels should be applied to the container. @@ -41,10 +41,11 @@ namespace osu.Game.Graphics.Containers /// /// Creates a new . /// - /// - /// Whether or not this instance of UserDimContainer contains a storyboard. - /// While both backgrounds and storyboards allow user dim levels to be applied, storyboards can be toggled via + /// Whether or not this instance of UserDimContainer contains a storyboard. + /// + /// While both backgrounds and storyboards allow user dim levels to be applied, storyboards can be toggled via /// and can cause backgrounds to become hidden via . + /// /// public UserDimContainer(bool isStoryboard = false) { @@ -55,11 +56,11 @@ namespace osu.Game.Graphics.Containers [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - DimLevel = config.GetBindable(OsuSetting.DimLevel); - ShowStoryboard = config.GetBindable(OsuSetting.ShowStoryboard); + dimLevel = config.GetBindable(OsuSetting.DimLevel); + showStoryboard = config.GetBindable(OsuSetting.ShowStoryboard); EnableUserDim.ValueChanged += _ => updateBackgroundDim(); - DimLevel.ValueChanged += _ => updateBackgroundDim(); - ShowStoryboard.ValueChanged += _ => updateBackgroundDim(); + dimLevel.ValueChanged += _ => updateBackgroundDim(); + showStoryboard.ValueChanged += _ => updateBackgroundDim(); StoryboardReplacesBackground.ValueChanged += _ => updateBackgroundDim(); } @@ -73,15 +74,15 @@ namespace osu.Game.Graphics.Containers { if (isStoryboard) { - DimContainer.FadeTo(!ShowStoryboard.Value || DimLevel.Value == 1 ? 0 : 1, background_fade_duration, Easing.OutQuint); + DimContainer.FadeTo(!showStoryboard.Value || dimLevel.Value == 1 ? 0 : 1, background_fade_duration, Easing.OutQuint); } else { // The background needs to be hidden in the case of it being replaced by the storyboard - DimContainer.FadeTo(ShowStoryboard.Value && StoryboardReplacesBackground.Value ? 0 : 1, background_fade_duration, Easing.OutQuint); + DimContainer.FadeTo(showStoryboard.Value && StoryboardReplacesBackground.Value ? 0 : 1, background_fade_duration, Easing.OutQuint); } - DimContainer.FadeColour(EnableUserDim.Value ? OsuColour.Gray(1 - (float)DimLevel.Value) : Color4.White, background_fade_duration, Easing.OutQuint); + DimContainer.FadeColour(EnableUserDim.Value ? OsuColour.Gray(1 - (float)dimLevel.Value) : Color4.White, background_fade_duration, Easing.OutQuint); } } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 94f0a91b1c..27a888f58a 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -359,6 +359,7 @@ namespace osu.Game.Screens.Play Background.StoryboardReplacesBackground.BindTo(storyboardReplacesBackground); StoryboardContainer.StoryboardReplacesBackground.BindTo(storyboardReplacesBackground); + storyboardReplacesBackground.Value = Beatmap.Value.Storyboard.ReplacesBackground && Beatmap.Value.Storyboard.HasDrawable; Task.Run(() => @@ -417,6 +418,7 @@ namespace osu.Game.Screens.Play { float fadeOutDuration = instant ? 0 : 250; this.FadeOut(fadeOutDuration); + Background.EnableUserDim.Value = false; storyboardReplacesBackground.Value = false; }