1
0
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:
Bartłomiej Dach
2020-05-19 19:47:01 +02:00
Unverified
parent 2398f2e537
commit ce4301c5b8
2 changed files with 14 additions and 2 deletions
+13 -2
View File
@@ -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());
}
}
}
+1
View File
@@ -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,