Preview visual settings at the “loading” screen

This commit is contained in:
TocoToucan 2018-02-09 00:06:24 +03:00
parent d437c1d7ec
commit a860dd7208
3 changed files with 14 additions and 6 deletions

View File

@ -262,10 +262,7 @@ protected override void OnEntering(Screen last)
if (!loadedSuccessfully)
return;
DimLevel.ValueChanged += _ => UpdateBackgroundElements();
BlurLevel.ValueChanged += _ => UpdateBackgroundElements();
ShowStoryboard.ValueChanged += _ => UpdateBackgroundElements();
UpdateBackgroundElements();
ConfigureBackgroundUpdate();
Content.Alpha = 0;
Content

View File

@ -46,6 +46,14 @@ private void load(AudioManager audio, OsuConfigManager config)
UserAudioOffset = config.GetBindable<double>(OsuSetting.AudioOffset);
}
protected void ConfigureBackgroundUpdate()
{
DimLevel.ValueChanged += _ => UpdateBackgroundElements();
BlurLevel.ValueChanged += _ => UpdateBackgroundElements();
ShowStoryboard.ValueChanged += _ => UpdateBackgroundElements();
UpdateBackgroundElements();
}
protected void UpdateBackgroundElements()
{
if (!IsCurrentScreen) return;
@ -60,7 +68,7 @@ protected void UpdateBackgroundElements()
var beatmap = Beatmap.Value;
var storyboardVisible = ShowStoryboard && beatmap.Storyboard.HasDrawable;
StoryboardContainer
StoryboardContainer?
.FadeColour(OsuColour.Gray(opacity), duration, Easing.OutQuint)
.FadeTo(storyboardVisible && opacity > 0 ? 1 : 0, duration, Easing.OutQuint);
@ -70,6 +78,9 @@ protected void UpdateBackgroundElements()
protected void InitializeStoryboard(bool asyncLoad)
{
if (StoryboardContainer == null)
return;
var beatmap = Beatmap.Value;
Storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value);

View File

@ -88,7 +88,7 @@ protected override void OnEntering(Screen last)
{
base.OnEntering(last);
Background.FadeTo(0.4f, 250);
ConfigureBackgroundUpdate();
Content.ScaleTo(0.7f);