2020-04-27 13:22:32 +00: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.
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.UI
|
|
|
|
{
|
|
|
|
internal class DefaultHitExplosion : CircularContainer
|
|
|
|
{
|
2020-09-25 10:25:58 +00:00
|
|
|
private readonly DrawableHitObject judgedObject;
|
|
|
|
private readonly HitResult result;
|
|
|
|
|
|
|
|
public DefaultHitExplosion(DrawableHitObject judgedObject, HitResult result)
|
|
|
|
{
|
|
|
|
this.judgedObject = judgedObject;
|
|
|
|
this.result = result;
|
|
|
|
}
|
2020-04-27 13:22:32 +00:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
|
|
|
BorderColour = Color4.White;
|
|
|
|
BorderThickness = 1;
|
|
|
|
|
2020-04-30 00:57:14 +00:00
|
|
|
Blending = BlendingParameters.Additive;
|
|
|
|
|
2020-04-27 13:22:32 +00:00
|
|
|
Alpha = 0.15f;
|
|
|
|
Masking = true;
|
|
|
|
|
2020-10-02 20:57:49 +00:00
|
|
|
if (!result.IsHit())
|
2020-04-27 13:22:32 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
bool isRim = (judgedObject.HitObject as Hit)?.Type == HitType.Rim;
|
|
|
|
|
|
|
|
InternalChildren = new[]
|
|
|
|
{
|
|
|
|
new Box
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Colour = isRim ? colours.BlueDarker : colours.PinkDarker,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
this.ScaleTo(3f, 1000, Easing.OutQuint);
|
2020-04-29 08:53:25 +00:00
|
|
|
this.FadeOut(500);
|
|
|
|
|
|
|
|
Expire(true);
|
2020-04-27 13:22:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|