Handle all blurring directly from background

This commit is contained in:
David Zhao
2019-03-14 14:02:46 +09:00
parent de6d8fc637
commit 8714902349
5 changed files with 46 additions and 23 deletions

View File

@ -8,7 +8,6 @@ using osu.Framework.Graphics.Textures;
using osu.Game.Beatmaps;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Containers;
using osuTK;
namespace osu.Game.Screens.Backgrounds
{
@ -23,6 +22,8 @@ namespace osu.Game.Screens.Backgrounds
public readonly Bindable<bool> StoryboardReplacesBackground = new Bindable<bool>();
public readonly Bindable<float> AddedBlur = new Bindable<float>();
private readonly VisualSettingsContainer fadeContainer;
protected virtual VisualSettingsContainer CreateFadeContainer() => new VisualSettingsContainer { RelativeSizeAxes = Axes.Both };
@ -52,6 +53,7 @@ namespace osu.Game.Screens.Backgrounds
b.Depth = newDepth;
fadeContainer.Add(Background = b);
fadeContainer.UpdateVisuals();
Background.BlurSigma = BlurTarget;
StoryboardReplacesBackground.BindTo(fadeContainer.StoryboardReplacesBackground);
}));
@ -64,6 +66,7 @@ namespace osu.Game.Screens.Backgrounds
Beatmap = beatmap;
InternalChild = fadeContainer = CreateFadeContainer();
fadeContainer.EnableVisualSettings.BindTo(EnableVisualSettings);
fadeContainer.AddedBlur.BindTo(AddedBlur);
}
public override bool Equals(BackgroundScreen other)