From 4ab636cbb80e090867f699707f88e028e79591bb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 27 Apr 2017 17:37:38 +0900 Subject: [PATCH] Update osu! drawables to use TransformSequences. --- .../Objects/Drawables/DrawableHitCircle.cs | 4 +--- .../Objects/Drawables/DrawableOsuHitObject.cs | 14 ++++++++++---- .../Objects/Drawables/DrawableSlider.cs | 6 ++---- .../Objects/Drawables/DrawableSliderTick.cs | 6 ++---- .../Objects/Drawables/DrawableSpinner.cs | 4 +--- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index 4c1a74c675..09bfffeefe 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -104,10 +104,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables ApproachCircle.ScaleTo(1.1f, TIME_PREEMPT); } - protected override void UpdateState(ArmedState state) + protected override void UpdateCurrentState(ArmedState state) { - base.UpdateState(state); - ApproachCircle.FadeOut(); double endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 2baf651cc0..60684f2042 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -21,17 +21,23 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected override OsuJudgement CreateJudgement() => new OsuJudgement { MaxScore = OsuScoreResult.Hit300 }; - protected override void UpdateState(ArmedState state) + protected override sealed void UpdateState(ArmedState state) { Flush(); UpdateInitialState(); - Delay(HitObject.StartTime - Time.Current - TIME_PREEMPT + Judgement.TimeOffset, true); + using (BeginAbsoluteSequence(HitObject.StartTime - TIME_PREEMPT, true)) + { + UpdatePreemptState(); - UpdatePreemptState(); + using (BeginDelayedSequence(TIME_PREEMPT + Judgement.TimeOffset, true)) + UpdateCurrentState(state); + } + } - Delay(TIME_PREEMPT, true); + protected virtual void UpdateCurrentState(ArmedState state) + { } protected virtual void UpdatePreemptState() diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index ed698f5ad3..b80f1d7178 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -158,10 +158,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables ball.Alpha = 0; } - protected override void UpdateState(ArmedState state) + protected override void UpdateCurrentState(ArmedState state) { - base.UpdateState(state); - ball.FadeIn(); Delay(slider.Duration, true); @@ -181,4 +179,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { void UpdateProgress(double progress, int repeat); } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index 86baf9f235..6b4d40e080 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -72,10 +72,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Delay(-animIn); } - protected override void UpdateState(ArmedState state) + protected override void UpdateCurrentState(ArmedState state) { - base.UpdateState(state); - switch (state) { case ArmedState.Idle: @@ -93,4 +91,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index 4623fe7f22..90a6d432c4 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -132,10 +132,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables disc.FadeIn(200); } - protected override void UpdateState(ArmedState state) + protected override void UpdateCurrentState(ArmedState state) { - base.UpdateState(state); - Delay(spinner.Duration, true); FadeOut(160);