mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 17:22:58 +08:00
Minor visual change for DrawableHoldNoteTick.
This commit is contained in:
parent
4ef18ff135
commit
d6b104d794
@ -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;
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
Anchor = Anchor.TopCentre;
|
||||||
|
Origin = Anchor.TopCentre;
|
||||||
|
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
Size = new Vector2(1);
|
||||||
|
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
glowContainer = new CircularContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Masking = true,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Height = 1
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user