diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneBreakTracker.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneBreakTracker.cs index c010b2c80913..ba8f9971ba13 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneBreakTracker.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneBreakTracker.cs @@ -7,9 +7,13 @@ using System.Linq; using NUnit.Framework; using osu.Framework.Graphics; +using osu.Framework.Graphics.Shapes; using osu.Framework.Timing; using osu.Game.Beatmaps.Timing; +using osu.Game.Rulesets.Osu; +using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Play; +using osuTK.Graphics; namespace osu.Game.Tests.Visual.Gameplay { @@ -28,14 +32,19 @@ public partial class TestSceneBreakTracker : OsuTestScene public TestSceneBreakTracker() { - AddRange(new Drawable[] + Children = new Drawable[] { + new Box + { + Colour = Color4.White, + RelativeSizeAxes = Axes.Both, + }, breakTracker = new TestBreakTracker(), - breakOverlay = new BreakOverlay(true, null) + breakOverlay = new BreakOverlay(true, new ScoreProcessor(new OsuRuleset())) { ProcessCustomClock = false, } - }); + }; } protected override void Update() diff --git a/osu.Game/Screens/Play/Break/LetterboxOverlay.cs b/osu.Game/Screens/Play/Break/LetterboxOverlay.cs index c4e2dbf403ce..9308a02b0731 100644 --- a/osu.Game/Screens/Play/Break/LetterboxOverlay.cs +++ b/osu.Game/Screens/Play/Break/LetterboxOverlay.cs @@ -11,12 +11,12 @@ namespace osu.Game.Screens.Play.Break { public partial class LetterboxOverlay : CompositeDrawable { - private const int height = 350; - private static readonly Color4 transparent_black = new Color4(0, 0, 0, 0); public LetterboxOverlay() { + const int height = 150; + RelativeSizeAxes = Axes.Both; InternalChildren = new Drawable[] { diff --git a/osu.Game/Screens/Play/BreakOverlay.cs b/osu.Game/Screens/Play/BreakOverlay.cs index ece3105b4223..120d72a8e706 100644 --- a/osu.Game/Screens/Play/BreakOverlay.cs +++ b/osu.Game/Screens/Play/BreakOverlay.cs @@ -1,16 +1,17 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; using System.Collections.Generic; using osu.Framework.Bindables; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; using osu.Game.Beatmaps.Timing; +using osu.Game.Graphics; using osu.Game.Rulesets.Scoring; using osu.Game.Scoring; using osu.Game.Screens.Play.Break; @@ -29,7 +30,7 @@ public partial class BreakOverlay : Container private readonly Container fadeContainer; - private IReadOnlyList breaks; + private IReadOnlyList breaks = Array.Empty(); public IReadOnlyList Breaks { @@ -69,6 +70,30 @@ public BreakOverlay(bool letterboxing, ScoreProcessor scoreProcessor) Anchor = Anchor.Centre, Origin = Anchor.Centre, }, + new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Width = 80, + Height = 4, + Masking = true, + EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Shadow, + Radius = 260, + Colour = OsuColour.Gray(0.2f).Opacity(0.8f), + Roundness = 12 + }, + Children = new Drawable[] + { + new Box + { + Alpha = 0, + AlwaysPresent = true, + RelativeSizeAxes = Axes.Both, + }, + } + }, remainingTimeAdjustmentBox = new Container { Anchor = Anchor.Centre, @@ -111,11 +136,8 @@ protected override void LoadComplete() base.LoadComplete(); initializeBreaks(); - if (scoreProcessor != null) - { - info.AccuracyDisplay.Current.BindTo(scoreProcessor.Accuracy); - ((IBindable)info.GradeDisplay.Current).BindTo(scoreProcessor.Rank); - } + info.AccuracyDisplay.Current.BindTo(scoreProcessor.Accuracy); + ((IBindable)info.GradeDisplay.Current).BindTo(scoreProcessor.Rank); } protected override void Update() @@ -130,8 +152,6 @@ private void initializeBreaks() FinishTransforms(true); Scheduler.CancelDelayedTasks(); - if (breaks == null) return; // we need breaks. - foreach (var b in breaks) { if (!b.HasEffect) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 986c687960e9..91bd0a676bcb 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -446,14 +446,6 @@ private Drawable createOverlayComponents(IWorkingBeatmap working) Children = new[] { DimmableStoryboard.OverlayLayerContainer.CreateProxy(), - BreakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor) - { - Clock = DrawableRuleset.FrameStableClock, - ProcessCustomClock = false, - Breaks = working.Beatmap.Breaks - }, - // display the cursor above some HUD elements. - DrawableRuleset.Cursor?.CreateProxy() ?? new Container(), HUDOverlay = new HUDOverlay(DrawableRuleset, GameplayState.Mods, Configuration.AlwaysShowLeaderboard) { HoldToQuit = @@ -472,6 +464,14 @@ private Drawable createOverlayComponents(IWorkingBeatmap working) Anchor = Anchor.Centre, Origin = Anchor.Centre }, + BreakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor) + { + Clock = DrawableRuleset.FrameStableClock, + ProcessCustomClock = false, + Breaks = working.Beatmap.Breaks + }, + // display the cursor above some HUD elements. + DrawableRuleset.Cursor?.CreateProxy() ?? new Container(), skipIntroOverlay = new SkipOverlay(DrawableRuleset.GameplayStartTime) { RequestSkip = performUserRequestedSkip