From b069372b2952cf95b0928c87ba3939dba6617967 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 3 Nov 2020 17:49:48 +0900 Subject: [PATCH] Fix skin changes resulting in incorrectly applied transforms in MainCirclePiece --- .../Drawables/Pieces/MainCirclePiece.cs | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/MainCirclePiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/MainCirclePiece.cs index cb3787a493..e2345de886 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/MainCirclePiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/MainCirclePiece.cs @@ -42,10 +42,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces private readonly IBindable accentColour = new Bindable(); private readonly IBindable indexInCurrentCombo = new Bindable(); + [Resolved] + private DrawableHitObject drawableObject { get; set; } + [BackgroundDependencyLoader] - private void load(DrawableHitObject drawableObject) + private void load() { - OsuHitObject osuObject = (OsuHitObject)drawableObject.HitObject; + var osuObject = (OsuHitObject)drawableObject.HitObject; state.BindTo(drawableObject.State); state.BindValueChanged(updateState, true); @@ -64,32 +67,35 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces private void updateState(ValueChangedEvent state) { - glow.FadeOut(400); - - switch (state.NewValue) + using (BeginAbsoluteSequence(drawableObject.HitObject.StartTime + (drawableObject.Result?.TimeOffset ?? 0), true)) { - case ArmedState.Hit: - const double flash_in = 40; - const double flash_out = 100; + glow.FadeOut(400); - flash.FadeTo(0.8f, flash_in) - .Then() - .FadeOut(flash_out); + switch (state.NewValue) + { + case ArmedState.Hit: + const double flash_in = 40; + const double flash_out = 100; - explode.FadeIn(flash_in); - this.ScaleTo(1.5f, 400, Easing.OutQuad); + flash.FadeTo(0.8f, flash_in) + .Then() + .FadeOut(flash_out); - using (BeginDelayedSequence(flash_in, true)) - { - // after the flash, we can hide some elements that were behind it - ring.FadeOut(); - circle.FadeOut(); - number.FadeOut(); + explode.FadeIn(flash_in); + this.ScaleTo(1.5f, 400, Easing.OutQuad); - this.FadeOut(800); - } + using (BeginDelayedSequence(flash_in, true)) + { + // after the flash, we can hide some elements that were behind it + ring.FadeOut(); + circle.FadeOut(); + number.FadeOut(); - break; + this.FadeOut(800); + } + + break; + } } } }