new mania hold tail

This commit is contained in:
itsMapleLeaf 2023-01-23 01:01:45 -06:00
parent 292fd345bc
commit 338a14ff69
2 changed files with 45 additions and 35 deletions

View File

@ -3,13 +3,13 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.UI.Scrolling; using osu.Game.Rulesets.UI.Scrolling;
using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Skinning.Argon namespace osu.Game.Rulesets.Mania.Skinning.Argon
@ -19,45 +19,57 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>(); private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
private readonly IBindable<Color4> accentColour = new Bindable<Color4>(); private readonly IBindable<Color4> accentColour = new Bindable<Color4>();
private readonly Box colouredBox; private readonly Container spriteContainer;
private readonly Box shadow; private readonly Container shadeContainer;
private readonly Circle hitLine;
public ArgonHoldNoteTailPiece() public ArgonHoldNoteTailPiece()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = ArgonNotePiece.NOTE_HEIGHT;
// multiply by two so that the hold body extends up to the height of the note head accent
Height = ArgonNotePiece.NOTE_HEIGHT * ArgonNotePiece.NOTE_ACCENT_RATIO * 2;
CornerRadius = ArgonNotePiece.CORNER_RADIUS; CornerRadius = ArgonNotePiece.CORNER_RADIUS;
Masking = true; Masking = true;
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
shadow = new Box shadeContainer = new Container {
{
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}, Height = 0.5f,
new Container
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
RelativeSizeAxes = Axes.Both,
Height = 0.82f,
Masking = true,
CornerRadius = ArgonNotePiece.CORNER_RADIUS, CornerRadius = ArgonNotePiece.CORNER_RADIUS,
Masking = true,
Children = new Drawable[] {
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
Alpha = 0.2f,
},
},
},
spriteContainer = new Container {
RelativeSizeAxes = Axes.X,
Height = ArgonNotePiece.NOTE_HEIGHT,
Children = new Drawable[] Children = new Drawable[]
{ {
colouredBox = new Box new SpriteIcon
{ {
RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre,
} Origin = Anchor.Centre,
} Y = 4,
Icon = FontAwesome.Solid.AngleDown,
Size = new Vector2(20),
Scale = new Vector2(1, 0.7f),
Colour = Color4.White,
Alpha = 0.2f,
}, },
new Circle },
{ },
hitLine = new Circle {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = ArgonNotePiece.CORNER_RADIUS * 2, Height = ArgonNotePiece.CORNER_RADIUS * 2,
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
}, },
}; };
} }
@ -77,19 +89,17 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
private void onDirectionChanged(ValueChangedEvent<ScrollingDirection> direction) private void onDirectionChanged(ValueChangedEvent<ScrollingDirection> direction)
{ {
colouredBox.Anchor = colouredBox.Origin = direction.NewValue == ScrollingDirection.Up hitLine.Anchor = hitLine.Origin =
spriteContainer.Anchor = spriteContainer.Origin =
shadeContainer.Anchor = shadeContainer.Origin =
direction.NewValue == ScrollingDirection.Up
? Anchor.TopCentre ? Anchor.TopCentre
: Anchor.BottomCentre; : Anchor.BottomCentre;
} }
private void onAccentChanged(ValueChangedEvent<Color4> accent) private void onAccentChanged(ValueChangedEvent<Color4> accent)
{ {
colouredBox.Colour = ColourInfo.GradientVertical( hitLine.Colour = accent.NewValue;
accent.NewValue,
accent.NewValue.Darken(0.1f)
);
shadow.Colour = accent.NewValue.Darken(0.5f);
} }
} }
} }

View File

@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
internal partial class ArgonNotePiece : CompositeDrawable internal partial class ArgonNotePiece : CompositeDrawable
{ {
public const float NOTE_HEIGHT = 42; public const float NOTE_HEIGHT = 42;
public const float NOTE_ACCENT_RATIO = 0.82f;
public const float CORNER_RADIUS = 3.4f; public const float CORNER_RADIUS = 3.4f;
private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>(); private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
@ -47,7 +47,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Height = 0.82f, Height = NOTE_ACCENT_RATIO,
Masking = true, Masking = true,
CornerRadius = CORNER_RADIUS, CornerRadius = CORNER_RADIUS,
Children = new Drawable[] Children = new Drawable[]