mirror of
https://github.com/ppy/osu.git
synced 2026-05-29 23:51:01 +08:00
Add overlay layer to player by proxying
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Storyboards;
|
||||
using osu.Game.Storyboards.Drawables;
|
||||
@@ -13,6 +14,8 @@ namespace osu.Game.Screens.Play
|
||||
/// </summary>
|
||||
public class DimmableStoryboard : UserDimContainer
|
||||
{
|
||||
public Container OverlayLayerContainer;
|
||||
|
||||
private readonly Storyboard storyboard;
|
||||
private DrawableStoryboard drawableStoryboard;
|
||||
|
||||
@@ -24,6 +27,8 @@ namespace osu.Game.Screens.Play
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Add(OverlayLayerContainer = new Container());
|
||||
|
||||
initializeStoryboard(false);
|
||||
}
|
||||
|
||||
@@ -46,9 +51,15 @@ namespace osu.Game.Screens.Play
|
||||
drawableStoryboard = storyboard.CreateDrawable();
|
||||
|
||||
if (async)
|
||||
LoadComponentAsync(drawableStoryboard, Add);
|
||||
LoadComponentAsync(drawableStoryboard, onStoryboardCreated);
|
||||
else
|
||||
Add(drawableStoryboard);
|
||||
onStoryboardCreated(drawableStoryboard);
|
||||
}
|
||||
|
||||
private void onStoryboardCreated(DrawableStoryboard storyboard)
|
||||
{
|
||||
Add(storyboard);
|
||||
OverlayLayerContainer.Add(storyboard.OverlayLayer.CreateProxy());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,6 +264,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
target.AddRange(new[]
|
||||
{
|
||||
DimmableStoryboard.OverlayLayerContainer.CreateProxy(),
|
||||
BreakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
|
||||
{
|
||||
Clock = DrawableRuleset.FrameStableClock,
|
||||
|
||||
Reference in New Issue
Block a user