mirror of https://github.com/ppy/osu
Apply same immediate transform logic to `TaikoLegacyPlayfieldBackgroundRight` to fix it sticking during rewind
This commit is contained in:
parent
ebc75d40d2
commit
2fd535ea20
|
@ -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 System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Graphics;
|
||||
|
@ -16,7 +17,7 @@ public partial class TaikoLegacyPlayfieldBackgroundRight : BeatSyncedContainer
|
|||
{
|
||||
private Sprite kiai = null!;
|
||||
|
||||
private bool kiaiDisplayed;
|
||||
private bool isKiaiActive;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(ISkinSource skin)
|
||||
|
@ -41,17 +42,19 @@ private void load(ISkinSource skin)
|
|||
};
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
if (isKiaiActive)
|
||||
kiai.Alpha = (float)Math.Min(1, kiai.Alpha + Math.Abs(Clock.ElapsedFrameTime) / 200f);
|
||||
else
|
||||
kiai.Alpha = (float)Math.Max(0, kiai.Alpha - Math.Abs(Clock.ElapsedFrameTime) / 200f);
|
||||
}
|
||||
|
||||
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
|
||||
{
|
||||
base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);
|
||||
|
||||
if (effectPoint.KiaiMode != kiaiDisplayed)
|
||||
{
|
||||
kiaiDisplayed = effectPoint.KiaiMode;
|
||||
|
||||
kiai.ClearTransforms();
|
||||
kiai.FadeTo(kiaiDisplayed ? 1 : 0, 200);
|
||||
}
|
||||
isKiaiActive = effectPoint.KiaiMode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue