1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Fix multiple issues with transform handling

This commit is contained in:
Dean Herbert 2022-12-02 16:54:58 +09:00
parent a7f4325d3c
commit 47855de6ab

View File

@ -16,15 +16,13 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
{
internal partial class LegacyKiaiGlow : BeatSyncedContainer
{
public LegacyKiaiGlow()
{
AlwaysPresent = true;
Alpha = 0;
}
private bool isKiaiActive;
[BackgroundDependencyLoader]
private void load(ISkinSource skin)
[BackgroundDependencyLoader(true)]
private void load(ISkinSource skin, HealthProcessor? healthProcessor)
{
Alpha = 0;
Child = new Sprite
{
Texture = skin.GetTexture("taiko-glow"),
@ -33,14 +31,6 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
Scale = new Vector2(0.7f),
Colour = new Colour4(255, 228, 0, 255),
};
}
[Resolved(CanBeNull = true)]
private HealthProcessor? healthProcessor { get; set; }
protected override void Update()
{
base.Update();
if (healthProcessor != null)
healthProcessor.NewJudgement += onNewJudgement;
@ -48,16 +38,21 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
private void onNewJudgement(JudgementResult result)
{
if (!result.IsHit)
if (!result.IsHit || !isKiaiActive)
return;
this.ScaleTo(1.2f)
.Then().ScaleTo(1f, 80, Easing.OutQuad);
this.ScaleTo(1.2f).Then()
.ScaleTo(1f, 80, Easing.OutQuad);
}
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
{
if (effectPoint.KiaiMode)
if (effectPoint.KiaiMode == isKiaiActive)
return;
isKiaiActive = effectPoint.KiaiMode;
if (isKiaiActive)
this.FadeIn(180);
else
this.FadeOut(180);