2018-01-05 11:21:19 +00:00
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-09-11 06:24:28 +00:00
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
using OpenTK;
|
2017-09-11 05:35:18 +00:00
|
|
|
using OpenTK.Graphics;
|
|
|
|
using osu.Framework.Graphics;
|
2017-09-11 04:44:39 +00:00
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
2017-09-11 05:35:18 +00:00
|
|
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
2017-09-11 04:44:39 +00:00
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.UI
|
|
|
|
{
|
|
|
|
internal class HitExplosion : CompositeDrawable
|
|
|
|
{
|
|
|
|
private readonly Box inner;
|
|
|
|
|
2017-09-12 08:37:37 +00:00
|
|
|
public HitExplosion(DrawableHitObject judgedObject)
|
2017-09-11 04:44:39 +00:00
|
|
|
{
|
2017-09-11 05:35:18 +00:00
|
|
|
bool isTick = judgedObject is DrawableHoldNoteTick;
|
|
|
|
|
2017-09-11 04:44:39 +00:00
|
|
|
Anchor = Anchor.TopCentre;
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
2017-09-11 05:35:18 +00:00
|
|
|
Size = new Vector2(isTick ? 0.5f : 1);
|
2017-09-11 04:44:39 +00:00
|
|
|
FillMode = FillMode.Fit;
|
|
|
|
|
2017-09-11 06:43:23 +00:00
|
|
|
Blending = BlendingMode.Additive;
|
2017-09-11 04:44:39 +00:00
|
|
|
|
2017-09-11 05:35:18 +00:00
|
|
|
Color4 accent = isTick ? Color4.White : judgedObject.AccentColour;
|
|
|
|
|
2017-09-11 04:44:39 +00:00
|
|
|
InternalChild = new CircularContainer
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Masking = true,
|
|
|
|
BorderThickness = 1,
|
2017-09-11 05:35:18 +00:00
|
|
|
BorderColour = accent,
|
2017-09-11 04:44:39 +00:00
|
|
|
EdgeEffect = new EdgeEffectParameters
|
|
|
|
{
|
|
|
|
Type = EdgeEffectType.Glow,
|
2017-09-11 05:35:18 +00:00
|
|
|
Colour = accent,
|
2017-09-11 04:44:39 +00:00
|
|
|
Radius = 10,
|
|
|
|
Hollow = true
|
|
|
|
},
|
|
|
|
Child = inner = new Box
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2017-09-11 05:35:18 +00:00
|
|
|
Colour = accent,
|
2017-09-11 04:44:39 +00:00
|
|
|
Alpha = 1,
|
|
|
|
AlwaysPresent = true,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
|
|
|
|
2017-11-03 15:57:10 +00:00
|
|
|
this.ScaleTo(2f, 600, Easing.OutQuint).FadeOut(500);
|
2017-09-11 04:44:39 +00:00
|
|
|
inner.FadeOut(250);
|
2017-11-03 15:57:10 +00:00
|
|
|
|
|
|
|
Expire(true);
|
2017-09-11 04:44:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|