Tidy things up to make more sense

This commit is contained in:
Dean Herbert 2018-02-16 12:08:21 +09:00
parent f22f9b5de0
commit 9760f30ce9
3 changed files with 11 additions and 15 deletions

View File

@ -347,7 +347,7 @@ namespace osu.Game.Screens.Play
var beatmap = Beatmap.Value;
storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value);
storyboard = beatmap.Storyboard.CreateDrawable();
storyboard.Masking = true;
if (asyncLoad)
@ -369,10 +369,11 @@ namespace osu.Game.Screens.Play
var storyboardVisible = ShowStoryboard && beatmap.Storyboard.HasDrawable;
storyboardContainer?
.FadeColour(OsuColour.Gray(Opacity), Duration, Easing.OutQuint)
.FadeTo(storyboardVisible && Opacity > 0 ? 1 : 0, Duration, Easing.OutQuint);
.FadeColour(OsuColour.Gray(BackgroundOpacity), BACKGROUND_FADE_DURATION, Easing.OutQuint)
.FadeTo(storyboardVisible && BackgroundOpacity > 0 ? 1 : 0, BACKGROUND_FADE_DURATION, Easing.OutQuint);
Background?.FadeTo(!storyboardVisible || beatmap.Background == null ? Opacity : 0, Duration, Easing.OutQuint);
if (storyboardVisible && beatmap.Storyboard.ReplacesBackground)
Background?.FadeTo(0, BACKGROUND_FADE_DURATION, Easing.OutQuint);
}
}
}

View File

@ -263,13 +263,5 @@ namespace osu.Game.Screens.Play
};
}
}
protected override void UpdateBackgroundElements()
{
if (!IsCurrentScreen) return;
base.UpdateBackgroundElements();
Background?.FadeTo(Opacity, Duration, Easing.OutQuint);
}
}
}

View File

@ -13,10 +13,12 @@ namespace osu.Game.Screens.Play
public abstract class ScreenWithBeatmapBackground : OsuScreen
{
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
public override bool AllowBeatmapRulesetChange => false;
protected float Duration => 800;
protected float Opacity => 1 - (float)DimLevel;
protected const float BACKGROUND_FADE_DURATION = 800;
protected float BackgroundOpacity => 1 - (float)DimLevel;
#region User Settings
@ -52,7 +54,8 @@ namespace osu.Game.Screens.Play
{
if (!IsCurrentScreen) return;
(Background as BackgroundScreenBeatmap)?.BlurTo(new Vector2((float)BlurLevel.Value * 25), Duration, Easing.OutQuint);
Background?.FadeTo(BackgroundOpacity, BACKGROUND_FADE_DURATION, Easing.OutQuint);
(Background as BackgroundScreenBeatmap)?.BlurTo(new Vector2((float)BlurLevel.Value * 25), BACKGROUND_FADE_DURATION, Easing.OutQuint);
}
}
}