mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 12:17:26 +08:00
Add overlay layer to storyboard definition
This commit is contained in:
parent
9415e45aea
commit
e211785704
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user