mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 08:03:52 +09:00
Tidy things up to make more sense
This commit is contained in:
@ -347,7 +347,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
var beatmap = Beatmap.Value;
|
var beatmap = Beatmap.Value;
|
||||||
|
|
||||||
storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value);
|
storyboard = beatmap.Storyboard.CreateDrawable();
|
||||||
storyboard.Masking = true;
|
storyboard.Masking = true;
|
||||||
|
|
||||||
if (asyncLoad)
|
if (asyncLoad)
|
||||||
@ -369,10 +369,11 @@ namespace osu.Game.Screens.Play
|
|||||||
var storyboardVisible = ShowStoryboard && beatmap.Storyboard.HasDrawable;
|
var storyboardVisible = ShowStoryboard && beatmap.Storyboard.HasDrawable;
|
||||||
|
|
||||||
storyboardContainer?
|
storyboardContainer?
|
||||||
.FadeColour(OsuColour.Gray(Opacity), Duration, Easing.OutQuint)
|
.FadeColour(OsuColour.Gray(BackgroundOpacity), BACKGROUND_FADE_DURATION, Easing.OutQuint)
|
||||||
.FadeTo(storyboardVisible && Opacity > 0 ? 1 : 0, 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -263,13 +263,5 @@ namespace osu.Game.Screens.Play
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateBackgroundElements()
|
|
||||||
{
|
|
||||||
if (!IsCurrentScreen) return;
|
|
||||||
|
|
||||||
base.UpdateBackgroundElements();
|
|
||||||
Background?.FadeTo(Opacity, Duration, Easing.OutQuint);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,12 @@ namespace osu.Game.Screens.Play
|
|||||||
public abstract class ScreenWithBeatmapBackground : OsuScreen
|
public abstract class ScreenWithBeatmapBackground : OsuScreen
|
||||||
{
|
{
|
||||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
|
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
|
||||||
|
|
||||||
public override bool AllowBeatmapRulesetChange => false;
|
public override bool AllowBeatmapRulesetChange => false;
|
||||||
|
|
||||||
protected float Duration => 800;
|
protected const float BACKGROUND_FADE_DURATION = 800;
|
||||||
protected float Opacity => 1 - (float)DimLevel;
|
|
||||||
|
protected float BackgroundOpacity => 1 - (float)DimLevel;
|
||||||
|
|
||||||
#region User Settings
|
#region User Settings
|
||||||
|
|
||||||
@ -52,7 +54,8 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
if (!IsCurrentScreen) return;
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user