diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs index dd76ac5421..1ce84289b2 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs @@ -4,6 +4,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Textures; +using osu.Framework.Graphics.Transforms; using OpenTK; using osu.Game.Beatmaps; using osu.Game.Graphics.Backgrounds; @@ -19,10 +20,7 @@ public class BackgroundScreenBeatmap : BackgroundScreen public WorkingBeatmap Beatmap { - get - { - return beatmap; - } + get { return beatmap; } set { if (beatmap == value && beatmap != null) @@ -56,11 +54,8 @@ public BackgroundScreenBeatmap(WorkingBeatmap beatmap = null) Beatmap = beatmap; } - public void BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None) - { - background?.BlurTo(sigma, duration, easing); - blurTarget = sigma; - } + public TransformSequence BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None) + => background?.BlurTo(blurTarget = sigma, duration, easing); public override bool Equals(BackgroundScreen other) { diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index f700bf1a03..79ae8fca30 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -24,10 +24,10 @@ using osu.Game.Screens.Ranking; using osu.Framework.Audio.Sample; using osu.Game.Beatmaps; +using osu.Game.Graphics; using osu.Game.Online.API; using osu.Game.Screens.Play.BreaksOverlay; using osu.Game.Storyboards.Drawables; -using OpenTK.Graphics; namespace osu.Game.Screens.Play { @@ -378,8 +378,9 @@ protected override bool OnExiting(Screen next) private void updateBackgroundElements() { + const float duration = 800; + var opacity = 1 - (float)dimLevel; - var blur = new Vector2((float)blurLevel.Value * 25); if (showStoryboard && storyboard == null) initializeStoryboard(true); @@ -387,11 +388,13 @@ private void updateBackgroundElements() var beatmap = Beatmap.Value; var storyboardVisible = showStoryboard && beatmap.Storyboard.HasDrawable; - storyboardContainer.FadeColour(new Color4(opacity, opacity, opacity, 1), 800); - storyboardContainer.FadeTo(storyboardVisible && opacity > 0 ? 1 : 0, 800, Easing.OutQuint); + storyboardContainer + .FadeColour(OsuColour.Gray(opacity), duration, Easing.OutQuint) + .FadeTo(storyboardVisible && opacity > 0 ? 1 : 0, duration, Easing.OutQuint); - Background?.FadeTo(!storyboardVisible || beatmap.Background == null ? opacity : 0, 800, Easing.OutQuint); - (Background as BackgroundScreenBeatmap)?.BlurTo(blur, 800, Easing.OutQuint); + (Background as BackgroundScreenBeatmap)? + .BlurTo(new Vector2((float)blurLevel.Value * 25), duration, Easing.OutQuint)? + .FadeTo(!storyboardVisible || beatmap.Background == null ? opacity : 0, duration, Easing.OutQuint); } private void fadeOut()