2019-01-24 08:43:03 +00: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.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Storyboards.Drawables
|
|
|
|
|
{
|
|
|
|
|
public class DrawableStoryboardLayer : Container
|
|
|
|
|
{
|
|
|
|
|
public StoryboardLayer Layer { get; private set; }
|
|
|
|
|
public bool Enabled;
|
|
|
|
|
|
|
|
|
|
public override bool IsPresent => Enabled && base.IsPresent;
|
|
|
|
|
|
|
|
|
|
public DrawableStoryboardLayer(StoryboardLayer layer)
|
|
|
|
|
{
|
|
|
|
|
Layer = layer;
|
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
Enabled = layer.EnabledWhenPassing;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
|
|
|
|
{
|
|
|
|
|
foreach (var element in Layer.Elements)
|
|
|
|
|
{
|
|
|
|
|
if (element.IsDrawable)
|
|
|
|
|
Add(element.CreateDrawable());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|