2017-05-03 14:50:42 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using OpenTK.Graphics;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2017-05-04 17:02:43 +08:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2017-05-03 14:50:42 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Judgements;
|
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|
|
|
|
{
|
|
|
|
|
public abstract class DrawableManiaHitObject<TObject> : DrawableHitObject<ManiaHitObject, ManiaJudgement>
|
|
|
|
|
where TObject : ManiaHitObject
|
|
|
|
|
{
|
|
|
|
|
public new TObject HitObject;
|
|
|
|
|
|
2017-05-04 17:02:43 +08:00
|
|
|
|
private readonly Container glowContainer;
|
|
|
|
|
|
2017-05-11 13:11:52 +08:00
|
|
|
|
protected DrawableManiaHitObject(TObject hitObject)
|
2017-05-03 14:50:42 +08:00
|
|
|
|
: base(hitObject)
|
|
|
|
|
{
|
|
|
|
|
HitObject = hitObject;
|
|
|
|
|
|
2017-05-09 19:33:59 +08:00
|
|
|
|
RelativePositionAxes = Axes.Y;
|
2017-05-16 16:34:41 +08:00
|
|
|
|
Y = (float)HitObject.StartTime;
|
2017-05-03 14:50:42 +08:00
|
|
|
|
|
2017-05-09 19:33:59 +08:00
|
|
|
|
Add(glowContainer = new Container
|
2017-05-03 14:50:42 +08:00
|
|
|
|
{
|
2017-05-09 19:33:59 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Masking = true,
|
|
|
|
|
Children = new[]
|
2017-05-09 19:55:20 +08:00
|
|
|
|
{
|
|
|
|
|
new Box
|
2017-05-04 17:02:43 +08:00
|
|
|
|
{
|
2017-05-09 19:55:20 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Alpha = 0,
|
|
|
|
|
AlwaysPresent = true
|
2017-05-04 17:02:43 +08:00
|
|
|
|
}
|
2017-05-09 19:55:20 +08:00
|
|
|
|
}
|
2017-05-09 19:33:59 +08:00
|
|
|
|
});
|
2017-05-03 14:50:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-05-04 17:02:43 +08:00
|
|
|
|
public override Color4 AccentColour
|
|
|
|
|
{
|
|
|
|
|
get { return base.AccentColour; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (base.AccentColour == value)
|
|
|
|
|
return;
|
|
|
|
|
base.AccentColour = value;
|
2017-05-03 14:50:42 +08:00
|
|
|
|
|
2017-05-04 17:02:43 +08:00
|
|
|
|
glowContainer.EdgeEffect = new EdgeEffect
|
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Glow,
|
|
|
|
|
Radius = 5,
|
|
|
|
|
Colour = value
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override ManiaJudgement CreateJudgement() => new ManiaJudgement();
|
2017-05-03 14:50:42 +08:00
|
|
|
|
}
|
|
|
|
|
}
|