From 69b1c76dce86e928c8ead423c78fea902542aefb Mon Sep 17 00:00:00 2001 From: David Zhao Date: Thu, 28 Feb 2019 16:51:17 +0900 Subject: [PATCH] Actually implement blurring fix --- .../Visual/TestCaseBackgroundScreenBeatmap.cs | 20 ++++++++++++------- osu.Game.Tests/Visual/TestCasePlayerLoader.cs | 2 +- .../Graphics/Containers/UserDimContainer.cs | 4 ++-- .../Backgrounds/BackgroundScreenBeatmap.cs | 1 + osu.Game/Screens/Play/PlayerLoader.cs | 5 ++++- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBackgroundScreenBeatmap.cs b/osu.Game.Tests/Visual/TestCaseBackgroundScreenBeatmap.cs index bec113430b..4ef52ec712 100644 --- a/osu.Game.Tests/Visual/TestCaseBackgroundScreenBeatmap.cs +++ b/osu.Game.Tests/Visual/TestCaseBackgroundScreenBeatmap.cs @@ -162,6 +162,7 @@ namespace osu.Game.Tests.Visual AddUntilStep(() => { if (songSelect.IsCurrentScreen()) return true; + songSelect.MakeCurrent(); return false; }, "Wait for song select is current"); @@ -264,13 +265,16 @@ namespace osu.Game.Tests.Visual { createSongSelect(); - AddStep("Start player loader", () => { songSelect.Push(playerLoader = new DimAccessiblePlayerLoader(player = new DimAccessiblePlayer + AddStep("Start player loader", () => { - AllowLeadIn = false, - AllowResults = false, - AllowPause = allowPause, - Ready = true, - })); }); + songSelect.Push(playerLoader = new DimAccessiblePlayerLoader(player = new DimAccessiblePlayer + { + AllowLeadIn = false, + AllowResults = false, + AllowPause = allowPause, + Ready = true, + })); + }); AddUntilStep(() => playerLoader.IsLoaded, "Wait for Player Loader to load"); AddStep("Move mouse to center of screen", () => InputManager.MoveMouseTo(playerLoader.ScreenPos)); AddUntilStep(() => player.IsLoaded, "Wait for player to load"); @@ -279,7 +283,7 @@ namespace osu.Game.Tests.Visual private void createSongSelect() { AddStep("Create new screen stack", () => Child = screenStackContainer = new ScreenStackCacheContainer { RelativeSizeAxes = Axes.Both }); - AddUntilStep(() => screenStackContainer.IsLoaded,"Wait for screen stack creation"); + AddUntilStep(() => screenStackContainer.IsLoaded, "Wait for screen stack creation"); AddStep("Create new song select", () => screenStackContainer.ScreenStack.Push(songSelect = new DummySongSelect())); AddUntilStep(() => songSelect.IsLoaded, "Wait for song select to load"); AddStep("Set user settings", () => @@ -355,6 +359,7 @@ namespace osu.Game.Tests.Visual } public UserDimContainer CurrentStoryboardContainer => StoryboardContainer; + // Whether or not the player should be allowed to load. public bool Ready; @@ -430,6 +435,7 @@ namespace osu.Game.Tests.Visual : base(isStoryboard) { } + public Color4 CurrentColour => DimContainer.Colour; public float CurrentAlpha => DimContainer.Alpha; } diff --git a/osu.Game.Tests/Visual/TestCasePlayerLoader.cs b/osu.Game.Tests/Visual/TestCasePlayerLoader.cs index 156393670d..244f553e97 100644 --- a/osu.Game.Tests/Visual/TestCasePlayerLoader.cs +++ b/osu.Game.Tests/Visual/TestCasePlayerLoader.cs @@ -21,7 +21,7 @@ namespace osu.Game.Tests.Visual public TestCasePlayerLoader() { - InputManager.Add(backgroundStack = new BackgroundScreenStack {RelativeSizeAxes = Axes.Both}); + InputManager.Add(backgroundStack = new BackgroundScreenStack { RelativeSizeAxes = Axes.Both }); InputManager.Add(stack = new ScreenStack { RelativeSizeAxes = Axes.Both }); } diff --git a/osu.Game/Graphics/Containers/UserDimContainer.cs b/osu.Game/Graphics/Containers/UserDimContainer.cs index 5aa0cad148..6e3b9c0d79 100644 --- a/osu.Game/Graphics/Containers/UserDimContainer.cs +++ b/osu.Game/Graphics/Containers/UserDimContainer.cs @@ -57,8 +57,8 @@ namespace osu.Game.Graphics.Containers { DimLevel = config.GetBindable(OsuSetting.DimLevel); ShowStoryboard = config.GetBindable(OsuSetting.ShowStoryboard); - EnableUserDim.ValueChanged += _ => updateBackgroundDim(); - DimLevel.ValueChanged += _ => updateBackgroundDim(); + EnableUserDim.ValueChanged += _ => updateBackgroundDim(); + DimLevel.ValueChanged += _ => updateBackgroundDim(); ShowStoryboard.ValueChanged += _ => updateBackgroundDim(); StoryboardReplacesBackground.ValueChanged += _ => updateBackgroundDim(); } diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs index 382c3f57ba..5ccff7b93b 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs @@ -48,6 +48,7 @@ namespace osu.Game.Screens.Backgrounds Background.FadeOut(250); Background.Expire(); } + b.Depth = newDepth; FadeContainer.Add(Background = b); Background.BlurSigma = BlurTarget; diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index e358188fe9..5c9acade7b 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -158,9 +158,12 @@ namespace osu.Game.Screens.Play protected override bool OnHover(HoverEvent e) { // restore our screen defaults - InitializeBackgroundElements(); if (this.IsCurrentScreen()) + { + InitializeBackgroundElements(); Background.EnableUserDim.Value = false; + } + return base.OnHover(e); }