mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:18:22 +08:00
Add legacy taiko kiai glow element
This commit is contained in:
parent
08a403cb33
commit
f3fa39f254
67
osu.Game.Rulesets.Taiko/Skinning/Legacy/LegacyKiaiGlow.cs
Normal file
67
osu.Game.Rulesets.Taiko/Skinning/Legacy/LegacyKiaiGlow.cs
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
// 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.Sprites;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Judgements;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
|
||||||
|
{
|
||||||
|
internal partial class LegacyKiaiGlow : Container
|
||||||
|
{
|
||||||
|
public LegacyKiaiGlow()
|
||||||
|
{
|
||||||
|
AlwaysPresent = true;
|
||||||
|
Alpha = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(ISkinSource skin)
|
||||||
|
{
|
||||||
|
Child = new Sprite
|
||||||
|
{
|
||||||
|
Texture = skin.GetTexture("taiko-glow"),
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Scale = new Vector2(0.75f),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[Resolved(CanBeNull = true)]
|
||||||
|
private IBeatSyncProvider? beatSyncProvider { get; set; }
|
||||||
|
|
||||||
|
[Resolved(CanBeNull = true)]
|
||||||
|
private HealthProcessor? healthProcessor { get; set; }
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
if (healthProcessor != null)
|
||||||
|
healthProcessor.NewJudgement += onNewJudgement;
|
||||||
|
|
||||||
|
if (beatSyncProvider != null)
|
||||||
|
{
|
||||||
|
if (beatSyncProvider.CheckIsKiaiTime())
|
||||||
|
this.FadeIn(180);
|
||||||
|
else
|
||||||
|
this.FadeOut(180);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onNewJudgement(JudgementResult result)
|
||||||
|
{
|
||||||
|
if (!result.IsHit)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.ScaleTo(1.1f, 50)
|
||||||
|
.Then().ScaleTo(1f, 50);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -129,6 +129,12 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
|
|||||||
case TaikoSkinComponents.Mascot:
|
case TaikoSkinComponents.Mascot:
|
||||||
return new DrawableTaikoMascot();
|
return new DrawableTaikoMascot();
|
||||||
|
|
||||||
|
case TaikoSkinComponents.KiaiGlow:
|
||||||
|
if (GetTexture("taiko-glow") != null)
|
||||||
|
return new LegacyKiaiGlow();
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new UnsupportedSkinComponentException(lookup);
|
throw new UnsupportedSkinComponentException(lookup);
|
||||||
}
|
}
|
||||||
|
@ -21,5 +21,6 @@ namespace osu.Game.Rulesets.Taiko
|
|||||||
TaikoExplosionKiai,
|
TaikoExplosionKiai,
|
||||||
Scroller,
|
Scroller,
|
||||||
Mascot,
|
Mascot,
|
||||||
|
KiaiGlow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,6 +112,10 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
FillMode = FillMode.Fit,
|
FillMode = FillMode.Fit,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
|
new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.KiaiGlow), _ => Empty())
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
hitExplosionContainer = new Container<HitExplosion>
|
hitExplosionContainer = new Container<HitExplosion>
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Loading…
Reference in New Issue
Block a user