1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-09 03:02:56 +08:00

Merge pull request #8509 from bdach/fix-widescreen-storyboards

Support widescreen per-layer storyboard masking
This commit is contained in:
Dean Herbert 2020-03-31 17:47:42 +09:00 committed by GitHub
commit f2416f15a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 9 deletions

View File

@ -50,7 +50,7 @@ namespace osu.Game.Storyboards.Drawables
AddInternal(Content = new Container<DrawableStoryboardLayer> AddInternal(Content = new Container<DrawableStoryboardLayer>
{ {
Size = new Vector2(640, 480), RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
}); });

View File

@ -8,7 +8,7 @@ using osu.Framework.Graphics.Containers;
namespace osu.Game.Storyboards.Drawables namespace osu.Game.Storyboards.Drawables
{ {
public class DrawableStoryboardLayer : LifetimeManagementContainer public class DrawableStoryboardLayer : CompositeDrawable
{ {
public StoryboardLayer Layer { get; } public StoryboardLayer Layer { get; }
public bool Enabled; public bool Enabled;
@ -23,12 +23,28 @@ namespace osu.Game.Storyboards.Drawables
Origin = Anchor.Centre; Origin = Anchor.Centre;
Enabled = layer.VisibleWhenPassing; Enabled = layer.VisibleWhenPassing;
Masking = layer.Masking; Masking = layer.Masking;
InternalChild = new LayerElementContainer(layer);
}
private class LayerElementContainer : LifetimeManagementContainer
{
private readonly StoryboardLayer storyboardLayer;
public LayerElementContainer(StoryboardLayer layer)
{
storyboardLayer = layer;
Width = 640;
Height = 480;
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(CancellationToken? cancellationToken) private void load(CancellationToken? cancellationToken)
{ {
foreach (var element in Layer.Elements) foreach (var element in storyboardLayer.Elements)
{ {
cancellationToken?.ThrowIfCancellationRequested(); cancellationToken?.ThrowIfCancellationRequested();
@ -37,4 +53,5 @@ namespace osu.Game.Storyboards.Drawables
} }
} }
} }
}
} }