2019-01-24 16:43:03 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2018-11-20 15:51:59 +08:00
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-04-02 13:51:28 +08:00
|
|
|
using osu.Framework.Graphics.Effects;
|
2018-04-13 17:19:50 +08:00
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.UI
|
|
|
|
{
|
2020-11-10 20:24:32 +08:00
|
|
|
public class DefaultKiaiHitExplosion : CircularContainer
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2018-06-11 19:42:04 +08:00
|
|
|
public override bool RemoveWhenNotAlive => true;
|
|
|
|
|
2020-04-27 11:23:53 +08:00
|
|
|
private readonly HitType type;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2020-11-10 20:35:49 +08:00
|
|
|
public DefaultKiaiHitExplosion(HitType type)
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2020-04-27 11:23:53 +08:00
|
|
|
this.type = type;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
2020-04-30 08:41:56 +08:00
|
|
|
Blending = BlendingParameters.Additive;
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
Masking = true;
|
|
|
|
Alpha = 0.25f;
|
|
|
|
|
|
|
|
Children = new[]
|
|
|
|
{
|
|
|
|
new Box
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Alpha = 0,
|
|
|
|
AlwaysPresent = true
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
{
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
|
|
|
{
|
|
|
|
Type = EdgeEffectType.Glow,
|
2020-04-27 11:23:53 +08:00
|
|
|
Colour = type == HitType.Rim ? colours.BlueDarker : colours.PinkDarker,
|
2018-04-13 17:19:50 +08:00
|
|
|
Radius = 60,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
this.ScaleTo(new Vector2(1, 3f), 500, Easing.OutQuint);
|
|
|
|
this.FadeOut(250);
|
|
|
|
|
2018-06-11 19:42:04 +08:00
|
|
|
Expire(true);
|
2018-04-13 17:19:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|