From 5150c5a64369ead0388136bfee902ffe71983c04 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 26 Sep 2023 16:58:50 +0900 Subject: [PATCH 1/2] Adjust osu!mania "major" barlines to be less visually distracting Applies to both "triangles" and "argon" skins. --- .../Skinning/Default/DefaultBarLine.cs | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Default/DefaultBarLine.cs b/osu.Game.Rulesets.Mania/Skinning/Default/DefaultBarLine.cs index cd85901a65..806b9e0f93 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Default/DefaultBarLine.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Default/DefaultBarLine.cs @@ -4,6 +4,7 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets.Mania.Objects.Drawables; @@ -33,25 +34,28 @@ namespace osu.Game.Rulesets.Mania.Skinning.Default RelativeSizeAxes = Axes.Both, }); - Vector2 size = new Vector2(22, 6); - const float line_offset = 4; + const float major_extension = 10; - AddInternal(leftAnchor = new Circle + AddInternal(leftAnchor = new Box { Name = "Left anchor", + Blending = BlendingParameters.Additive, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreRight, - Size = size, - X = -line_offset, + Width = major_extension, + RelativeSizeAxes = Axes.Y, + Colour = ColourInfo.GradientHorizontal(Colour4.Transparent, Colour4.White), }); - AddInternal(rightAnchor = new Circle + AddInternal(rightAnchor = new Box { Name = "Right anchor", + Blending = BlendingParameters.Additive, Anchor = Anchor.CentreRight, Origin = Anchor.CentreLeft, - Size = size, - X = line_offset, + Width = major_extension, + RelativeSizeAxes = Axes.Y, + Colour = ColourInfo.GradientHorizontal(Colour4.White, Colour4.Transparent), }); major = ((DrawableBarLine)drawableHitObject).Major.GetBoundCopy(); @@ -66,7 +70,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Default private void updateMajor(ValueChangedEvent major) { mainLine.Alpha = major.NewValue ? 0.5f : 0.2f; - leftAnchor.Alpha = rightAnchor.Alpha = major.NewValue ? 1 : 0; + leftAnchor.Alpha = rightAnchor.Alpha = major.NewValue ? mainLine.Alpha * 0.3f : 0; } } } From 9949480ccd8d3ecca504cf58dfb2aabe8dbdd441 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 26 Sep 2023 17:06:51 +0900 Subject: [PATCH 2/2] Add minor edge smoothing to fix flickering of barlines In most cases. Closes https://github.com/ppy/osu/issues/15184. --- osu.Game.Rulesets.Mania/Skinning/Default/DefaultBarLine.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Skinning/Default/DefaultBarLine.cs b/osu.Game.Rulesets.Mania/Skinning/Default/DefaultBarLine.cs index 806b9e0f93..ef75e9df11 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Default/DefaultBarLine.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Default/DefaultBarLine.cs @@ -26,9 +26,13 @@ namespace osu.Game.Rulesets.Mania.Skinning.Default { RelativeSizeAxes = Axes.Both; + // Avoid flickering due to no anti-aliasing of boxes by default. + var edgeSmoothness = new Vector2(0.3f); + AddInternal(mainLine = new Box { Name = "Bar line", + EdgeSmoothness = edgeSmoothness, Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.Both, @@ -39,6 +43,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Default AddInternal(leftAnchor = new Box { Name = "Left anchor", + EdgeSmoothness = edgeSmoothness, Blending = BlendingParameters.Additive, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreRight, @@ -50,6 +55,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Default AddInternal(rightAnchor = new Box { Name = "Right anchor", + EdgeSmoothness = edgeSmoothness, Blending = BlendingParameters.Additive, Anchor = Anchor.CentreRight, Origin = Anchor.CentreLeft,