From 9e7f9c86cabfae4d82499df1d384e3d119f8d7f3 Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Mon, 30 Jan 2023 11:14:29 -0600 Subject: [PATCH] flat hold tail --- .../Skinning/Argon/ArgonHoldNoteTailPiece.cs | 71 +------------------ 1 file changed, 2 insertions(+), 69 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs index b2cccfac26..74b4a7b661 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldNoteTailPiece.cs @@ -1,84 +1,17 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Framework.Allocation; -using osu.Framework.Bindables; -using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; -using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.UI.Scrolling; -using osuTK.Graphics; namespace osu.Game.Rulesets.Mania.Skinning.Argon { internal partial class ArgonHoldNoteTailPiece : CompositeDrawable { - private readonly IBindable direction = new Bindable(); - private readonly IBindable accentColour = new Bindable(); - - private readonly Container shadeContainer; - private readonly Circle hitLine; - public ArgonHoldNoteTailPiece() { - RelativeSizeAxes = Axes.X; + // holds end at the middle of the tail, + // so we do * 2 pull up the hold body to be the height of a note Height = ArgonNotePiece.NOTE_HEIGHT * 2; - - CornerRadius = ArgonNotePiece.CORNER_RADIUS; - Masking = true; - - InternalChildren = new Drawable[] - { - shadeContainer = new Container - { - RelativeSizeAxes = Axes.Both, - Height = 0.5f, - CornerRadius = ArgonNotePiece.CORNER_RADIUS, - Masking = true, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - Alpha = 0.4f, - }, - }, - }, - hitLine = new Circle - { - RelativeSizeAxes = Axes.X, - Height = ArgonNotePiece.CORNER_RADIUS * 2, - }, - }; - } - - [BackgroundDependencyLoader(true)] - private void load(IScrollingInfo scrollingInfo, DrawableHitObject? drawableObject) - { - direction.BindTo(scrollingInfo.Direction); - direction.BindValueChanged(onDirectionChanged, true); - - if (drawableObject != null) - { - accentColour.BindTo(drawableObject.AccentColour); - accentColour.BindValueChanged(onAccentChanged, true); - } - } - - private void onDirectionChanged(ValueChangedEvent direction) - { - hitLine.Anchor = hitLine.Origin = - shadeContainer.Anchor = shadeContainer.Origin = - direction.NewValue == ScrollingDirection.Up - ? Anchor.TopCentre - : Anchor.BottomCentre; - } - - private void onAccentChanged(ValueChangedEvent accent) - { - hitLine.Colour = accent.NewValue; } } }