mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 09:02:57 +08:00
Merge pull request #8509 from bdach/fix-widescreen-storyboards
Support widescreen per-layer storyboard masking
This commit is contained in:
commit
f2416f15a3
@ -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,
|
||||||
});
|
});
|
||||||
|
@ -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,17 +23,34 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
private class LayerElementContainer : LifetimeManagementContainer
|
||||||
private void load(CancellationToken? cancellationToken)
|
|
||||||
{
|
{
|
||||||
foreach (var element in Layer.Elements)
|
private readonly StoryboardLayer storyboardLayer;
|
||||||
{
|
|
||||||
cancellationToken?.ThrowIfCancellationRequested();
|
|
||||||
|
|
||||||
if (element.IsDrawable)
|
public LayerElementContainer(StoryboardLayer layer)
|
||||||
AddInternal(element.CreateDrawable());
|
{
|
||||||
|
storyboardLayer = layer;
|
||||||
|
|
||||||
|
Width = 640;
|
||||||
|
Height = 480;
|
||||||
|
Anchor = Anchor.Centre;
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(CancellationToken? cancellationToken)
|
||||||
|
{
|
||||||
|
foreach (var element in storyboardLayer.Elements)
|
||||||
|
{
|
||||||
|
cancellationToken?.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
if (element.IsDrawable)
|
||||||
|
AddInternal(element.CreateDrawable());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user