mirror of
https://github.com/ppy/osu
synced 2025-03-01 17:11:12 +00:00
Simplify logic
This commit is contained in:
parent
2518d16a77
commit
fcb197f7b6
@ -4,6 +4,7 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
|
using osu.Framework.Graphics.Transforms;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.Backgrounds;
|
using osu.Game.Graphics.Backgrounds;
|
||||||
@ -19,10 +20,7 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
|
|
||||||
public WorkingBeatmap Beatmap
|
public WorkingBeatmap Beatmap
|
||||||
{
|
{
|
||||||
get
|
get { return beatmap; }
|
||||||
{
|
|
||||||
return beatmap;
|
|
||||||
}
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (beatmap == value && beatmap != null)
|
if (beatmap == value && beatmap != null)
|
||||||
@ -56,11 +54,8 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
Beatmap = beatmap;
|
Beatmap = beatmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None)
|
public TransformSequence<Background> BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None)
|
||||||
{
|
=> background?.BlurTo(blurTarget = sigma, duration, easing);
|
||||||
background?.BlurTo(sigma, duration, easing);
|
|
||||||
blurTarget = sigma;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Equals(BackgroundScreen other)
|
public override bool Equals(BackgroundScreen other)
|
||||||
{
|
{
|
||||||
|
@ -24,10 +24,10 @@ using osu.Game.Rulesets.Scoring;
|
|||||||
using osu.Game.Screens.Ranking;
|
using osu.Game.Screens.Ranking;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Screens.Play.BreaksOverlay;
|
using osu.Game.Screens.Play.BreaksOverlay;
|
||||||
using osu.Game.Storyboards.Drawables;
|
using osu.Game.Storyboards.Drawables;
|
||||||
using OpenTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
@ -378,8 +378,9 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private void updateBackgroundElements()
|
private void updateBackgroundElements()
|
||||||
{
|
{
|
||||||
|
const float duration = 800;
|
||||||
|
|
||||||
var opacity = 1 - (float)dimLevel;
|
var opacity = 1 - (float)dimLevel;
|
||||||
var blur = new Vector2((float)blurLevel.Value * 25);
|
|
||||||
|
|
||||||
if (showStoryboard && storyboard == null)
|
if (showStoryboard && storyboard == null)
|
||||||
initializeStoryboard(true);
|
initializeStoryboard(true);
|
||||||
@ -387,11 +388,13 @@ namespace osu.Game.Screens.Play
|
|||||||
var beatmap = Beatmap.Value;
|
var beatmap = Beatmap.Value;
|
||||||
var storyboardVisible = showStoryboard && beatmap.Storyboard.HasDrawable;
|
var storyboardVisible = showStoryboard && beatmap.Storyboard.HasDrawable;
|
||||||
|
|
||||||
storyboardContainer.FadeColour(new Color4(opacity, opacity, opacity, 1), 800);
|
storyboardContainer
|
||||||
storyboardContainer.FadeTo(storyboardVisible && opacity > 0 ? 1 : 0, 800, Easing.OutQuint);
|
.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)?
|
||||||
(Background as BackgroundScreenBeatmap)?.BlurTo(blur, 800, Easing.OutQuint);
|
.BlurTo(new Vector2((float)blurLevel.Value * 25), duration, Easing.OutQuint)?
|
||||||
|
.FadeTo(!storyboardVisible || beatmap.Background == null ? opacity : 0, duration, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fadeOut()
|
private void fadeOut()
|
||||||
|
Loading…
Reference in New Issue
Block a user