1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Reintroduce KiaiHitExplosion as skinnable

This commit is contained in:
Bartłomiej Dach 2020-11-10 13:35:49 +01:00 committed by smoogipoo
parent 81c9663e76
commit 00a486ab51
4 changed files with 52 additions and 11 deletions

View File

@ -18,6 +18,7 @@ namespace osu.Game.Rulesets.Taiko
TaikoExplosionMiss,
TaikoExplosionOk,
TaikoExplosionGreat,
TaikoExplosionKiai,
Scroller,
Mascot,
}

View File

@ -8,7 +8,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Taiko.Objects;
namespace osu.Game.Rulesets.Taiko.UI
@ -17,19 +16,13 @@ namespace osu.Game.Rulesets.Taiko.UI
{
public override bool RemoveWhenNotAlive => true;
public readonly DrawableHitObject JudgedObject;
private readonly HitType type;
public DefaultKiaiHitExplosion(DrawableHitObject judgedObject, HitType type)
public DefaultKiaiHitExplosion(HitType type)
{
JudgedObject = judgedObject;
this.type = type;
Anchor = Anchor.CentreLeft;
Origin = Anchor.Centre;
RelativeSizeAxes = Axes.Both;
Size = new Vector2(TaikoHitObject.DEFAULT_SIZE, 1);
Blending = BlendingParameters.Additive;

View File

@ -0,0 +1,47 @@
// 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.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Skinning;
using osuTK;
namespace osu.Game.Rulesets.Taiko.UI
{
public class KiaiHitExplosion : Container
{
public override bool RemoveWhenNotAlive => true;
[Cached(typeof(DrawableHitObject))]
public readonly DrawableHitObject JudgedObject;
private readonly HitType hitType;
private SkinnableDrawable skinnable;
public override double LifetimeStart => skinnable.Drawable.LifetimeStart;
public override double LifetimeEnd => skinnable.Drawable.LifetimeEnd;
public KiaiHitExplosion(DrawableHitObject judgedObject, HitType hitType)
{
JudgedObject = judgedObject;
this.hitType = hitType;
Anchor = Anchor.CentreLeft;
Origin = Anchor.Centre;
RelativeSizeAxes = Axes.Both;
Size = new Vector2(TaikoHitObject.DEFAULT_SIZE, 1);
}
[BackgroundDependencyLoader]
private void load()
{
Child = skinnable = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.TaikoExplosionKiai), _ => new DefaultKiaiHitExplosion(hitType));
}
}
}

View File

@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Taiko.UI
public const float DEFAULT_HEIGHT = 178;
private Container<HitExplosion> hitExplosionContainer;
private Container<DefaultKiaiHitExplosion> kiaiExplosionContainer;
private Container<KiaiHitExplosion> kiaiExplosionContainer;
private JudgementContainer<DrawableTaikoJudgement> judgementContainer;
private ScrollingHitObjectContainer drumRollHitContainer;
internal Drawable HitTarget;
@ -97,7 +97,7 @@ namespace osu.Game.Rulesets.Taiko.UI
drumRollHitContainer = new DrumRollHitContainer()
}
},
kiaiExplosionContainer = new Container<DefaultKiaiHitExplosion>
kiaiExplosionContainer = new Container<KiaiHitExplosion>
{
Name = "Kiai hit explosions",
RelativeSizeAxes = Axes.Both,
@ -219,7 +219,7 @@ namespace osu.Game.Rulesets.Taiko.UI
{
hitExplosionContainer.Add(new HitExplosion(drawableObject, result));
if (drawableObject.HitObject.Kiai)
kiaiExplosionContainer.Add(new DefaultKiaiHitExplosion(drawableObject, type));
kiaiExplosionContainer.Add(new KiaiHitExplosion(drawableObject, type));
}
private class ProxyContainer : LifetimeManagementContainer