1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-22 18:12:56 +08:00

Minor visual change for DrawableHoldNoteTick.

This commit is contained in:
smoogipooo 2017-05-24 21:24:18 +09:00
parent 4ef18ff135
commit d6b104d794
2 changed files with 46 additions and 7 deletions

View File

@ -11,6 +11,7 @@ using osu.Framework.Input;
using OpenTK; using OpenTK;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Judgements;
using osu.Framework.Extensions.IEnumerableExtensions;
namespace osu.Game.Rulesets.Mania.Objects.Drawables namespace osu.Game.Rulesets.Mania.Objects.Drawables
{ {
@ -109,6 +110,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
return; return;
base.AccentColour = value; base.AccentColour = value;
tickContainer.Children.ForEach(t => t.AccentColour = value);
bodyPiece.AccentColour = value; bodyPiece.AccentColour = value;
headNote.AccentColour = value; headNote.AccentColour = value;
tailNote.AccentColour = value; tailNote.AccentColour = value;

View File

@ -2,12 +2,12 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System; using System;
using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using OpenTK.Input; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Judgements;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
@ -18,19 +18,55 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
public Func<double> HoldStartTime; public Func<double> HoldStartTime;
public Func<bool> IsHolding; public Func<bool> IsHolding;
private readonly Container glowContainer;
public DrawableHoldNoteTick(HoldNoteTick hitObject) public DrawableHoldNoteTick(HoldNoteTick hitObject)
: base(hitObject, null) : base(hitObject, null)
{ {
Anchor = Anchor.TopCentre;
Origin = Anchor.TopCentre;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Size = new Vector2(1);
Children = new[] Children = new[]
{ {
new Box glowContainer = new CircularContainer
{ {
RelativeSizeAxes = Axes.X, Anchor = Anchor.TopCentre,
Height = 1 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(); protected override ManiaJudgement CreateJudgement() => new HoldNoteTickJudgement();
@ -56,7 +92,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
switch (State) switch (State)
{ {
case ArmedState.Hit: case ArmedState.Hit:
Colour = Color4.Green; AccentColour = Color4.Green;
break; break;
} }
} }