mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:23:22 +08:00
Allow specifying two sprites for legacy hit explosions
This commit is contained in:
parent
deb207001a
commit
d5f1d94b51
@ -1,6 +1,7 @@
|
||||
// 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;
|
||||
|
||||
@ -8,14 +9,36 @@ namespace osu.Game.Rulesets.Taiko.Skinning
|
||||
{
|
||||
public class LegacyHitExplosion : CompositeDrawable
|
||||
{
|
||||
public LegacyHitExplosion(Drawable sprite)
|
||||
{
|
||||
InternalChild = sprite;
|
||||
private readonly Drawable sprite;
|
||||
private readonly Drawable strongSprite;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new legacy hit explosion.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Contrary to stable's, this implementation doesn't require a frame-perfect hit
|
||||
/// for the strong sprite to be displayed.
|
||||
/// </remarks>
|
||||
/// <param name="sprite">The normal legacy explosion sprite.</param>
|
||||
/// <param name="strongSprite">The strong legacy explosion sprite.</param>
|
||||
public LegacyHitExplosion(Drawable sprite, Drawable strongSprite = null)
|
||||
{
|
||||
this.sprite = sprite;
|
||||
this.strongSprite = strongSprite;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
AddInternal(sprite);
|
||||
|
||||
if (strongSprite != null)
|
||||
AddInternal(strongSprite.With(s => s.Alpha = 0));
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
Loading…
Reference in New Issue
Block a user