1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Add overlay layer to storyboard definition

This commit is contained in:
Bartłomiej Dach 2020-05-18 21:01:13 +02:00
parent 9415e45aea
commit e211785704

View File

@ -19,19 +19,26 @@ namespace osu.Game.Storyboards
public double FirstEventTime => Layers.Min(l => l.Elements.FirstOrDefault()?.StartTime ?? 0);
/// <summary>
/// Depth of the currently front-most storyboard layer, excluding the overlay layer.
/// </summary>
private int minimumLayerDepth;
public Storyboard()
{
layers.Add("Video", new StoryboardLayer("Video", 4, false));
layers.Add("Background", new StoryboardLayer("Background", 3));
layers.Add("Fail", new StoryboardLayer("Fail", 2) { VisibleWhenPassing = false, });
layers.Add("Pass", new StoryboardLayer("Pass", 1) { VisibleWhenFailing = false, });
layers.Add("Foreground", new StoryboardLayer("Foreground", 0));
layers.Add("Foreground", new StoryboardLayer("Foreground", minimumLayerDepth = 0));
layers.Add("Overlay", new StoryboardLayer("Overlay", int.MinValue));
}
public StoryboardLayer GetLayer(string name)
{
if (!layers.TryGetValue(name, out var layer))
layers[name] = layer = new StoryboardLayer(name, layers.Values.Min(l => l.Depth) - 1);
layers[name] = layer = new StoryboardLayer(name, --minimumLayerDepth);
return layer;
}