mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 16:12:54 +08:00
Merge pull request #29615 from peppy/break-overlay-improvements
Add shadow around break overlay middle content to make sure it remains visible
This commit is contained in:
commit
321e509f11
@ -7,9 +7,13 @@ using System.Collections.Generic;
|
||||
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 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
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()
|
||||
|
@ -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[]
|
||||
{
|
||||
|
@ -1,16 +1,17 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private readonly Container fadeContainer;
|
||||
|
||||
private IReadOnlyList<BreakPeriod> breaks;
|
||||
private IReadOnlyList<BreakPeriod> breaks = Array.Empty<BreakPeriod>();
|
||||
|
||||
public IReadOnlyList<BreakPeriod> Breaks
|
||||
{
|
||||
@ -69,6 +70,30 @@ namespace osu.Game.Screens.Play
|
||||
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 @@ namespace osu.Game.Screens.Play
|
||||
base.LoadComplete();
|
||||
initializeBreaks();
|
||||
|
||||
if (scoreProcessor != null)
|
||||
{
|
||||
info.AccuracyDisplay.Current.BindTo(scoreProcessor.Accuracy);
|
||||
((IBindable<ScoreRank>)info.GradeDisplay.Current).BindTo(scoreProcessor.Rank);
|
||||
}
|
||||
info.AccuracyDisplay.Current.BindTo(scoreProcessor.Accuracy);
|
||||
((IBindable<ScoreRank>)info.GradeDisplay.Current).BindTo(scoreProcessor.Rank);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
@ -130,8 +152,6 @@ namespace osu.Game.Screens.Play
|
||||
FinishTransforms(true);
|
||||
Scheduler.CancelDelayedTasks();
|
||||
|
||||
if (breaks == null) return; // we need breaks.
|
||||
|
||||
foreach (var b in breaks)
|
||||
{
|
||||
if (!b.HasEffect)
|
||||
|
@ -446,14 +446,6 @@ namespace osu.Game.Screens.Play
|
||||
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 @@ namespace osu.Game.Screens.Play
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user