1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-23 01:37:31 +08:00

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(() =>
{
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;
}

View File

@ -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 });
}

View File

@ -57,8 +57,8 @@ namespace osu.Game.Graphics.Containers
{
DimLevel = config.GetBindable<double>(OsuSetting.DimLevel);
ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
EnableUserDim.ValueChanged += _ => updateBackgroundDim();
DimLevel.ValueChanged += _ => updateBackgroundDim();
EnableUserDim.ValueChanged += _ => updateBackgroundDim();
DimLevel.ValueChanged += _ => updateBackgroundDim();
ShowStoryboard.ValueChanged += _ => updateBackgroundDim();
StoryboardReplacesBackground.ValueChanged += _ => updateBackgroundDim();
}

View File

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

View File

@ -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);
}