mirror of
https://github.com/ppy/osu
synced 2025-01-30 01:42:54 +00:00
Fix multiple issues with transform handling
This commit is contained in:
parent
a7f4325d3c
commit
47855de6ab
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user