From 7bc7df22496402de09d91595c3362aae6fcbdf74 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Jun 2019 17:22:10 +0900 Subject: [PATCH] Reduce background brightness at PlayerLoader --- osu.Game/Screens/Play/PlayerLoader.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 9de9f5cec8..681ce701d0 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -247,6 +247,7 @@ namespace osu.Game.Screens.Play public override void OnSuspending(IScreen next) { + BackgroundBrightnessReduction = false; base.OnSuspending(next); cancelLoad(); } @@ -258,6 +259,7 @@ namespace osu.Game.Screens.Play cancelLoad(); Background.EnableUserDim.Value = false; + BackgroundBrightnessReduction = false; return base.OnExiting(next); } @@ -273,6 +275,22 @@ namespace osu.Game.Screens.Play } } + private bool backgroundBrightnessReduction; + + protected bool BackgroundBrightnessReduction + { + get => backgroundBrightnessReduction; + set + { + if (value == backgroundBrightnessReduction) + return; + + backgroundBrightnessReduction = value; + + Background.FadeColour(OsuColour.Gray(backgroundBrightnessReduction ? 0.8f : 1), 200); + } + } + protected override void Update() { base.Update(); @@ -287,12 +305,16 @@ namespace osu.Game.Screens.Play // Preview user-defined background dim and blur when hovered on the visual settings panel. Background.EnableUserDim.Value = true; Background.BlurAmount.Value = 0; + + BackgroundBrightnessReduction = false; } else { // Returns background dim and blur to the values specified by PlayerLoader. Background.EnableUserDim.Value = false; Background.BlurAmount.Value = BACKGROUND_BLUR; + + BackgroundBrightnessReduction = true; } }