mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Apply beatmap settings when creating the DrawableStoryboard.
This commit is contained in:
parent
0996867112
commit
2d4616fd43
@ -231,12 +231,9 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
var beatmap = Beatmap.Value.Beatmap;
|
||||
|
||||
storyboard = beatmap.Storyboard.CreateDrawable();
|
||||
storyboard.Width = storyboard.Height * beatmap.Storyboard.AspectRatio(beatmap.BeatmapInfo);
|
||||
storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value);
|
||||
storyboard.Masking = true;
|
||||
|
||||
if (!beatmap.Storyboard.ReplacesBackground(beatmap.BeatmapInfo))
|
||||
storyboard.BackgroundTexture = Beatmap.Value.Background;
|
||||
storyboardContainer.Add(asyncLoad ? new AsyncLoadWrapper(storyboard) { RelativeSizeAxes = Axes.Both } : (Drawable)storyboard);
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,17 @@ namespace osu.Game.Storyboards
|
||||
public float AspectRatio(BeatmapInfo beatmapInfo)
|
||||
=> beatmapInfo.WidescreenStoryboard ? 16 / 9f : 4 / 3f;
|
||||
|
||||
public DrawableStoryboard CreateDrawable()
|
||||
=> new DrawableStoryboard(this);
|
||||
public DrawableStoryboard CreateDrawable(WorkingBeatmap working = null)
|
||||
{
|
||||
var drawable = new DrawableStoryboard(this);
|
||||
if (working != null)
|
||||
{
|
||||
var beatmapInfo = working.Beatmap.BeatmapInfo;
|
||||
drawable.Width = drawable.Height * AspectRatio(beatmapInfo);
|
||||
if (!ReplacesBackground(beatmapInfo))
|
||||
drawable.BackgroundTexture = working.Background;
|
||||
}
|
||||
return drawable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -81,13 +81,9 @@ namespace osu.Game.Tests.Visual
|
||||
var decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = true };
|
||||
storyboardContainer.Clock = decoupledClock;
|
||||
|
||||
storyboard = working.Beatmap.Storyboard.CreateDrawable();
|
||||
storyboard = working.Beatmap.Storyboard.CreateDrawable(beatmapBacking);
|
||||
storyboard.Passing = false;
|
||||
|
||||
var beatmap = working.Beatmap;
|
||||
if (!beatmap.Storyboard.ReplacesBackground(beatmap.BeatmapInfo))
|
||||
storyboard.BackgroundTexture = working.Background;
|
||||
|
||||
storyboardContainer.Add(storyboard);
|
||||
decoupledClock.ChangeSource(working.Track);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user