mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 11:12:54 +08:00
Add triangles to ModSelectColumn
This commit is contained in:
parent
455fb7789c
commit
a84f20bf32
@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
@ -27,7 +28,12 @@ namespace osu.Game.Overlays.Mods
|
||||
public Color4 AccentColour
|
||||
{
|
||||
get => headerBackground.Colour;
|
||||
set => headerBackground.Colour = value;
|
||||
set
|
||||
{
|
||||
headerBackground.Colour = value;
|
||||
var hsv = new Colour4(value.R, value.G, value.B, 1f).ToHSV();
|
||||
triangles.Colour = ColourInfo.GradientVertical(Colour4.FromHSV(hsv.X, hsv.Y + 0.2f, hsv.Z - 0.1f), value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -44,6 +50,7 @@ namespace osu.Game.Overlays.Mods
|
||||
private readonly Box headerBackground;
|
||||
private readonly Container contentContainer;
|
||||
private readonly Box contentBackground;
|
||||
private readonly TrianglesV2 triangles;
|
||||
|
||||
private const float header_height = 42;
|
||||
|
||||
@ -73,6 +80,16 @@ namespace osu.Game.Overlays.Mods
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = header_height + ModSelectPanel.CORNER_RADIUS
|
||||
},
|
||||
triangles = new TrianglesV2
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Width = 1.1f,
|
||||
Height = header_height,
|
||||
Shear = new Vector2(-ShearedOverlayContainer.SHEAR, 0),
|
||||
Masking = true
|
||||
},
|
||||
headerText = new OsuTextFlowContainer(t =>
|
||||
{
|
||||
t.Font = OsuFont.TorusAlternate.With(size: 17);
|
||||
|
Loading…
Reference in New Issue
Block a user