From c8389a8683a0e16d43c1e2eafe77e4f81fc26261 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 29 May 2025 20:12:32 +0900 Subject: [PATCH] Adjust panel selection glow and background --- osu.Game/Screens/SelectV2/Panel.cs | 16 ++++++++++------ .../Screens/SelectV2/PanelSetBackground.cs | 18 ++++++------------ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/osu.Game/Screens/SelectV2/Panel.cs b/osu.Game/Screens/SelectV2/Panel.cs index 6e3db2fabd..39808e0baf 100644 --- a/osu.Game/Screens/SelectV2/Panel.cs +++ b/osu.Game/Screens/SelectV2/Panel.cs @@ -94,8 +94,8 @@ namespace osu.Game.Screens.SelectV2 EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, - Offset = new Vector2(1f), - Radius = 10, + Hollow = true, + Radius = 2, }, Children = new Drawable[] { @@ -123,6 +123,8 @@ namespace osu.Game.Screens.SelectV2 { RelativeSizeAxes = Axes.Both, }, + // TODO: this is only used by beatmap panels and should NOT be in this class. + // it's wasting fill rate. backgroundAccentGradient = new Box { RelativeSizeAxes = Axes.Both, @@ -157,10 +159,9 @@ namespace osu.Game.Screens.SelectV2 selectionLayer = new Box { Alpha = 0, - Colour = ColourInfo.GradientHorizontal(colours.BlueDark.Opacity(0), colours.BlueDark.Opacity(0.6f)), - Blending = BlendingParameters.Additive, RelativeSizeAxes = Axes.Both, - Width = 0.3f, + Width = 0.6f, + Blending = BlendingParameters.Additive, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, }, @@ -202,6 +203,7 @@ namespace osu.Game.Screens.SelectV2 else selectionLayer.FadeOut(200, Easing.OutQuint); + updateEdgeEffect(); updateXOffset(); }, true); @@ -249,13 +251,15 @@ namespace osu.Game.Screens.SelectV2 backgroundAccentGradient.Colour = ColourInfo.GradientHorizontal(backgroundColour.Opacity(0.25f), backgroundColour.Opacity(0f)); backgroundBorder.Colour = backgroundColour; + selectionLayer.Colour = ColourInfo.GradientHorizontal(backgroundColour.Opacity(0), backgroundColour.Opacity(0.5f)); + updateEdgeEffect(animated: false); } private void updateEdgeEffect(bool animated = true) { var edgeEffectColour = accentColour ?? Color4Extensions.FromHex(@"4EBFFF"); - TopLevelContent.FadeEdgeEffectTo(Expanded.Value ? edgeEffectColour.Opacity(0.5f) : Color4.Black.Opacity(0.4f), animated ? DURATION : 0, Easing.OutQuint); + TopLevelContent.FadeEdgeEffectTo(Expanded.Value || Selected.Value ? edgeEffectColour.Opacity(0.8f) : Color4.Black.Opacity(0.4f), animated ? DURATION : 0, Easing.OutQuint); } private void updateXOffset() diff --git a/osu.Game/Screens/SelectV2/PanelSetBackground.cs b/osu.Game/Screens/SelectV2/PanelSetBackground.cs index 99dbf90556..dd07be0410 100644 --- a/osu.Game/Screens/SelectV2/PanelSetBackground.cs +++ b/osu.Game/Screens/SelectV2/PanelSetBackground.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; @@ -61,34 +62,27 @@ namespace osu.Game.Screens.SelectV2 Direction = FillDirection.Horizontal, // This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle Shear = new Vector2(0.8f, 0), - Alpha = 0.5f, Children = new[] { // The left half with no gradient applied new Box { RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, + Colour = Color4.Black.Opacity(0.5f), Width = 0.4f, }, - // Piecewise-linear gradient with 3 segments to make it appear smoother new Box { RelativeSizeAxes = Axes.Both, - Colour = ColourInfo.GradientHorizontal(Color4.Black, new Color4(0f, 0f, 0f, 0.9f)), - Width = 0.05f, - }, - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = ColourInfo.GradientHorizontal(new Color4(0f, 0f, 0f, 0.9f), new Color4(0f, 0f, 0f, 0.1f)), + Colour = ColourInfo.GradientHorizontal(Color4.Black.Opacity(0.5f), Color4.Black.Opacity(0.3f)), Width = 0.2f, }, new Box { RelativeSizeAxes = Axes.Both, - Colour = ColourInfo.GradientHorizontal(new Color4(0f, 0f, 0f, 0.1f), new Color4(0, 0, 0, 0)), - Width = 0.05f, + Colour = ColourInfo.GradientHorizontal(Color4.Black.Opacity(0.3f), Color4.Black.Opacity(0.2f)), + // Slightly more than 1.0 in total to account for shear. + Width = 0.45f, }, } },