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

Apply review: changed DelayUntilTransformsFinished to ArmedState check

This commit is contained in:
Joppe27 2022-10-19 23:31:23 +02:00
parent 9b123e7365
commit d83c398b58

View File

@ -4,6 +4,7 @@
#nullable disable #nullable disable
using System; using System;
using osu.Framework.Allocation;
using osu.Framework.Audio.Track; using osu.Framework.Audio.Track;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -14,6 +15,7 @@ using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Taiko.Objects; using osu.Game.Rulesets.Taiko.Objects;
using osuTK.Graphics; using osuTK.Graphics;
@ -155,17 +157,21 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
}; };
} }
[Resolved]
private DrawableHitObject drawableHitObject { get; set; }
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes) protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
{ {
if (!effectPoint.KiaiMode) if (!effectPoint.KiaiMode)
return; return;
FlashBox if (drawableHitObject.State.Value == ArmedState.Idle)
// Make sure the hit indicator usage of FlashBox doesn't get faded out prematurely by a kiai flash {
.DelayUntilTransformsFinished() FlashBox
.FadeTo(flash_opacity) .FadeTo(flash_opacity)
.Then() .Then()
.FadeOut(Math.Max(80, timingPoint.BeatLength - 80), Easing.OutSine); .FadeOut(Math.Max(80, timingPoint.BeatLength - 80), Easing.OutSine);
}
if (beatIndex % timingPoint.TimeSignature.Numerator != 0) if (beatIndex % timingPoint.TimeSignature.Numerator != 0)
return; return;