2021-06-02 15:50:58 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2021-06-03 11:33:16 +08:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
2021-06-02 15:50:58 +08:00
|
|
|
using osu.Framework.Timing;
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Storyboards.Drawables;
|
|
|
|
|
|
|
|
namespace osu.Game.Graphics.Backgrounds
|
|
|
|
{
|
|
|
|
public class BeatmapBackgroundWithStoryboard : BeatmapBackground
|
|
|
|
{
|
|
|
|
public BeatmapBackgroundWithStoryboard(WorkingBeatmap beatmap, string fallbackTextureName = "Backgrounds/bg1")
|
|
|
|
: base(beatmap, fallbackTextureName)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-06-03 11:33:16 +08:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
2021-06-02 15:50:58 +08:00
|
|
|
{
|
2021-06-03 11:33:16 +08:00
|
|
|
LoadComponentAsync(new DrawableStoryboard(Beatmap.Storyboard)
|
|
|
|
{
|
|
|
|
Clock = new InterpolatingFramedClock(Beatmap.Track),
|
|
|
|
},
|
|
|
|
loaded =>
|
|
|
|
{
|
|
|
|
AddInternal(loaded);
|
|
|
|
if (Beatmap.Storyboard.ReplacesBackground)
|
|
|
|
Sprite.FadeOut(300, Easing.OutQuint);
|
|
|
|
});
|
2021-06-02 15:50:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|