diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index a8efe5d2f8..ee371b61ca 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -11,6 +11,7 @@ using osu.Framework.Input; using OpenTK; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Mania.Judgements; +using osu.Framework.Extensions.IEnumerableExtensions; namespace osu.Game.Rulesets.Mania.Objects.Drawables { @@ -109,6 +110,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables return; base.AccentColour = value; + tickContainer.Children.ForEach(t => t.AccentColour = value); + bodyPiece.AccentColour = value; headNote.AccentColour = value; tailNote.AccentColour = value; diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs index 13fde29bc2..7a8f25e098 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs @@ -2,12 +2,12 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using OpenTK; using OpenTK.Graphics; -using OpenTK.Input; -using osu.Framework.Configuration; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Objects.Drawables; @@ -18,19 +18,55 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables public Func HoldStartTime; public Func IsHolding; + private readonly Container glowContainer; + public DrawableHoldNoteTick(HoldNoteTick hitObject) : base(hitObject, null) { + Anchor = Anchor.TopCentre; + Origin = Anchor.TopCentre; + RelativeSizeAxes = Axes.X; + Size = new Vector2(1); Children = new[] { - new Box + glowContainer = new CircularContainer { - RelativeSizeAxes = Axes.X, - Height = 1 + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.Both, + Masking = true, + Children = new[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + AlwaysPresent = true + } + } } }; + + AccentColour = Color4.White; + } + + public override Color4 AccentColour + { + get { return base.AccentColour; } + set + { + base.AccentColour = value; + + glowContainer.EdgeEffect = new EdgeEffect + { + Type = EdgeEffectType.Glow, + Radius = 2f, + Roundness = 15f, + Colour = value.Opacity(0.3f) + }; + } } protected override ManiaJudgement CreateJudgement() => new HoldNoteTickJudgement(); @@ -56,7 +92,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables switch (State) { case ArmedState.Hit: - Colour = Color4.Green; + AccentColour = Color4.Green; break; } }