1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 15:03:10 +08:00

Improve visibility of wedge shading in test scene and fix an issue with excessive roundness on said shadow.

This commit is contained in:
mk56-spn 2023-02-21 16:07:26 +01:00
parent 09cb6ca3a7
commit 299023fce0
2 changed files with 23 additions and 11 deletions

View File

@ -8,6 +8,7 @@ using osu.Framework.Allocation;
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.Framework.Testing;
using osu.Game.Beatmaps;
@ -37,12 +38,25 @@ namespace osu.Game.Tests.Visual.SongSelect
{
base.LoadComplete();
Add(infoWedge = new TestBeatmapInfoWedgeV2
AddRange(new Drawable[]
{
// This exists only to make the wedge more visible in the test scene
new Box
{
Y = -20,
Colour = Colour4.Cornsilk.Darken(0.2f),
Height = BeatmapInfoWedgeV2.WEDGE_HEIGHT + 40,
Width = 0.65f,
RelativeSizeAxes = Axes.X,
Margin = new MarginPadding { Top = 20, Left = -10 }
},
infoWedge = new TestBeatmapInfoWedgeV2
{
State = { Value = Visibility.Visible },
Width = 0.6f,
RelativeSizeAxes = Axes.X,
Margin = new MarginPadding { Top = 20, Left = -10 }
},
});
AddSliderStep("change star difficulty", 0, 11.9, 5.55, v =>
@ -200,7 +214,6 @@ namespace osu.Game.Tests.Visual.SongSelect
private partial class TestBeatmapInfoWedgeV2 : BeatmapInfoWedgeV2
{
public new Container? DisplayedContent => base.DisplayedContent;
public new WedgeInfoText? Info => base.Info;
}

View File

@ -25,8 +25,8 @@ namespace osu.Game.Screens.Select
{
public partial class BeatmapInfoWedgeV2 : VisibilityContainer
{
public const float WEDGE_HEIGHT = 120;
private const float shear_width = 21;
private const float wedge_height = 120;
private const float transition_duration = 250;
private const float corner_radius = 10;
private const float colour_bar_width = 30;
@ -34,7 +34,7 @@ namespace osu.Game.Screens.Select
/// Todo: move this const out to song select when more new design elements are implemented for the beatmap details area, since it applies to text alignment of various elements
private const float text_margin = 62;
private static readonly Vector2 wedged_container_shear = new Vector2(shear_width / wedge_height, 0);
private static readonly Vector2 wedged_container_shear = new Vector2(shear_width / WEDGE_HEIGHT, 0);
[Resolved]
private IBindable<RulesetInfo> ruleset { get; set; } = null!;
@ -52,7 +52,7 @@ namespace osu.Game.Screens.Select
public BeatmapInfoWedgeV2()
{
Height = wedge_height;
Height = WEDGE_HEIGHT;
Shear = wedged_container_shear;
Masking = true;
EdgeEffect = new EdgeEffectParameters
@ -60,7 +60,6 @@ namespace osu.Game.Screens.Select
Colour = Colour4.Black.Opacity(.25f),
Type = EdgeEffectType.Shadow,
Radius = corner_radius,
Roundness = corner_radius
};
CornerRadius = corner_radius;
@ -95,7 +94,7 @@ namespace osu.Game.Screens.Select
Width = colour_bar_width,
Child = starCounter = new StarCounter
{
Rotation = (float)(Math.Atan(shear_width / wedge_height) * (180 / Math.PI)),
Rotation = (float)(Math.Atan(shear_width / WEDGE_HEIGHT) * (180 / Math.PI)),
Colour = Colour4.Transparent,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,