prevent scaling container from creating a storyboard background

This commit is contained in:
Nathan Alo 2021-06-03 13:24:21 +08:00
parent a62dd7cca0
commit d00fb21188
2 changed files with 7 additions and 1 deletions

View File

@ -172,6 +172,8 @@ private void updateSize()
private class ScalingBackgroundScreen : BackgroundScreenDefault
{
protected override bool AllowStoryboardBackground => false;
public override void OnEntering(IScreen last)
{
this.FadeInFromZero(4000, Easing.OutQuint);

View File

@ -31,6 +31,8 @@ public class BackgroundScreenDefault : BackgroundScreen
[Resolved]
private IBindable<WorkingBeatmap> beatmap { get; set; }
protected virtual bool AllowStoryboardBackground => true;
public BackgroundScreenDefault(bool animateOnEnter = true)
: base(animateOnEnter)
{
@ -111,7 +113,9 @@ private Background createBackground()
break;
case BackgroundSource.BeatmapWithStoryboard:
newBackground = new BeatmapBackgroundWithStoryboard(beatmap.Value, backgroundName);
newBackground = AllowStoryboardBackground
? new BeatmapBackgroundWithStoryboard(beatmap.Value, backgroundName)
: new BeatmapBackground(beatmap.Value, backgroundName);
break;
default: