Actually implement blurring fix

This commit is contained in:
David Zhao
2019-02-28 16:51:17 +09:00
parent dbe5887f7e
commit 69b1c76dce
5 changed files with 21 additions and 11 deletions

View File

@ -162,6 +162,7 @@ namespace osu.Game.Tests.Visual
AddUntilStep(() => AddUntilStep(() =>
{ {
if (songSelect.IsCurrentScreen()) return true; if (songSelect.IsCurrentScreen()) return true;
songSelect.MakeCurrent(); songSelect.MakeCurrent();
return false; return false;
}, "Wait for song select is current"); }, "Wait for song select is current");
@ -264,13 +265,16 @@ namespace osu.Game.Tests.Visual
{ {
createSongSelect(); createSongSelect();
AddStep("Start player loader", () => { songSelect.Push(playerLoader = new DimAccessiblePlayerLoader(player = new DimAccessiblePlayer AddStep("Start player loader", () =>
{
songSelect.Push(playerLoader = new DimAccessiblePlayerLoader(player = new DimAccessiblePlayer
{ {
AllowLeadIn = false, AllowLeadIn = false,
AllowResults = false, AllowResults = false,
AllowPause = allowPause, AllowPause = allowPause,
Ready = true, Ready = true,
})); }); }));
});
AddUntilStep(() => playerLoader.IsLoaded, "Wait for Player Loader to load"); AddUntilStep(() => playerLoader.IsLoaded, "Wait for Player Loader to load");
AddStep("Move mouse to center of screen", () => InputManager.MoveMouseTo(playerLoader.ScreenPos)); AddStep("Move mouse to center of screen", () => InputManager.MoveMouseTo(playerLoader.ScreenPos));
AddUntilStep(() => player.IsLoaded, "Wait for player to load"); AddUntilStep(() => player.IsLoaded, "Wait for player to load");
@ -279,7 +283,7 @@ namespace osu.Game.Tests.Visual
private void createSongSelect() private void createSongSelect()
{ {
AddStep("Create new screen stack", () => Child = screenStackContainer = new ScreenStackCacheContainer { RelativeSizeAxes = Axes.Both }); 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())); AddStep("Create new song select", () => screenStackContainer.ScreenStack.Push(songSelect = new DummySongSelect()));
AddUntilStep(() => songSelect.IsLoaded, "Wait for song select to load"); AddUntilStep(() => songSelect.IsLoaded, "Wait for song select to load");
AddStep("Set user settings", () => AddStep("Set user settings", () =>
@ -355,6 +359,7 @@ namespace osu.Game.Tests.Visual
} }
public UserDimContainer CurrentStoryboardContainer => StoryboardContainer; public UserDimContainer CurrentStoryboardContainer => StoryboardContainer;
// Whether or not the player should be allowed to load. // Whether or not the player should be allowed to load.
public bool Ready; public bool Ready;
@ -430,6 +435,7 @@ namespace osu.Game.Tests.Visual
: base(isStoryboard) : base(isStoryboard)
{ {
} }
public Color4 CurrentColour => DimContainer.Colour; public Color4 CurrentColour => DimContainer.Colour;
public float CurrentAlpha => DimContainer.Alpha; public float CurrentAlpha => DimContainer.Alpha;
} }

View File

@ -21,7 +21,7 @@ namespace osu.Game.Tests.Visual
public TestCasePlayerLoader() 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 }); InputManager.Add(stack = new ScreenStack { RelativeSizeAxes = Axes.Both });
} }

View File

@ -48,6 +48,7 @@ namespace osu.Game.Screens.Backgrounds
Background.FadeOut(250); Background.FadeOut(250);
Background.Expire(); Background.Expire();
} }
b.Depth = newDepth; b.Depth = newDepth;
FadeContainer.Add(Background = b); FadeContainer.Add(Background = b);
Background.BlurSigma = BlurTarget; Background.BlurSigma = BlurTarget;

View File

@ -158,9 +158,12 @@ namespace osu.Game.Screens.Play
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)
{ {
// restore our screen defaults // restore our screen defaults
InitializeBackgroundElements();
if (this.IsCurrentScreen()) if (this.IsCurrentScreen())
{
InitializeBackgroundElements();
Background.EnableUserDim.Value = false; Background.EnableUserDim.Value = false;
}
return base.OnHover(e); return base.OnHover(e);
} }